Documentation ¶
Overview ¶
Some general utility functions for goxc
Index ¶
- Constants
- func ContainsString(h []string, n string) bool
- func FileExists(path string) (bool, error)
- func GetAbsoluteBin(goos, arch string, ...) (string, error)
- func GetAppName(specifiedAppName, workingDirectory string) string
- func GetGoPathElement(workingDirectory string) string
- func GetMakeScriptPath(goroot string) string
- func GetOutDestRoot(appName string, workingDirectory string, templateText string) (string, error)
- func GoBin(workingDirectory string) string
- func ParseCommaGlobs(commaGlob string) []string
- func ParseIncludeResources(basedir, includeResources, excludeResources string, isVerbose bool) []string
- func SanityCheck(goroot string) error
- func UserHomeDir() string
- type BinNameVars
- type RootDirVars
Constants ¶
const ( ARTIFACTS_DEST_TEMPLATE_DEFAULT = "{{.GoBin}}{{.PS}}{{.AppName}}-xc" OUTFILE_TEMPLATE_DEFAULT = "{{.Dest}}{{.PS}}{{.Version}}{{.PS}}{{.Os}}_{{.Arch}}{{.PS}}{{.ExeName}}{{.Ext}}" OUTFILE_TEMPLATE_FORMARKDOWN = "{{.Dest}}{{.PS}}{{.Os}}_{{.Arch}}{{.PS}}{{.ExeName}}{{.Ext}}" BUILD_CONSTRAINTS_DEFAULT = "" CODESIGN_DEFAULT = "" // Default resources to include. Comma-separated list of globs. RESOURCES_INCLUDE_DEFAULT = "INSTALL*,README*,LICENSE*" RESOURCES_EXCLUDE_DEFAULT = "*.go" //TODO // Main dirs to exclude by default (Godeps!) MAIN_DIRS_EXCLUDE_DEFAULT = "Godeps" OS_DEFAULT = "" ARCH_DEFAULT = "" PACKAGE_VERSION_DEFAULT = "snapshot" PRERELEASE_INFO_DEFAULT = "SNAPSHOT" BRANCH_ORIGINAL = "original" VerbosityDefault = "d" VerbosityQuiet = "q" //TODO VerbosityVerbose = "v" GOXC_FILE_EXT = ".goxc.json" GOXC_LOCAL_FILE_EXT = ".goxc.local.json" GOXC_CONFIGNAME_DEFAULT = "default" GOXC_CONFIGNAME_BASE = "" //taskname required by config/json TASK_BUILD_TOOLCHAIN = "toolchain" //windows required inside core methods WINDOWS = "windows" )
defaults ...
const (
// Message to install go from source, incase it is missing
MSG_INSTALL_GO_FROM_SOURCE = "goxc requires Go to be installed from Source. Please follow instructions at http://golang.org/doc/install/source"
)
messages ... int8n?
Variables ¶
This section is empty.
Functions ¶
func ContainsString ¶
Check if slice contains a string. DEPRECATED: use equivalent func inside typeutils.
func FileExists ¶
simple fileExists method which inspects the error from os.Stat
func GetAbsoluteBin ¶
func GetAppName ¶
Get application name (defaults to dirname)
func GetGoPathElement ¶
Tries to find the most relevant GOPATH element. First, tries to find an element which is a parent of the current directory. If not, it uses the first one.
func GetMakeScriptPath ¶
get the path to the 'make' batch script within the GO source tree. i.e. runtime.GOOS / src / make.bat|bash
func GetOutDestRoot ¶
func ParseCommaGlobs ¶
func ParseIncludeResources ¶
func ParseIncludeResources(basedir, includeResources, excludeResources string, isVerbose bool) []string
Glob parser for 'Include resources' TODO generalise for exclude resources and any other globs.
func SanityCheck ¶
Basic system sanity check. Checks GOROOT is set and 'make' batch script exists. TODO: in future this could check for existence of gcc/mingw/alternative
func UserHomeDir ¶
func UserHomeDir() string