Documentation ¶
Overview ¶
Package dist is a release artifact builder library.
Index ¶
- type Build
- func (b *Build) Build(targets []Target) (files []string, err error)
- func (b *Build) BuildGoBinary(path string, env map[string]string) (string, error)
- func (b *Build) BuildGoBinaryWithTags(path string, env map[string]string, tags []string) (string, error)
- func (b *Build) Close() error
- func (b *Build) Command(dir, cmd string, args ...string) *Command
- func (b *Build) Extra(key any, constructor func() any) any
- func (b *Build) GoPkg(pkg string) (string, error)
- func (b *Build) Once(name string, fn func() error) error
- func (b *Build) TmpDir() string
- type Command
- type Memoize
- type MemoizedFn
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Build ¶
type Build struct { // Repo is a path to the root Go module for the build. Repo string // Out is where build artifacts are written. Out string // Verbose is whether to print all command output, rather than just failed // commands. Verbose bool // Tmp is a temporary directory that gets deleted when the Builder is closed. Tmp string // Go is the path to the Go binary to use for building. Go string // Version is the version info of the build. Version mkversion.VersionInfo // Time is the timestamp of the build. Time time.Time // contains filtered or unexported fields }
A Build is a build context for Targets.
func (*Build) BuildGoBinary ¶
BuildGoBinary builds the Go binary at path and returns the path to the binary. Builds are cached by path and env, so each build only happens once per process execution.
func (*Build) BuildGoBinaryWithTags ¶ added in v1.46.0
func (b *Build) BuildGoBinaryWithTags(path string, env map[string]string, tags []string) (string, error)
BuildGoBinaryWithTags builds the Go binary at path and returns the path to the binary. Builds are cached by path, env and tags, so each build only happens once per process execution.
The passed in tags override gocross's automatic selection of build tags, so you will have to figure out and specify all the tags relevant to your build.
func (*Build) GoPkg ¶
GoPkg returns the path on disk of pkg. The module of pkg must be imported in b.Repo's go.mod.
type Command ¶
Command runs an exec.Cmd and returns its exit status. If the command fails, its output is printed to os.Stdout, otherwise it's suppressed.
func (*Command) CombinedOutput ¶
CombinedOutput is like c.Cmd.CombinedOutput, but returns the output as a string instead of a byte slice.
type Memoize ¶
type Memoize[O any] struct { // contains filtered or unexported fields }
Memoize runs MemoizedFns and remembers their results.
type MemoizedFn ¶
MemoizedFn is a function that memoize.Do can call.
Directories ¶
Path | Synopsis |
---|---|
Package cli provides the skeleton of a CLI for building release packages.
|
Package cli provides the skeleton of a CLI for building release packages. |
Package synology contains dist Targets for building Synology Tailscale packages.
|
Package synology contains dist Targets for building Synology Tailscale packages. |
Package unixpkgs contains dist Targets for building unix Tailscale packages.
|
Package unixpkgs contains dist Targets for building unix Tailscale packages. |