cmd

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package cmd provides supporting functions for the matcha command line tool.

Index

Constants

This section is empty.

Variables

View Source
var BindFile = `` /* 134-byte string literal not displayed */

Functions

func AndroidAPIPath added in v0.2.0

func AndroidAPIPath() (string, error)

androidAPIPath returns an android SDK platform directory under ANDROID_HOME. If there are multiple platforms that satisfy the minimum version requirement androidAPIPath returns the latest one among them.

func ArchClang

func ArchClang(goarch string) string

func Bind

func Bind(flags *Flags, args []string) error

func Build

func Build(flags *Flags, args []string) error

func BuildAAR added in v0.2.0

func BuildAAR(flags *Flags, androidDir string, pkgs []*build.Package, androidArchs []string, tmpdir string, aarPath string) (err error)

AAR is the format for the binary distribution of an Android Library Project and it is a ZIP archive with extension .aar. http://tools.android.com/tech-docs/new-build-system/aar-format

These entries are directly at the root of the archive.

AndroidManifest.xml (mandatory)
classes.jar (mandatory)
assets/ (optional)
jni/<abi>/libgojni.so
R.txt (mandatory)
res/ (mandatory)
libs/*.jar (optional, not relevant)
proguard.txt (optional)
lint.jar (optional, not relevant)
aidl (optional, not relevant)

javac and jar commands are needed to build classes.jar.

func BuildJar added in v0.2.0

func BuildJar(flags *Flags, w io.Writer, srcDir string, tmpdir string) error

func CopyDir

func CopyDir(f *Flags, dst, src string) error

func CopyDirContents

func CopyDirContents(f *Flags, dst, src string) error

func CopyFile

func CopyFile(f *Flags, dst, src string) error

func Darwin386Env

func Darwin386Env(f *Flags) ([]string, error)

func DarwinAmd64Env

func DarwinAmd64Env(f *Flags) ([]string, error)

func DarwinArm64Env

func DarwinArm64Env(f *Flags) ([]string, error)

func DarwinArmEnv

func DarwinArmEnv(f *Flags) ([]string, error)

func EnvClang

func EnvClang(flags *Flags, sdkName string) (_clang, cflags string, err error)

Get clang path and clang flags (SDK Path).

func Environ

func Environ(kv []string) []string

environ merges os.Environ and the given "key=value" pairs. If a key is in both os.Environ and kv, kv takes precedence.

func GetAndroidABI added in v0.2.0

func GetAndroidABI(arch string) string

func GetAndroidEnv added in v0.2.0

func GetAndroidEnv(gomobpath string) (map[string][]string, error)

func Getenv

func Getenv(env []string, key string) string

func GoBuild

func GoBuild(f *Flags, src string, env []string, ctx build.Context, tmpdir string, args ...string) error

func GoCmd

func GoCmd(f *Flags, subcmd string, srcs []string, env []string, ctx build.Context, tmpdir string, args ...string) error

func GoEnv

func GoEnv(name string) string

Returns the go enviromental variable for name.

func GoInstall

func GoInstall(f *Flags, srcs []string, env []string, ctx build.Context, tmpdir string, args ...string) error

func GoMobilePath

func GoMobilePath() (string, error)

$GOPATH/pkg/gomobile

func GoVersion

func GoVersion(f *Flags) ([]byte, error)

func Import

func Import(ctx *build.Context, path, srcDir string, mode build.ImportMode, pkgs map[string]*build.Package) error

func ImportAll

func ImportAll(ctx *build.Context, paths []string, srcDir string, mode build.ImportMode) (map[string]*build.Package, error)

func Init

func Init(flags *Flags) error

func InstallPkg

func InstallPkg(f *Flags, temporarydir string, pkg string, env []string, args ...string) error

Build package with properties.

func Mkdir

func Mkdir(flags *Flags, dir string) error

func NDKRoot added in v0.2.0

func NDKRoot() (string, error)

func NewTmpDir

func NewTmpDir(f *Flags, path string) (string, error)

Creates a new temporary directory. Don't forget to remove.

func PackageDir

func PackageDir(f *Flags, pkgpath string) (string, error)

Returns the directory for a given package.

func ParseTargets added in v0.2.0

func ParseTargets(a string) map[string]struct{}

func PkgPath

func PkgPath(env []string) (string, error)

$GOPATH/pkg/gomobile/pkg_darwin_arm64

func PrintCmd

func PrintCmd(cmd *exec.Cmd)

func ReadFile

func ReadFile(flags *Flags, filename string) ([]byte, error)

func RemoveAll

func RemoveAll(f *Flags, path string) error

func RunCmd

func RunCmd(f *Flags, tmpdir string, cmd *exec.Cmd) error
func Symlink(flags *Flags, src, dst string) error

func WriteFile

func WriteFile(flags *Flags, filename string, generate func(io.Writer) error) error

func XcodeAvailable

func XcodeAvailable() bool

Types

type Flags

type Flags struct {
	BuildN       bool   // print commands but don't run
	BuildX       bool   // print commands
	BuildV       bool   // print package names
	BuildWork    bool   // use working directory
	BuildGcflags string // -gcflags
	BuildLdflags string // -ldflags
	BuildO       string // output path
	BuildBinary  bool
	BuildTargets string
}

func (*Flags) ShouldPrint

func (f *Flags) ShouldPrint() bool

func (*Flags) ShouldRun

func (f *Flags) ShouldRun() bool

Directories

Path Synopsis
Package matcha provides the implementation for the matcha command line tool.
Package matcha provides the implementation for the matcha command line tool.

Jump to

Keyboard shortcuts

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