Documentation
¶
Index ¶
- Constants
- Variables
- func Aapt2Path() (string, error)
- func AndroidBuildToolsPath() string
- func CopyExeFile(src, tgt string) error
- func CopyFile(source, target string) error
- func EnsureAbsPath(path string) string
- func EnsureSubDir(parent, name string) string
- func Exists(path string) bool
- func ExtractDirFromZip(zipPath, prefix, destDir string) error
- func ExtractFileFromZip(zipPath, fileName, destPath string) error
- func ExtractFileFromZipBytes(b []byte, fileName, destPath string) error
- func JoinComma(l []string) string
- func JoinSpace(l []string) string
- func LookupDirWithGoMod(workDir string) (string, error)
- func MakePathRelativeTo(root, path string) string
- func RequireAndroidSDK() error
- func SplitComma(s string) []string
- func SplitDot(s string) []string
- func SplitSlash(s string) []string
- func WriteScaledPNG(src, dst string, size int) error
- type CompilerInfo
Constants ¶
const ( PermGroupExec = 0o10 PermGroupRead = 0o40 PermGroupWrite = 0o20 PermOtherExec = 0o1 PermOtherRead = 0o4 PermOtherWrite = 0o2 PermUserExec = 0o100 PermUserRead = 0o400 PermUserReadWriteExec = PermUserExec | PermUserRead | PermUserWrite PermUserWrite = 0o200 )
Constants for file permissions to be combined using `|`.
const ( DirPermDefault = PermGroupExec | PermGroupRead | PermOtherExec | PermOtherRead | PermUserReadWriteExec FilePermDefault = PermGroupRead | PermGroupWrite | PermOtherRead | PermOtherWrite | PermUserRead | PermUserWrite )
Variables ¶
var ( ErrNoCompilerFound = errors.New("failed to detect compiler") ErrInvalidVersion = errors.New("failed to parse version") )
Functions ¶
func AndroidBuildToolsPath ¶
func AndroidBuildToolsPath() string
AndroidBuildToolsPath tries to find the location of the "build-tools" directory. This depends on ANDROID_HOME variable, so you should call RequireAndroidSDK() first.
func CopyExeFile ¶
CopyExeFile copies the content of an executable file, source, into target path.
func EnsureAbsPath ¶
EnsureAbsPath returns the absolute path of the given file if it is not already absolute
func EnsureSubDir ¶
EnsureSubDir will make sure a named directory exists within the parent - creating it if not.
func ExtractDirFromZip ¶ added in v1.7.3
ExtractDirFromZip extracts all files with a given prefix from a zip archive
func ExtractFileFromZip ¶ added in v1.7.3
ExtractFileFromZip extracts a single file from a zip archive
func ExtractFileFromZipBytes ¶ added in v1.7.3
ExtractFileFromZipReader extracts a single file from an open zip archive handle
func JoinComma ¶ added in v1.7.3
JoinComma takes a list of strings and joins them with comma as separator.
func JoinSpace ¶ added in v1.7.3
JoinSpace takes a list of strings and joins them with space as separator.
func LookupDirWithGoMod ¶ added in v1.7.3
LookupDirWithGoMod takes a directory and checks for a go.mod file, traverses back towards the root, and returns the first directory with a match. In case of a relative path the traversal stops at the relative root
func MakePathRelativeTo ¶
MakePathRelativeTo joins root with path if path is not absolute and exists in root
func RequireAndroidSDK ¶
func RequireAndroidSDK() error
RequireAndroidSDK will return an error if it cannot establish the location of a valid Android SDK installation. This is currently deduced using ANDROID_HOME environment variable.
func SplitComma ¶ added in v1.7.3
SplitComma returns a slice of strings by splitting then given string by comma.
func SplitDot ¶ added in v1.7.3
SplitDot returns a slice of strings by splitting then given string by dot.
func SplitSlash ¶ added in v1.7.3
SplitSlash returns a slice of strings by splitting then given string by slash.
func WriteScaledPNG ¶ added in v1.7.4
WriteScaledPNG decodes the PNG at src, scales it to size pixels square and writes it to dst.
Types ¶
type CompilerInfo ¶ added in v1.7.3
CompilerInfo holds detected compiler information.
func DetectCompiler ¶ added in v1.7.3
func DetectCompiler(s, os string) (*CompilerInfo, error)
DetectCompiler takes the output of `cc --version` and tries to detect the compiler, compiler version, and os name when available.