builder

package
v0.0.3-dev Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Set = iota
	Count
	Atomic
)
View Source
const (
	C_Type_Local  = "build-config-local"
	C_Type_Remote = "build-config-remote"
	C_Type_Multi  = "multiple-config"
)

Variables

View Source
var ForceOption bool
View Source
var OutFileNameFmt string // 输出文件名格式: default/a default:使用go默认输出格式(packageName[.exe]),a:{package-name}-{os}-{arch}[.exe]

Functions

func EnableCGO

func EnableCGO()

func ExportDefaultConfigJson

func ExportDefaultConfigJson(f string)

func ExportDefaultConfigYaml

func ExportDefaultConfigYaml(f string)

func LoadDefault

func LoadDefault()

Types

type After

type After struct {
	Command []string `yaml:"command"`
}

type Archives

type Archives struct {
	Enable bool     `yaml:"enable"`
	Name   string   `yaml:"name"`
	Format string   `yaml:"format"`
	Files  []string `yaml:"files"`
}

type Before

type Before struct {
	Command []string `yaml:"command"`
}

type BuildArch

type BuildArch struct {
	GOOS   string
	GOARCH string
}

type BuildConfig

type BuildConfig struct {
	InputFile  string //单个文件名或路径
	OutputFile string //输出文件名或路径

	Ldflags  []string  //传递给链接参数的值
	VarFlags []VarFlag //传递给main.go 中属性参数的值
	V        bool      // -v 打印编译的包名和文件名
	Cgo      bool      //enable cgo default false
	//不常用参数
	ForceBuildPackage bool     // -a 强制重新生成已更新的包。
	BuildProcess      int      //-p n 编译线程数
	Race              bool     // -race 启用数据竞争检测(only in 64bit )
	Msan              bool     // -msan 启用内存分配扫描 linux/amd64, linux/arm64, freebsd/amd64
	Cover             bool     // -cover 启用覆盖率分析
	CoverMode         int      //设置覆盖率分析的模式 默认set
	Work              bool     //打印临时工作目录的名称,退出时不要将其删除。
	AsmFlags          []string //传递给汇编器的值 [pattern=]arg
	BuildMode         string   //编译模式
	BuildVcs          string   //是否用版本控制信息标记二进制文件(auto,true,false)
	Compiler          string   //gccgo or gc
	Gccgoflags        []string //arguments to pass on each gccgo compiler/linker invocation.
	Gcflags           []string //arguments to pass on each go tool compile invocation.
	Linkshared        bool     //创建共享库 BuildMode=shared
	Mod               string   //readonly, vendor, or mod.
	Modcacherw        bool     //使模块缓存中新创建的目录保持读写状态,而不是使其只读。
	Modfile           string   //fileName 使用备用的go.mod
	Overlay           string   //fileName 读取为构建操作提供overlay的JSON配置文件。
	Pgo               string   //fileName 指定一个profile-guided optimization文件
	Pkgdir            string   //dir 使用额外的包目录
	Tags              string   //指定额外的tags
	//
	Targets []BuildArch //构建的目标架构

	MacroContext macro.Macro
	//
	HaveMacroBeforeCompile bool
	//
	Before
	Checksum
	Archives
	After
	// contains filtered or unexported fields
}

BuildConfig

构建配置 本地项目

func (*BuildConfig) Build

func (c *BuildConfig) Build() bool

func (*BuildConfig) ParseConfig

func (c *BuildConfig) ParseConfig() bool

type Checksum

type Checksum struct {
	File []string `yaml:"file"`
}

type Task

type Task struct {
	TaskID    string
	TaskName  string
	Config    BuildConfig
	CreatTime time.Time
}

func UsingAuto

func UsingAuto(f string, taskName string) (task []Task)

func UsingJson

func UsingJson(f string, taskName string) (returnVal []Task)

func UsingLocal

func UsingLocal(path string) Task

func UsingRemote

func UsingRemote(url string, types string) []Task

func UsingYaml

func UsingYaml(f string, taskName string) []Task

func UsingZip

func UsingZip(f string, taskName string) (task Task)

func (*Task) Build

func (t *Task) Build()

type VarFlag

type VarFlag struct {
	Key   string
	Value string
}

VarFlag 传递给main.go 中属性参数的值

Jump to

Keyboard shortcuts

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