command

package
v0.0.0-...-2a6ebbc Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cmd

func Cmd(image string, vol volume.Volume, opts Options, cmdArgs []string) *execabs.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 []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"
	// ArchMultiple represents the universal architecture used by some OS to
	// identify a binary that supports multiple architectures (fat binary)
	ArchMultiple Architecture = "multiple"
)

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 {
	// AppBuild represents the build number, should be greater than 0 and
	// incremented for each build
	AppBuild int
	// AppID represents the application ID used for distribution
	AppID string
	// AppVersion represents the version number in the form x, x.y or x.y.z semantic version
	AppVersion 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
	// Engine is the container engine to use
	Engine engineFlag
	// 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
	// Name represents the application name
	Name string
	// Release represents if the package should be prepared for release (disable debug etc)
	Release bool
	// 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
	Engine       Engine            // Engine is the container engine to use
	Env          map[string]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

	AppBuild     string // Build number
	AppID        string // AppID is the appID to use for distribution
	AppVersion   string // AppVersion is the version number in the form x, x.y or x.y.z semantic version
	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
	Name         string // Name is the application name
	Package      string // Package is the package to build named by the import path as per 'go build'
	Release      bool   // Enable release mode. If true, prepares an application for public distribution
	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

	// Release context
	Category     string //Category represents the category of the app for store listing [macOS]
	Certificate  string //Certificate represents the name of the certificate to sign the build [iOS, Windows]
	Developer    string //Developer represents the developer identity for your Microsoft store account [Windows]
	Keystore     string //Keystore represents the location of .keystore file containing signing information [Android]
	KeystorePass string //KeystorePass represents the password for the .keystore file [Android]
	KeyPass      string //KeyPass represents the assword for the signer's private key, which is needed if the private key is password-protected [Android]
	Password     string //Password represents the password for the certificate used to sign the build [Windows]
	Profile      string //Profile represents the name of the provisioning profile for this release build [iOS]
}

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
	// contains filtered or unexported fields
}

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 DarwinImage

type DarwinImage struct {
	// contains filtered or unexported fields
}

DarwinImage builds the darwin docker image

func (*DarwinImage) Description

func (cmd *DarwinImage) Description() string

Description returns the command description

func (*DarwinImage) Name

func (cmd *DarwinImage) Name() string

Name returns the one word command name

func (*DarwinImage) Parse

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

Parse parses the arguments and set the usage for the command

func (*DarwinImage) Run

func (cmd *DarwinImage) Run() error

Run runs the command

func (*DarwinImage) Set

func (ef *DarwinImage) Set(value string) error

Set is the method to set the flag value, part of the flag.Value interface. Set's argument is a string to be parsed to set the flag.

func (*DarwinImage) String

func (ef *DarwinImage) String() string

String is the method to format the flag's value, part of the flag.Value interface. The String method's output will be used in diagnostics.

func (*DarwinImage) Usage

func (cmd *DarwinImage) Usage()

Usage displays the command usage

type Engine

type Engine struct {
	Name   string
	Binary string
}

func MakeEngine

func MakeEngine(e string) (Engine, error)

MakeEngine returns a new container engine. Pass empty string to autodetect

func (Engine) IsDocker

func (e Engine) IsDocker() bool

func (Engine) IsPodman

func (e Engine) IsPodman() bool

func (Engine) String

func (e Engine) String() string

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
	Engine       Engine            // Engine is the container engine to use
	Env          map[string]string // Env is the list of custom env variable to set
	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 Web

type Web struct {
	Context Context
}

Web build and package the fyne app for the web

func (*Web) Description

func (cmd *Web) Description() string

Description returns the command description

func (*Web) Name

func (cmd *Web) Name() string

Name returns the one word command name

func (*Web) Parse

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

Parse parses the arguments and set the usage for the command

func (*Web) Run

func (cmd *Web) Run() error

Run runs the command

func (*Web) Usage

func (cmd *Web) 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