build

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2020 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DockerDist = "seekwe/go-builder:"

Functions

func Basename

func Basename(pwd string) string

func CheckDocker

func CheckDocker() error

func CheckDockerImage

func CheckDockerImage(goVersion string) (bool, error, string)

func CommadString

func CommadString(os []OSData, isVendor, isCGO bool, packageName, outDir string) (commad []string)

func CompressFile

func CompressFile(filename string) ([]byte, error)

CompressFile reads the given file and converts it to a gzip compressed hex string

func DecompressHex added in v1.0.15

func DecompressHex(hexdata []byte) ([]byte, error)

DecompressHex decompresses the gzip/hex encoded data

func DecompressHexString

func DecompressHexString(hexdata string) ([]byte, error)

DecompressHexString decompresses the gzip/hex encoded data

func FindGoFiles

func FindGoFiles(directory string) ([]string, error)

FindGoFiles finds all go files recursively from the given directory

func GeneratePackFileString

func GeneratePackFileString(assetBundle *ReferencedAssets, ignoreErrors bool) (string, error)

GeneratePackFileString creates the contents of a pack file

func GetBuildGitID added in v1.0.10

func GetBuildGitID() string

func GetBuildTime added in v1.0.10

func GetBuildTime() string

func GetGoVersion added in v1.0.10

func GetGoVersion() string

func GetMewnFiles

func GetMewnFiles(args []string, ignoreErrors bool) []string

func HasMewnReference

func HasMewnReference(filename string) (bool, error)

func ParserArch

func ParserArch(arch string, lists []string) []string

func ParserTarget

func ParserTarget(cross string) []string

func PullDockerImage

func PullDockerImage(image string) error

func TargetsCommad

func TargetsCommad(target string) map[string][]string

Types

type AssetDirectory

type AssetDirectory struct {
	FileGroups map[string]*FileGroup
}

AssetDirectory is a collection of file groups

func NewAssetDirectory

func NewAssetDirectory() *AssetDirectory

NewAssetDirectory creates a new asset directory

func (*AssetDirectory) GetGroup

func (a *AssetDirectory) GetGroup(groupName string) *FileGroup

GetGroup gets a filegroup by name. Returns nil if not found

func (*AssetDirectory) NewFileGroup

func (a *AssetDirectory) NewFileGroup(baseDirectory string) (*FileGroup, error)

NewFileGroup creates a new file group

type AssignStmt

type AssignStmt struct {
	LHS string
	RHS *CallStmt
}

AssignStmt holds data about an assignment

func ParseAssignment

func ParseAssignment(astmt *ast.AssignStmt) *AssignStmt

ParseAssignment parses an assignment statement

func (*AssignStmt) String

func (a *AssignStmt) String() string

type CallStmt

type CallStmt struct {
	Obj    string
	Method string
	Path   string
}

CallStmt holds data about a call statement

func ParseCallExpr

func ParseCallExpr(callstmt *ast.CallExpr) *CallStmt

func (*CallStmt) String

func (c *CallStmt) String() string

type FileGroup

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

FileGroup holds a collection of files

func (*FileGroup) AddAsset

func (f *FileGroup) AddAsset(name, data string) error

AddAsset to the FileGroup

func (*FileGroup) AddByteAsset added in v1.0.15

func (f *FileGroup) AddByteAsset(name string, data []byte) error

AddAsset to the FileGroup

func (*FileGroup) All

func (f *FileGroup) All() map[string][]byte

All All

func (*FileGroup) Bytes

func (f *FileGroup) Bytes(filename string) []byte

Bytes returns the asset as a Byte slice. Failure is indicated by a blank slice. If you need hard failures, use MustBytes.

func (*FileGroup) Entries

func (f *FileGroup) Entries() []string

Entries returns a slice of filenames in the FileGroup

func (*FileGroup) GetBaseDir

func (f *FileGroup) GetBaseDir() string

func (*FileGroup) MustBytes

func (f *FileGroup) MustBytes(filename string) (contents []byte, err error)

MustBytes returns the asset as a string. If the asset doesn't exist, it hard fails

func (*FileGroup) MustString

func (f *FileGroup) MustString(filename string) (string, error)

MustString returns the asset as a string. If the asset doesn't exist, it hard fails

func (*FileGroup) Reset

func (f *FileGroup) Reset()

Reset the FileGroup

func (*FileGroup) String

func (f *FileGroup) String(filename string) string

String returns the asset as a string Failure is indicated by a blank string. If you need hard failures, use MustString.

type Group

type Group struct {
	Name      string
	LocalPath string
	FullPath  string
}

Group holds information relating to a group

type OSData added in v1.0.10

type OSData struct {
	Goos   string
	Goarch string
	CXX    string
	CC     string
}

type ReferencedAsset

type ReferencedAsset struct {
	Name      string
	AssetPath string
	Group     *Group
}

ReferencedAsset holds the information for an asset referenced by the user

type ReferencedAssets

type ReferencedAssets struct {
	Caller      string
	PackageName string
	BaseDir     string
	Assets      []*ReferencedAsset
	Groups      []*Group
}

ReferencedAssets is a collection of assets referenced from a file

func GetReferencedAssets

func GetReferencedAssets(filenames []string) ([]*ReferencedAssets, error)

GetReferencedAssets gets a list of referenced assets from the AST

func (*ReferencedAssets) HasAsset

func (r *ReferencedAssets) HasAsset(name string) bool

HasAsset returns true if the given asset name has already been processed for this asset group

Jump to

Keyboard shortcuts

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