command

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckRequirements

func CheckRequirements() error

CheckRequirements checks if the docker binary is in PATH

func Cmd

func Cmd(image string, vol volume.Volume, opts Options, cmdArgs []string) *exec.Cmd

Cmd returns a command to run in a new container for the specified image

func Run

func Run(image string, vol volume.Volume, opts Options, cmdArgs []string) error

Run runs a command in a new container for the specified image

func Usage

func Usage(commands []Command)

Usage prints the fyne-cross command usage

func WindowsResource

func WindowsResource(ctx Context) (string, error)

WindowsResource create a windows resource under the project root that will be automatically linked by compliler during the build

Types

type Android

type Android struct {
	Context
}

Android build and package the fyne app for the android OS

func (*Android) Description

func (cmd *Android) Description() string

Description returns the command description

func (*Android) Name

func (cmd *Android) Name() string

Name returns the one word command name

func (*Android) Parse

func (cmd *Android) Parse(args []string) error

Parse parses the arguments and set the usage for the command

func (*Android) Run

func (cmd *Android) Run() error

Run runs the command

func (*Android) Usage

func (cmd *Android) Usage()

Usage displays the command usage

type Architecture

type Architecture string

Architecture represents the Architecture type

const (
	// ArchAmd64 represents the amd64 architecture
	ArchAmd64 Architecture = "amd64"
	// Arch386 represents the amd64 architecture
	Arch386 Architecture = "386"
	// ArchArm64 represents the arm64 architecture
	ArchArm64 Architecture = "arm64"
	// ArchArm represents the arm architecture
	ArchArm Architecture = "arm"
)

func (Architecture) String

func (a Architecture) String() string

type Command

type Command interface {
	Name() string              // Name returns the one word command name
	Description() string       // Description returns the command description
	Parse(args []string) error // Parse parses the cli arguments
	Usage()                    // Usage displays the command usage
	Run() error                // Run runs the command
}

Command wraps the methods for a fyne-cross command

type CommonFlags

type CommonFlags struct {
	// AppID represents the application ID used for distribution
	AppID string
	// CacheDir is the directory used to share/cache sources and dependencies.
	// Default to system cache directory (i.e. $HOME/.cache/fyne-cross)
	CacheDir string
	// DockerImage represents a custom docker image to use for build
	DockerImage string
	// Env is the list of custom env variable to set. Specified as "KEY=VALUE"
	Env envFlag
	// Icon represents the application icon used for distribution
	Icon string
	// Ldflags represents the flags to pass to the external linker
	Ldflags string
	// Additional build tags
	Tags tagsFlag
	// NoCache if true will not use the go build cache
	NoCache bool
	// NoStripDebug if true will not strip debug information from binaries
	NoStripDebug bool
	// Output represents the named output file
	Output string
	// RootDir represents the project root directory
	RootDir string
	// Silent enables the silent mode
	Silent bool
	// Debug enables the debug mode
	Debug bool
	// Pull attempts to pull a newer version of the docker image
	Pull bool
}

CommonFlags holds the flags shared between all commands

type Context

type Context struct {
	// Volume holds the mounted volumes between host and containers
	volume.Volume

	Architecture          // Arch defines the target architecture
	Env          []string // Env is the list of custom env variable to set. Specified as "KEY=VALUE"
	ID           string   // ID is the context ID
	LdFlags      []string // LdFlags defines the ldflags to use
	OS           string   // OS defines the target OS
	Tags         []string // Tags defines the tags to use

	AppID        string // AppID is the appID to use for distribution
	CacheEnabled bool   // CacheEnabled if true enable go build cache
	DockerImage  string // DockerImage defines the docker image used to build
	Icon         string // Icon is the optional icon in png format to use for distribution
	Output       string // Output is the name output
	Package      string // Package is the package to build named by the import path as per 'go build'
	StripDebug   bool   // StripDebug if true, strips binary output
	Debug        bool   // Debug if true enable debug log
	Pull         bool   // Pull if true attempts to pull a newer version of the docker image
}

