builder

package
v1.4.7 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadGoMod

func DownloadGoMod(ctx context.Context) error

func LoadBinaryName

func LoadBinaryName() string

func MatchTargetPlatforms

func MatchTargetPlatforms() (map[string][]string, error)

MatchTargetPlatforms can only be executed once because permanent modify of global arch map

func PrepareDirs

func PrepareDirs(outputDir string) error

func Run

func Run(ctx context.Context)

Types

type ArchContext

type ArchContext struct {
	context.Context
	Stat *BuildStat
}

type BuildStat

type BuildStat struct {
	Num     uint32
	Current atomic.Uint32
}

func (*BuildStat) Done

func (s *BuildStat) Done()

func (*BuildStat) Percentage

func (s *BuildStat) Percentage() float32

func (*BuildStat) PercentageString

func (s *BuildStat) PercentageString() string

func (*BuildStat) SetNum

func (s *BuildStat) SetNum(num uint32)

func (*BuildStat) String

func (s *BuildStat) String() string

type Builder

type Builder struct {
	OutputName      string
	OutputFormatter OutputFormatter
	OutputDir       string
	Cgo             string
	Platforms       map[string][]string
	GoCMD           goCMD.BuildCommand

	WaitGroup      *sync.WaitGroup
	TaskChan       chan *Task
	FailedTaskChan chan string
	Compress       compress.Make
}

func NewBuilder

func NewBuilder(conf Config) (*Builder, error)

func (*Builder) BuildArches

func (b *Builder) BuildArches(ctx context.Context) error

func (*Builder) BuildThread

func (b *Builder) BuildThread()

func (*Builder) CalcExtraArches

func (b *Builder) CalcExtraArches(ctx ArchContext, GOOS, GOARCH string, extraArches []goCMD.ArchExtra) *list.List

func (*Builder) NewTask

func (b *Builder) NewTask(ctx TaskContext) *Task

type Config added in v1.4.3

type Config struct {
	OutputDir       string
	OutputFormatter OutputFormatter
}

type DefaultOutputFormatter added in v1.4.3

type DefaultOutputFormatter struct{}

func (DefaultOutputFormatter) Format added in v1.4.3

func (DefaultOutputFormatter) Format(filename, divider string, args ...string) string

type OutputFormatter added in v1.4.3

type OutputFormatter interface {
	Format(name, divider string, args ...string) string
}

type PostOutputFormatter added in v1.4.3

type PostOutputFormatter struct{}

func (PostOutputFormatter) Format added in v1.4.3

func (PostOutputFormatter) Format(filename, divider string, args ...string) string

type Task

type Task struct {
	Name string

	// status of whole builder
	Stat *BuildStat
	// contains filtered or unexported fields
}

func (Task) Build

func (task Task) Build() error

type TaskContext

type TaskContext struct {
	ArchContext
	GOOS, GOARCH    string
	NameSuffix, Env []string
}

Jump to

Keyboard shortcuts

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