Documentation
¶
Index ¶
- Variables
- func GetImplicitOutputs(m Provider) []string
- func GetInstallableOutputs(m Provider) []string
- func GetOutputs(m Provider) []string
- func ResolveFilesMutator(ctx blueprint.BottomUpMutatorContext)
- type Consumer
- type DynamicProvider
- type Path
- func (file Path) BuildPath() string
- func (file Path) ExpandLink() *Path
- func (file Path) Ext() string
- func (file Path) FollowLink() *Path
- func (file Path) IsNotType(ft Type) bool
- func (file Path) IsSymLink() bool
- func (file Path) IsType(ft Type) bool
- func (file Path) RelBuildPath() string
- func (file Path) Scope() string
- func (file Path) ScopedPath() string
- func (file Path) UnScopedPath() string
- type Paths
- func (fps Paths) AppendIfUnique(fp Path) Paths
- func (fps Paths) Contains(query Path) bool
- func (fs Paths) Filtered(predicate func(Path) bool) (ret Paths)
- func (fps Paths) FindSingle(predicate func(Path) bool) (*Path, bool)
- func (fps Paths) ForEach(functor func(Path) bool)
- func (fps Paths) ForEachIf(predicate func(Path) bool, functor func(Path) bool)
- func (fps Paths) Iterate() <-chan Path
- func (fps Paths) IteratePredicate(predicate func(Path) bool) <-chan Path
- func (fps Paths) Merge(other Paths) Paths
- func (fs Paths) ToStringSlice(converter func(Path) string) (ret []string)
- func (fs Paths) ToStringSliceIf(predicate func(Path) bool, converter func(Path) string) (ret []string)
- type Provider
- type Resolver
- type Type
Constants ¶
This section is empty.
Variables ¶
var FileNoNameSpace string = ""
Functions ¶
func GetImplicitOutputs ¶
Commonly used filter to get module implicit outputs
func GetInstallableOutputs ¶
Commonly used filter to get module installable files
func GetOutputs ¶
Commonly used filter to get module output files
func ResolveFilesMutator ¶
func ResolveFilesMutator(ctx blueprint.BottomUpMutatorContext)
TransformSources needs to figure out the output names based on it's inputs. Since this cannot be done at `OutSrcs` time due to lack of module context we use a seperate mutator stage.
Types ¶
type Consumer ¶
type Consumer interface { // Returns all sources this module consumes. At this point assumes all providers are ready. // Paths will be fully resolved. GetFiles(blueprint.BaseModuleContext) Paths // Returns a list of targets this consumer directly requires GetTargets() []string // Returns filepaths for current module only. // Context is required for backend information but the accessor should only read current module. GetDirectFiles() Paths }
`Consumer` interface describes a module that is capable of consuming sources for its actions. Example of this include:
- bob_binary
- bob{_static_,_shared_,_}library
This interface can retrieve the required source file for this module only via `GetSrcs`, note that each provider needs to be ready by the time these are accessed. This means, `GetSrcs` should be called after `ResolveOutFiles` and `processPaths` for each of the dependant modules.
The exception to this is `ResolveOutFiles` which may depend on other dynamic providers, in this case a bottom up mutator is used to ensure the downstream dependencies of each module are ready.
type DynamicProvider ¶
type DynamicProvider interface { Provider ResolveOutFiles(blueprint.BaseModuleContext) }
A dynamic source provider is a module which needs to compute the output file names.
`ResolveOutFiles`, is context aware, and runs bottom up in the dep graph. This means however it cannot run in parallel, fortunately this is __only__ used for `bob_transform_source`.
`ResolveOutFiles` is context aware specifically because it can depend on other dynamic providers.
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
func FromWithTag ¶
func (Path) ExpandLink ¶
func (Path) FollowLink ¶
func (Path) RelBuildPath ¶
func (Path) ScopedPath ¶
func (Path) UnScopedPath ¶
type Paths ¶
type Paths []Path
Array of files as a helper for struct attribute collections TODO: add the possibility to tag a group of files.
func ReferenceGetFilesImpl ¶
func ReferenceGetFilesImpl(ctx blueprint.BaseModuleContext) (srcs Paths)
Basic common implementation, certain targets may wish to customize this.
func (Paths) AppendIfUnique ¶
func (Paths) IteratePredicate ¶
func (Paths) ToStringSlice ¶
type Provider ¶
type Provider interface { // Sources to be forwarded to other modules // Expected to be called from a context of another module. OutFiles() Paths // Targets to be forwarded to other modules // Expected to be called from a context of another module. OutFileTargets() []string }
A `Provider` describes a class capable of providing source files, either dynamically generated or by reference to other modules. For example:
- bob_glob
- bob_filegroup
- bob_{generate,transform}_source
- bob_genrule
A provider interface outputs it's source files for other modules, it can also optionally forward it's source targets as is the case for `bob_filegroup`.
`OutSrcs` is not context aware, this is because it is called from a context aware visitor (`GetSrcs`). This means its output needs to be resolved prior to this call. This is typically done via `processPaths` for static sources, and `ResolveOutFiles` for sources which use a dynamic pathing.
`processPaths` should not require context and only operate on the current module.
type Resolver ¶
type Resolver interface { // TODO: This may not be neccessary. ResolveFiles(blueprint.BaseModuleContext) }
`processPaths` needs to run separately to `SourceFileResolver`. This is due to how the defaults are resolved and applied, meaning only defaultable properties will be merged. The current flow is:
- `processPaths` prepends the module subdirectory to source file.
- `DefaultApplierMutator` runs, merging source attributes.
- `ResolveSrcs` runs, setting up filepaths for distribution.
type Type ¶
type Type uint32
const ( TypeUnset = 0 TypeSrc Type = 1 << iota TypeGenerated TypeTool TypeBinary TypeExecutable TypeImplicit TypeC TypeCpp TypeAsm TypeHeader TypeArchive TypeKernelModule TypeInstallable TypeDep TypeRsp TypeToc TypeLink // Special tag to indicate this file is a symlink // Masks: TypeCompilable = TypeC | TypeCpp | TypeAsm )