core

package
v0.0.0-...-17c0c07 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2015 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Some general utility functions for goxc

Index

Constants

View Source
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,testdata"

	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 ...

View Source
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

func ContainsString(h []string, n string) bool

Check if slice contains a string. DEPRECATED: use equivalent func inside typeutils.

func FileExists

func FileExists(path string) (bool, error)

simple fileExists method which inspects the error from os.Stat

func GetAbsoluteBin

func GetAbsoluteBin(goos, arch string, appName, exeName, workingDirectory, fullVersionName, templateText string, artifactsDestSetting string) (string, error)

func GetAppName

func GetAppName(specifiedAppName, workingDirectory string) string

Get application name (defaults to dirname)

func GetGoPathElement

func GetGoPathElement(workingDirectory string) string

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

func GetMakeScriptPath(goroot string) string

get the path to the 'make' batch script within the GO source tree. i.e. runtime.GOOS / src / make.bat|bash

func GetOutDestRoot

func GetOutDestRoot(appName string, workingDirectory string, templateText string) (string, error)

func GoBin

func GoBin(workingDirectory string) string

func ParseCommaGlobs

func ParseCommaGlobs(commaGlob string) []string

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

func SanityCheck(goroot string) error

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

Types

type BinNameVars

type BinNameVars struct {
	RootDirVars
	Dest    string
	ExeName string
	Version string
	Os      string
	Arch    string
	Ext     string
}

type RootDirVars

type RootDirVars struct {
	GoBin    string
	MyGoPath string
	Home     string
	AppName  string
	PS       string
}

Jump to

Keyboard shortcuts

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