Documentation ¶
Index ¶
- Constants
- type Builder
- func (b *Builder) GenerateCompileCommands(w io.Writer) error
- func (b *Builder) GenerateMakeFile(w io.Writer) error
- func (b *Builder) OutputPath() string
- func (b *Builder) Parse(entry *Package) error
- func (b *Builder) WithCacheDir(xcache string) *Builder
- func (b *Builder) WithCxxFlags(flags []string) *Builder
- func (b *Builder) WithLDFlags(flags []string) *Builder
- func (b *Builder) WithOutput(out string) *Builder
- type DependencyDesc
- type Loader
- type MakeFileWriter
- type Makefile
- type Module
- type ModuleDesc
- type Package
- type PackgeDesc
- type Runner
- func (r *Runner) Make(mkfile string) error
- func (r *Runner) WithCacheDir(xcache string) *Runner
- func (r *Runner) WithEntry(pkg *Package) *Runner
- func (r *Runner) WithLogger(logger *log.Logger) *Runner
- func (r *Runner) WithMakeFlags(flags []string) *Runner
- func (r *Runner) WithOutput(out string) *Runner
- func (r *Runner) WithXROOT(xroot string) *Runner
- func (r *Runner) WithoutDocker() *Runner
- func (r *Runner) WithoutPrecompiledSDK() *Runner
- type Task
Constants ¶
const ( PkgDescFile = "xdev.toml" ModDescFile = "mod.toml" SelfPackageName = "self" XchainPackage = "xchain" )
const (
DefaultXROOT = "/opt/xchain"
)
const (
MainPackage = "main"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder generate makefile
func (*Builder) GenerateCompileCommands ¶
GenerateCompileCommands generates compile_commands.json to io.Writer
func (*Builder) GenerateMakeFile ¶
GenerateMakeFile generates makefile to w
func (*Builder) OutputPath ¶
OutputPath returns the output path of output file. Must be called after Parse
func (*Builder) WithCacheDir ¶
WithCacheDir set the stage dir
func (*Builder) WithCxxFlags ¶
WithCxxFlags set the CXXFLAGS during compiling cxx file
func (*Builder) WithLDFlags ¶
WithLDFlags set the LDFLAGS during linking binary
func (*Builder) WithOutput ¶
WithOutput set the output of package
type DependencyDesc ¶
DependencyDesc 描述了依赖的package信息
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader 分析package依赖,并确保所有依赖都已经在本地存在
func (*Loader) Load ¶
func (l *Loader) Load(pkgpath string, addons []DependencyDesc) (*Package, error)
Load parse and load all package's dep packages
func (*Loader) WithSearchPath ¶
type MakeFileWriter ¶
type MakeFileWriter struct {
// contains filtered or unexported fields
}
MakeFileWriter write Makefile according to given MakeFile description
func NewMakeFileWriter ¶
func NewMakeFileWriter(w io.Writer) *MakeFileWriter
NewMakeFileWriter instances a new MakeFileWriter
func (*MakeFileWriter) Write ¶
func (m *MakeFileWriter) Write(f *Makefile) error
Write serializes MakeFile description to MakeFile
type ModuleDesc ¶
type ModuleDesc struct {
Dependencies []DependencyDesc
}
ModuleDesc 描述了module的信息
func ParseModuleDesc ¶
func ParseModuleDesc(modpath string) (*ModuleDesc, error)
type Package ¶
type Package struct { // The name of package Name string // The full path of package in local file system Path string // The modules will be compiled Modules []Module // The dep packages Deps map[string]*Package }
Package contains modules and deps
type PackgeDesc ¶
type PackgeDesc struct { Package struct { Name string Author string } Dependencies []DependencyDesc }
PackgeDesc 描述了package的信息
func ParsePackageDesc ¶
func ParsePackageDesc(pkgpath string) (*PackgeDesc, error)
type Runner ¶
func (*Runner) WithCacheDir ¶
func (*Runner) WithLogger ¶
WithLogger set the debug logger
func (*Runner) WithMakeFlags ¶
WithMakeFlags set extra flags passing to make command