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(rawlabel string) (runner.Target, error)
- func (proj *Project) REPLEnv(stdout io.Writer, pkg *label.Label) (thread *starlark.Thread, globals starlark.StringDict)
- func (proj *Project) Reload() (err error)
- func (proj *Project) Run(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(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.
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) // 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) // 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) }
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 // Doc returns the target's documentation string. Doc() 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"` }
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