Documentation ¶
Index ¶
- func Debug(i ...interface{})
- func DirExists(path string) bool
- func GetAssetString(aciAsset, localAsset string) string
- func GetBinaryName(binDir, useBinary string) (string, error)
- func GetVCSInfo(projPath string) (string, string, error)
- func Info(i ...interface{})
- func InitDebug()
- func PrepareAssets(assets []string, rootfs string, placeholderMapping map[string]string) error
- func RunCmd(args, env []string, cwd string) error
- func RunCmdFull(execProg string, args, env []string, cwd string, stdout, stderr io.Writer) error
- func Warn(i ...interface{})
- type Builder
- type BuilderCustomizations
- type BzrInfo
- type CmakeConfiguration
- type CmakeCustomizations
- func (custom *CmakeCustomizations) GetAssets(aciBinDir string) ([]string, error)
- func (custom *CmakeCustomizations) GetBinaryName() (string, error)
- func (custom *CmakeCustomizations) GetCommonConfiguration() *CommonConfiguration
- func (custom *CmakeCustomizations) GetCommonPaths() *CommonPaths
- func (custom *CmakeCustomizations) GetDirectoriesToMake() []string
- func (custom *CmakeCustomizations) GetImageFileName() (string, error)
- func (custom *CmakeCustomizations) GetImageName() (*types.ACIdentifier, error)
- func (custom *CmakeCustomizations) GetPlaceholderMapping() map[string]string
- func (custom *CmakeCustomizations) GetRepoPath() (string, error)
- func (custom *CmakeCustomizations) Name() string
- func (custom *CmakeCustomizations) PrepareProject() error
- func (custom *CmakeCustomizations) SetupPaths() error
- func (custom *CmakeCustomizations) ValidateConfiguration() error
- type CmakePaths
- type CmdFailedError
- type CmdNotFoundError
- type CommonConfiguration
- type CommonPaths
- type GitInfo
- type GoConfiguration
- type GoCustomizations
- func (custom *GoCustomizations) GetAssets(aciBinDir string) ([]string, error)
- func (custom *GoCustomizations) GetBinaryName() (string, error)
- func (custom *GoCustomizations) GetCommonConfiguration() *CommonConfiguration
- func (custom *GoCustomizations) GetCommonPaths() *CommonPaths
- func (custom *GoCustomizations) GetDirectoriesToMake() []string
- func (custom *GoCustomizations) GetImageFileName() (string, error)
- func (custom *GoCustomizations) GetImageName() (*types.ACIdentifier, error)
- func (custom *GoCustomizations) GetPlaceholderMapping() map[string]string
- func (custom *GoCustomizations) GetRepoPath() (string, error)
- func (custom *GoCustomizations) Name() string
- func (custom *GoCustomizations) PrepareProject() error
- func (custom *GoCustomizations) SetupPaths() error
- func (custom *GoCustomizations) ValidateConfiguration() error
- type GoPaths
- type HgInfo
- type SvnInfo
- type VCSInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DirExists ¶
DirExists checks if directory exists if given path is not empty.
This function is rather specific as it is mostly used for checking overrides validity (like overriding temporary directory, where empty string means "do not override").
func GetAssetString ¶
GetAssetString returns a properly formatted asset string.
func GetBinaryName ¶
GetBinaryName checks if useBinary is in binDir and returns it. If useBinary is empty it returns a binary name if there is only one such in binDir. Otherwise it returns an error.
func PrepareAssets ¶
PrepareAssets copies given assets to ACI rootfs directory. It also tries to copy required shared libraries if an asset is a dynamically linked executable or library. placeholderMapping maps placeholders (like "<INSTALLDIR>") to actual paths (usually something inside temporary directory).
func RunCmdFull ¶
RunCmdFull runs given execProg. execProg should be an absolute path to a program or it can be an empty string. In the latter case first string in args is taken and searched for in $PATH.
If execution fails then CmdFailedError is returned. This can be useful if we don't care if execution fails or not. CmdNotFoundError is returned if executable is not found.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func NewBuilder(custom BuilderCustomizations) *Builder
type BuilderCustomizations ¶
type BuilderCustomizations interface { Name() string GetCommonConfiguration() *CommonConfiguration ValidateConfiguration() error GetCommonPaths() *CommonPaths SetupPaths() error GetDirectoriesToMake() []string PrepareProject() error GetPlaceholderMapping() map[string]string GetAssets(aciBinDir string) ([]string, error) GetImageName() (*types.ACIdentifier, error) GetBinaryName() (string, error) GetRepoPath() (string, error) GetImageFileName() (string, error) }
BuilderCustomizations is an interface for customizing a build process. The order of function roughly describe the build process.
type CmakeConfiguration ¶
type CmakeConfiguration struct { CommonConfiguration BinDir string ReuseSrcDir string CmakeParams []string }
type CmakeCustomizations ¶
type CmakeCustomizations struct { Configuration CmakeConfiguration // contains filtered or unexported fields }
func (*CmakeCustomizations) GetAssets ¶
func (custom *CmakeCustomizations) GetAssets(aciBinDir string) ([]string, error)
func (*CmakeCustomizations) GetBinaryName ¶
func (custom *CmakeCustomizations) GetBinaryName() (string, error)
func (*CmakeCustomizations) GetCommonConfiguration ¶
func (custom *CmakeCustomizations) GetCommonConfiguration() *CommonConfiguration
func (*CmakeCustomizations) GetCommonPaths ¶
func (custom *CmakeCustomizations) GetCommonPaths() *CommonPaths
func (*CmakeCustomizations) GetDirectoriesToMake ¶
func (custom *CmakeCustomizations) GetDirectoriesToMake() []string
func (*CmakeCustomizations) GetImageFileName ¶
func (custom *CmakeCustomizations) GetImageFileName() (string, error)
func (*CmakeCustomizations) GetImageName ¶
func (custom *CmakeCustomizations) GetImageName() (*types.ACIdentifier, error)
func (*CmakeCustomizations) GetPlaceholderMapping ¶
func (custom *CmakeCustomizations) GetPlaceholderMapping() map[string]string
func (*CmakeCustomizations) GetRepoPath ¶
func (custom *CmakeCustomizations) GetRepoPath() (string, error)
func (*CmakeCustomizations) Name ¶
func (custom *CmakeCustomizations) Name() string
func (*CmakeCustomizations) PrepareProject ¶
func (custom *CmakeCustomizations) PrepareProject() error
func (*CmakeCustomizations) SetupPaths ¶
func (custom *CmakeCustomizations) SetupPaths() error
func (*CmakeCustomizations) ValidateConfiguration ¶
func (custom *CmakeCustomizations) ValidateConfiguration() error
type CmakePaths ¶
type CmakePaths struct { CommonPaths // contains filtered or unexported fields }
type CmdFailedError ¶
type CmdFailedError struct {
Err error
}
func (CmdFailedError) Error ¶
func (e CmdFailedError) Error() string
type CmdNotFoundError ¶
type CmdNotFoundError struct {
Err error
}
func (CmdNotFoundError) Error ¶
func (e CmdNotFoundError) Error() string
type CommonConfiguration ¶
type CommonConfiguration struct { Exec []string UseBinary string Assets []string KeepTmpDir bool TmpDir string ReuseTmpDir string Project string }
CommonConfiguration keeps configuration items common for all the builders. Users of a Builder are supposed to create a BuilderCustomizations instance, get a CommonConfiguration instance via GetCommonConfiguration function and modify it before running Builder.Run().
type CommonPaths ¶
CommonPaths keeps some paths common for all builders. Implementers of new BuilderCustomizations can read those after they are set up.
type GoConfiguration ¶
type GoConfiguration struct { CommonConfiguration GoBinary string GoPath string }
type GoCustomizations ¶
type GoCustomizations struct { Configuration GoConfiguration // contains filtered or unexported fields }
func (*GoCustomizations) GetAssets ¶
func (custom *GoCustomizations) GetAssets(aciBinDir string) ([]string, error)
func (*GoCustomizations) GetBinaryName ¶
func (custom *GoCustomizations) GetBinaryName() (string, error)
func (*GoCustomizations) GetCommonConfiguration ¶
func (custom *GoCustomizations) GetCommonConfiguration() *CommonConfiguration
func (*GoCustomizations) GetCommonPaths ¶
func (custom *GoCustomizations) GetCommonPaths() *CommonPaths
func (*GoCustomizations) GetDirectoriesToMake ¶
func (custom *GoCustomizations) GetDirectoriesToMake() []string
func (*GoCustomizations) GetImageFileName ¶
func (custom *GoCustomizations) GetImageFileName() (string, error)
func (*GoCustomizations) GetImageName ¶
func (custom *GoCustomizations) GetImageName() (*types.ACIdentifier, error)
func (*GoCustomizations) GetPlaceholderMapping ¶
func (custom *GoCustomizations) GetPlaceholderMapping() map[string]string
func (*GoCustomizations) GetRepoPath ¶
func (custom *GoCustomizations) GetRepoPath() (string, error)
func (*GoCustomizations) Name ¶
func (custom *GoCustomizations) Name() string
func (*GoCustomizations) PrepareProject ¶
func (custom *GoCustomizations) PrepareProject() error
func (*GoCustomizations) SetupPaths ¶
func (custom *GoCustomizations) SetupPaths() error
func (*GoCustomizations) ValidateConfiguration ¶
func (custom *GoCustomizations) ValidateConfiguration() error
type GoPaths ¶
type GoPaths struct { CommonPaths // contains filtered or unexported fields }