sparks

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2019 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// IPhoneDeveloper signing type
	IPhoneDeveloper = iota
	// IphoneDistribution signing type
	IphoneDistribution
	// MacDeveloper signing type
	MacDeveloper
	// MacDistribution signing type
	MacDistribution
)

Variables

View Source
var ConfigurationNames = []string{
	"debug",
	"release",
	"shipping",
}

ConfigurationNames is an ordered array of Configuration keys used to iterate over Configurations

View Source
var Configurations = map[string]Configuration{}

Configurations is the map of all registered configurations

View Source
var CurrentProduct = Product{}

CurrentProduct holds a reference to the currently loaded Sparks product from a .sparks file

View Source
var PlatformNames = []string{
	"osx",
	"ios",
	"android",
	"windows",
	"linux",
	"webgl",
}

PlatformNames is an ordered array of Platform keys used to iterate over Platforms

View Source
var Platforms = map[string]Platform{}

Platforms is the map of all registered platforms

View Source
var SigningIdentities = map[SigningType]string{}

SigningIdentities holds the list of detected signing type identities

View Source
var SigningIdentity string

SigningIdentity holds the name of the signing identity that will be used

View Source
var SigningTypeNames = []string{
	"iPhone Developer",
	"iPhone Distribution",
	"Mac Developer",
	"Mac Distribution",
}

SigningTypeNames is used to String a SigningType into a string

Functions

func Build

func Build(sourceDirectory string, outputDirectory string) error

Build builds a product in its defined && enabled platforms / configurations

func GenerateLuaBindings

func GenerateLuaBindings(sourceDirectory string, packageName string)

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 Get

func Get() error

Get is used to get packages and build dependencies

func Init

func Init()

Init needs to be called once at the beggining of the program to Initialize Sparks

func Load

func Load() error

Load loads a sparks product

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 Save

func Save()

Save saves a sparks product

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

func Shutdown

func Shutdown()

Shutdown needs to be called once at the end of the program to Shutdown Sparks

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) AddArg

func (cm *CMake) AddArg(arg string)

AddArg adds a string to the array of strings passed as parameters to cmake

func (*CMake) AddDefine

func (cm *CMake) AddDefine(key string, value string)

AddDefine adds a string to the array of strings passed as parameters to cmake

func (*CMake) Args

func (cm *CMake) Args() []string

Args returns the array of strings passed as parameters to cmake

func (*CMake) Run

func (cm *CMake) Run(outputDirectory string, args ...[]string) (string, error)

Run needs to be called once the parameters list is built. Run will output project files in outputDirectory

func (*CMake) SetArgs

func (cm *CMake) SetArgs(params []string)

SetArgs sets 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

func (*Product) Load

func (p *Product) Load() error

Load loads a .sparks file

func (*Product) Sample

func (p *Product) Sample()

Sample is used to generate sample sparks file

func (*Product) Save

func (p *Product) Save()

Save saves a .sparks file

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) Build

func (xc *XCode) Build(directory string, arg ...string) error

Build starts to build the project

func (*XCode) Clean

func (xc *XCode) Clean()

Clean cleans a built project

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL