Documentation ¶
Index ¶
- Constants
- Variables
- func Build(sourceDirectory string, outputDirectory string) error
- func GenerateLuaBindings(sourceDirectory string, packageName string)
- func Get() error
- func Init()
- func Load() error
- func RegisterConfiguration(configuration Configuration)
- func RegisterPlatform(platform Platform)
- func Save()
- func SetEnabledConfigurations(configurations []bool)
- func SetEnabledPlatforms(platforms []bool)
- func Shutdown()
- type CMake
- type Configuration
- type Platform
- type Product
- type SigningType
- type XCode
Constants ¶
const ( // IPhoneDeveloper signing type IPhoneDeveloper = iota // IphoneDistribution signing type IphoneDistribution // MacDeveloper signing type MacDeveloper // MacDistribution signing type MacDistribution )
Variables ¶
var ConfigurationNames = []string{
"debug",
"release",
"shipping",
}
ConfigurationNames is an ordered array of Configuration keys used to iterate over Configurations
var Configurations = map[string]Configuration{}
Configurations is the map of all registered configurations
var CurrentProduct = Product{}
CurrentProduct holds a reference to the currently loaded Sparks product from a .sparks file
var PlatformNames = []string{
"osx",
"ios",
"android",
"windows",
"linux",
"webgl",
}
PlatformNames is an ordered array of Platform keys used to iterate over Platforms
var Platforms = map[string]Platform{}
Platforms is the map of all registered platforms
var SigningIdentities = map[SigningType]string{}
SigningIdentities holds the list of detected signing type identities
var SigningIdentity string
SigningIdentity holds the name of the signing identity that will be used
var SigningTypeNames = []string{
"iPhone Developer",
"iPhone Distribution",
"Mac Developer",
"Mac Distribution",
}
SigningTypeNames is used to String a SigningType into a string
Functions ¶
func GenerateLuaBindings ¶
GenerateLuaBindings generates C/C++ code from the definition of a package defined with packageName. It invokes tolua++ and has complex toluahooks that also generates C++ class reflection
func Init ¶
func Init()
Init needs to be called once at the beggining of the program to Initialize Sparks
func RegisterConfiguration ¶
func RegisterConfiguration(configuration Configuration)
RegisterConfiguration allows external code to register a new configuration as long as it respects the Configuration interface
func RegisterPlatform ¶
func RegisterPlatform(platform Platform)
RegisterPlatform allows external code to register a new platform as long as it respects the Platform interface
func SetEnabledConfigurations ¶
func SetEnabledConfigurations(configurations []bool)
SetEnabledConfigurations is used to enable / disable build configurations, configurations comes ordered like ConfigurationNames
func SetEnabledPlatforms ¶
func SetEnabledPlatforms(platforms []bool)
SetEnabledPlatforms is used to enable / disable build platforms, platforms parameter comes ordered like PlatformNames
Types ¶
type CMake ¶
type CMake struct {
// contains filtered or unexported fields
}
CMake is a wrapper class around cmake
func NewCMake ¶
func NewCMake(platform Platform, configuration Configuration) *CMake
NewCMake returns an instance of a new CMake class
func (*CMake) AddDefine ¶
AddDefine adds a string to the array of strings passed as parameters to cmake
type Configuration ¶
type Configuration interface { Name() string Title() string Opt() string Enabled() bool SetEnabled(bool) }
Configuration Interface used to represent a build configuration
type Platform ¶
type Platform interface { Name() string Title() string Opt() string Enabled() bool SetEnabled(bool) Get() error Clean() error Build(Configuration) error }
Platform Interface used to represent a sparks supported platform
type Product ¶
type Product struct { Name string `yaml:"Name"` Version string `yaml:"Version"` Language string `yaml:"Language"` Locales string `yaml:"Locales"` Platforms []string `yaml:"Platforms"` View struct { DefaultOrientation string `yaml:"DefaultOrientation"` SupportedOrientations []string `yaml:"SupportedOrientations"` Resolution string `yaml:"Resolution"` Fullscreen string `yaml:"Fullscreen"` } `yaml:"View"` Assets struct { Pack string `yaml:"Pack"` } `yaml:"Assets"` NativeModules []string `yaml:"NativeModules"` MarkettingURL string `yaml:"MarkettingUrl"` SupportURL string `yaml:"SupportUrl"` PrivacyURL string `yaml:"PrivacyUrl"` Copyright string `yaml:"Copyright"` Windows struct { MsiProductID string `yaml:"msiProductId"` } `yaml:"Windows"` IOS struct { BundleIdentifier string `yaml:"BundleIdentifier"` } `yaml:"iOS"` Description string `yaml:"Description"` Keywords string `yaml:"Keywords"` ReviewNotes string `yaml:"ReviewNotes"` // contains filtered or unexported fields }
Product struct
type SigningType ¶
type SigningType int
SigningType represents the type of signing used to sign an OSX or iOS application
func (SigningType) String ¶
func (st SigningType) String() string
type XCode ¶
type XCode struct {
// contains filtered or unexported fields
}
XCode is a wrapper class around the xcodebuild command
func NewXCode ¶
func NewXCode(platform Platform, configuration Configuration) *XCode
NewXCode returns a new instance of XCode
func (*XCode) DetectSigning ¶
func (xc *XCode) DetectSigning()
DetectSigning detects the currently imported Signing identities into OSX / XCode and fills the sparks.SigningIdentities array with them
func (*XCode) SelectSigning ¶
func (xc *XCode) SelectSigning(signingType SigningType) (string, error)
SelectSigning returns the configured signing identity provided a signing type