Documentation
¶
Overview ¶
Package project handles language execution, package management and configuration for bramble projects.
Index ¶
- Constants
- Variables
- func FindAllProjects(loc string) (paths []string, err error)
- type BuildOutput
- type Dependency
- type Derivation
- func (drv Derivation) Attr(name string) (val starlark.Value, err error)
- func (drv Derivation) AttrNames() (out []string)
- func (drv Derivation) Freeze()
- func (drv Derivation) Hash() (uint32, error)
- func (drv Derivation) PrettyJSON() string
- func (drv Derivation) String() string
- func (drv Derivation) Truth() starlark.Bool
- func (drv Derivation) Type() string
- type ExecModuleInput
- type ExecModuleOutput
- type FilesList
- type FunctionDoc
- type Module
- type ModuleDoc
- type ModuleFetcher
- type Project
- func (p *Project) AddDependency(v types.Package) (err error)
- func (p *Project) AddModuleFetcher(dm *dependency.Manager)
- func (p *Project) ArgumentsToModules(ctx context.Context, args []string, allowExternal bool) (modules []Module, err error)
- func (p *Project) CalculateDependencies() (err error)
- func (p *Project) Config() config.Config
- func (p *Project) ExecModule(ctx context.Context, input ExecModuleInput) (output ExecModuleOutput, err error)
- func (p *Project) FindAllModules(path string) (modules []string, err error)
- func (p *Project) HiddenPaths() (out []string)
- func (p *Project) ListModuleDoc(wd string) (modules []ModuleDoc, err error)
- func (p *Project) Location() string
- func (p *Project) LockfileWriter() types.LockfileWriter
- func (p *Project) Module() string
- func (p *Project) ParseModuleFuncArgument(ctx context.Context, name string, allowExternal bool) (module Module, err error)
- func (p *Project) REPL()
- func (p *Project) ReadOnlyPaths() (out []string)
- func (p *Project) URLHashes() map[string]string
- func (p *Project) Version() string
- func (p *Project) WD() string
- func (p *Project) WriteLockfile() error
- type Run
- type Test
- type Walker
Constants ¶
View Source
const BrambleExtension = ".bramble"
Variables ¶
View Source
var (
ErrNotInProject = errors.New("couldn't find a bramble.toml file in this directory or any parent")
)
Functions ¶
func FindAllProjects ¶
Types ¶
type BuildOutput ¶
type BuildOutput struct {
Dep Dependency
OutputPath string
}
type Dependency ¶
type Derivation ¶
type Derivation struct {
// Args are arguments that are passed to the builder
Args []string
// Builder will either be set to a string constant to signify an internal builder (like
// "fetch_url"), or it will be set to the path of an executable in the bramble store
Builder string
Dependencies []Dependency
// Env are environment variables set during the build
Env map[string]string
Name string
Network bool `json:",omitempty"`
Outputs []string
Platform string
Sources FilesList
Target string `json:",omitempty"`
}
func (Derivation) AttrNames ¶
func (drv Derivation) AttrNames() (out []string)
func (Derivation) Freeze ¶
func (drv Derivation) Freeze()
func (Derivation) Hash ¶
func (drv Derivation) Hash() (uint32, error)
func (Derivation) PrettyJSON ¶
func (drv Derivation) PrettyJSON() string
func (Derivation) String ¶
func (drv Derivation) String() string
func (Derivation) Truth ¶
func (drv Derivation) Truth() starlark.Bool
func (Derivation) Type ¶
func (drv Derivation) Type() string
type ExecModuleInput ¶
type ExecModuleOutput ¶
type ExecModuleOutput struct {
Output map[string]Derivation
AllDerivations map[string]Derivation
Tests map[string][]Test
Run []Run
// Modules is a map of all modules run, the names of their called functions
// and the hashes of the derivations that they output
Modules map[string]map[string][]string
}
func (ExecModuleOutput) WalkAndPatch ¶
func (emo ExecModuleOutput) WalkAndPatch(maxParallel int, fn func(dep Dependency, drv Derivation) (addGraph *ExecModuleOutput, buildOutputs []BuildOutput, err error)) error
type FunctionDoc ¶
type ModuleDoc ¶
type ModuleDoc struct {
Name string
Docstring string
Functions []FunctionDoc
}
type ModuleFetcher ¶
type Project ¶
type Project struct {
// contains filtered or unexported fields
}
func NewProject ¶
NewProject checks for an existing bramble project in the provided working directory and loads its configuration details if one is found.
func (*Project) AddModuleFetcher ¶
func (p *Project) AddModuleFetcher(dm *dependency.Manager)
func (*Project) ArgumentsToModules ¶
func (*Project) CalculateDependencies ¶
func (*Project) ExecModule ¶
func (p *Project) ExecModule(ctx context.Context, input ExecModuleInput) (output ExecModuleOutput, err error)
func (*Project) FindAllModules ¶
func (*Project) HiddenPaths ¶
func (*Project) ListModuleDoc ¶
func (*Project) LockfileWriter ¶
func (p *Project) LockfileWriter() types.LockfileWriter
func (*Project) ParseModuleFuncArgument ¶
func (*Project) ReadOnlyPaths ¶
func (*Project) WriteLockfile ¶
type Run ¶
type Test ¶
type Test struct {
Derivation Derivation
Args []string
Location string
}
type Walker ¶
type Walker struct {
// contains filtered or unexported fields
}
func (*Walker) Update ¶
func (w *Walker) Update(dep Dependency, emo ExecModuleOutput) (err error)
Update takes the derivation input. Merges it with the existing walk graph. Puts a struct in the semaphore so that it can sleep without risking a lock. Calls update on the walker. Waits for all derivations to be fully built, and then returns.
Click to show internal directories.
Click to hide internal directories.