Context represent a build context

func (Context) String

func (ctx Context) String() string

String implements the Stringer interface

type Darwin

type Darwin struct {
	Context []Context
}

Darwin build and package the fyne app for the darwin OS

func (*Darwin) Description

func (cmd *Darwin) Description() string

Description returns the command description

func (*Darwin) Name

func (cmd *Darwin) Name() string

Name returns the one word command name

func (*Darwin) Parse

func (cmd *Darwin) Parse(args []string) error

Parse parses the arguments and set the usage for the command

func (*Darwin) Run

func (cmd *Darwin) Run() error

Run runs the command

func (*Darwin) Usage

func (cmd *Darwin) Usage()

Usage displays the command usage

type FreeBSD

type FreeBSD struct {
	Context []Context
}

FreeBSD build and package the fyne app for the freebsd OS

func (*FreeBSD) Description

func (cmd *FreeBSD) Description() string

Description returns the command description

func (*FreeBSD) Name

func (cmd *FreeBSD) Name() string

Name returns the one word command name

func (*FreeBSD) Parse

func (cmd *FreeBSD) Parse(args []string) error

Parse parses the arguments and set the usage for the command

func (*FreeBSD) Run

func (cmd *FreeBSD) Run() error

Run runs the command

func (*FreeBSD) Usage

func (cmd *FreeBSD) Usage()

Usage displays the command usage

type IOS

type IOS struct {
	Context Context
}

IOS build and package the fyne app for the ios OS

func (*IOS) Description

func (cmd *IOS) Description() string

Description returns the command description

func (*IOS) Name

func (cmd *IOS) Name() string

Name returns the one word command name

func (*IOS) Parse

func (cmd *IOS) Parse(args []string) error

Parse parses the arguments and set the usage for the command

func (*IOS) Run

func (cmd *IOS) Run() error

Run runs the command

func (*IOS) Usage

func (cmd *IOS) Usage()

Usage displays the command usage

type Linux

type Linux struct {
	Context []Context
}

Linux build and package the fyne app for the linux OS

func (*Linux) Description

func (cmd *Linux) Description() string

Description returns the command description

func (*Linux) Name

func (cmd *Linux) Name() string

Name returns the one word command name

func (*Linux) Parse

func (cmd *Linux) Parse(args []string) error

Parse parses the arguments and set the usage for the command

func (*Linux) Run

func (cmd *Linux) Run() error

Run runs the command

func (*Linux) Usage

func (cmd *Linux) Usage()

Usage displays the command usage

type Options

type Options struct {
	CacheEnabled bool     // CacheEnabled if true enable go build cache
	Env          []string // Env is the list of custom env variable to set. Specified as "KEY=VALUE"
	WorkDir      string   // WorkDir set the workdir, default to volume's workdir
	Debug        bool     // Debug if true enable log verbosity
}

Options define the options for the docker run command

type Version

type Version struct{}

Version is the version command

func (*Version) Description

func (cmd *Version) Description() string

Description returns the command description

func (*Version) Name

func (cmd *Version) Name() string

Name returns the one word command name

func (*Version) Parse

func (cmd *Version) Parse(args []string) error

Parse parses the arguments and set the usage for the command

func (*Version) Run

func (cmd *Version) Run() error

Run runs the command

func (*Version) Usage

func (cmd *Version) Usage()

Usage displays the command usage

type Windows

type Windows struct {
	CmdContext []Context
}

Windows build and package the fyne app for the windows OS

func (*Windows) Description

func (cmd *Windows) Description() string

Description returns the command description

func (*Windows) Name

func (cmd *Windows) Name() string

Name returns the one word command name

func (*Windows) Parse

func (cmd *Windows) Parse(args []string) error

Parse parses the arguments and set the usage for the command

func (*Windows) Run

func (cmd *Windows) Run() error

Run runs the command

func (*Windows) Usage

func (cmd *Windows) Usage()

Usage displays the command usage

Jump to

Keyboard shortcuts

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