Documentation ¶
Overview ¶
Package bbinternal is the internal API for both bazel and standard Go busybox builds.
It contains exported functions that are not for user consumption and not stable.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateBBMainSource ¶
func CreateBBMainSource(fset *token.FileSet, files []*ast.File, pkgs []string, destDir string) error
CreateBBMainSource creates a bb Go command main.go that imports all given pkgs and writes the command to destDir.
fset and files must be parsed bb template main.go, usually ./bbmain/cmd/main.go.
Types ¶
type Package ¶
type Package struct { // Name is the executable command name. // // In the standard Go tool chain, this is usually the base name of the // directory containing its source files. Name string // Pkg is the actual data about the package. Pkg *packages.Package // contains filtered or unexported fields }
Package is a Go package.
func NewPackage ¶
NewPackage creates a new Package based on an existing packages.Package.
func (*Package) PackageName ¶
PackageName is teh name of the rewritten Go package.
func (*Package) Rewrite ¶
Rewrite rewrites p into destDir as a bb package, rewriting its init and main functions.
bbImportPath is the importpath to use for bbmain. bbImportPath is usually bb.u-root.com/bb/pkg/bbmain for the Go module/vendor-based compilations, but github.com/u-root/gobusybox/src/pkg/bb/bbmain for bazel-based compilations.