proj2aci

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2016 License: Apache-2.0, Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(i ...interface{})

func DirExists

func DirExists(path string) bool

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

func GetAssetString(aciAsset, localAsset string) string

GetAssetString returns a properly formatted asset string.

func GetBinaryName

func GetBinaryName(binDir, useBinary string) (string, error)

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 GetVCSInfo

func GetVCSInfo(projPath string) (string, string, error)

func Info

func Info(i ...interface{})

func InitDebug

func InitDebug()

func PrepareAssets

func PrepareAssets(assets []string, rootfs string, placeholderMapping map[string]string) error

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 RunCmd

func RunCmd(args, env []string, cwd string) error

func RunCmdFull

func RunCmdFull(execProg string, args, env []string, cwd string, stdout, stderr io.Writer) error

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.

func Warn

func Warn(i ...interface{})

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(custom BuilderCustomizations) *Builder

func (*Builder) Name

func (cmd *Builder) Name() string

func (*Builder) Run

func (cmd *Builder) Run() error

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 BzrInfo

type BzrInfo struct{}

func (BzrInfo) GetLabelAndId

func (info BzrInfo) GetLabelAndId(path string) (string, string, error)

func (BzrInfo) IsValid

func (info BzrInfo) IsValid(path string) bool

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

type CommonPaths struct {
	TmpDir string
	AciDir string
	RootFS string
}

CommonPaths keeps some paths common for all builders. Implementers of new BuilderCustomizations can read those after they are set up.

type GitInfo

type GitInfo struct{}

func (GitInfo) GetLabelAndId

func (info GitInfo) GetLabelAndId(path string) (string, string, error)

func (GitInfo) IsValid

func (info GitInfo) IsValid(path string) bool

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
}

type HgInfo

type HgInfo struct{}

func (HgInfo) GetLabelAndId

func (info HgInfo) GetLabelAndId(path string) (string, string, error)

func (HgInfo) IsValid

func (info HgInfo) IsValid(path string) bool

type SvnInfo

type SvnInfo struct{}

func (SvnInfo) GetLabelAndId

func (info SvnInfo) GetLabelAndId(path string) (string, string, error)

func (SvnInfo) IsValid

func (info SvnInfo) IsValid(path string) bool

type VCSInfo

type VCSInfo interface {
	IsValid(path string) bool
	GetLabelAndId(path string) (string, string, error)
}

Jump to

Keyboard shortcuts

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