Documentation
¶
Index ¶
- Variables
- func CurrentModule(thread *starlark.Thread) (*label.Label, bool)
- func DocSummary(t Target) string
- func IsSource(l *label.Label) bool
- func IsTarget(l *label.Label) bool
- type Events
- type Flag
- type LoadOptions
- type Project
- func (proj *Project) Flag(name string) (*Flag, error)
- func (proj *Project) Flags() []*Flag
- func (proj *Project) GC() error
- func (proj *Project) LoadTarget(_ context.Context, rawlabel string) (runner.Target, error)
- func (proj *Project) Metrics() (running, waiting int)
- func (proj *Project) REPLEnv(stdout io.Writer, pkg *label.Label) (thread *starlark.Thread, globals starlark.StringDict)
- func (proj *Project) Reload(ctx context.Context) (err error)
- func (proj *Project) Run(ctx context.Context, label *label.Label, options *RunOptions) error
- func (proj *Project) Sources() []string
- func (proj *Project) Target(label *label.Label) (Target, error)
- func (proj *Project) Targets() []Target
- func (proj *Project) Watch(ctx context.Context, label *label.Label) error
- type RunOptions
- type Target
- type TargetSummary
- type UnknownTargetError
Constants ¶
This section is empty.
Variables ¶
var DiscardEvents = discardEventsT(0)
DiscardEvents is an implementation of Events that discards all events.
var ErrDependenciesFailed = errors.New("dependencies failed")
Functions ¶
func CurrentModule ¶ added in v0.1.1
func DocSummary ¶
DocSummary returns a summary of the target's docstring.
Types ¶
type Events ¶
type Events interface {
// Print logs a line of output associated with a module or target.
Print(label *label.Label, line string)
// RequirementLoading is called when a referenced project is being loaded.
RequirementLoading(label *label.Label, version string)
// RequirementLoaded is called when a referenced project has finished loading.
RequirementLoaded(label *label.Label, version string)
// RequirementLoadFailed is called when a referenced project fails to load.
RequirementLoadFailed(label *label.Label, version string, err error)
// ModuleLoading is called when the given module begins loading.
ModuleLoading(label *label.Label)
// ModuleLoaded is called when the given module finishes loading successfully.
ModuleLoaded(label *label.Label)
// ModuleLoadFailed is called when the given module fails to load.
ModuleLoadFailed(label *label.Label, err error)
// LoadDone is called when a project finishes loading.
LoadDone(err error)
// TargetUpToDate is called when a target is found to be up-to-date.
TargetUpToDate(label *label.Label)
// TargetWaiting is called when a target begins waiting for dependencies.
TargetWaiting(label *label.Label, dependencies []string)
// TargetEvaluating is called when a target begins executing.
TargetEvaluating(label *label.Label, reason string, diff diff.ValueDiff)
// TargetFailed is called when a target fails.
TargetFailed(label *label.Label, err error)
// TargetSucceeded is called when a target succeeds.
TargetSucceeded(label *label.Label, changed bool)
// RunDone is called when a run finishes.
RunDone(err error)
// FileChanged is called during Watch when a file changes and triggers a reload.
FileChanged(label *label.Label)
}
Events allows callers to handle project load and build events.
type Flag ¶
type Flag struct {
// Name holds the flag's name.
Name string `json:"name"`
// Default holds the string representation of the flag's default value.
Default string `json:"default,omitempty"`
// FlagType holds the string representation of the flag's type.
FlagType string `json:"type"`
// Choices holds string representations of the flag's vlaid values.
Choices []string `json:"choices,omitempty"`
// Required is true if the flag is required.
Required bool `json:"required,omitempty"`
// Help holds the flag's help message.
Help string `json:"help,omitempty"`
// Value holds the flag's value.
Value starlark.Value `json:"-"`
}
A Flag holds information about a project configuration flag.
type LoadOptions ¶
type LoadOptions struct {
Args []string
Events Events
Builtins starlark.StringDict
PreferIndex bool
}
type Project ¶
type Project struct {
// contains filtered or unexported fields
}
A Project is the runtime representation of a dawn project. It is the primary type used to introspect and execute builds.
func (*Project) LoadTarget ¶
LoadTarget implements runner.Host.
type RunOptions ¶
type Target ¶
type Target interface {
starlark.Value
// Project returns the project that owns the target.
Project() *Project
// Label returns the target's label.
Label() *label.Label
// Dependencies returns the labels of the targets the target depends upon.
Dependencies() []*label.Label
// Name returns the target's name, which is its stringified label.
Name() string
// Doc returns the target's documentation string.
Doc() string
// Pos returns the position in the target's module where the target is defined.
Pos() string
// contains filtered or unexported methods
}
A Target represents a build target within a Project.
type TargetSummary ¶
type TargetSummary struct {
// Label is the target's label.
Label *label.Label `json:"label"`
// Summary is a summary of the target's docstring (as returned by DocSummary(t)).
Summary string `json:"summary,omitempty"`
// Pos is the position in the target's module that defines the target.
Pos string `json:"pos,omitempty"`
}
A TargetSummary contains summarial information about a build target.
func Targets ¶
func Targets(root string) ([]TargetSummary, error)
Targets returns the targets listed in the index file of the project rooted at the given directory.
type UnknownTargetError ¶
type UnknownTargetError string
An UnknownTargetError is returned by Project.LoadTarget if a referenced target does not exist.
func (UnknownTargetError) Error ¶
func (e UnknownTargetError) Error() string
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
dawn
command
|
|
|
dawn-gen-builtins
command
|
|
|
The diff package provides helpers for computing rich diffs between Starlark values.
|
The diff package provides helpers for computing rich diffs between Starlark values. |
|
internal
|
|
|
spell
Package spell file defines a simple spelling checker for use in label errors.
|
Package spell file defines a simple spelling checker for use in label errors. |
|
lib
|
|