Add providers support

Propagate the providers methods from
https://github.com/google/blueprint/pull/309 to Soong.

Test: m checkbuild
Change-Id: Iad7a9023df4421cd01dbb0518be0e85382097481
This commit is contained in:
Colin Cross
2020-07-02 11:38:17 -07:00
parent d1f898e70a
commit d27e7b8e45
3 changed files with 62 additions and 0 deletions

View File

@@ -315,6 +315,14 @@ type BottomUpMutatorContext interface {
// be used to add dependencies on the toVariationName variant using the fromVariationName
// variant.
CreateAliasVariation(fromVariationName, toVariationName string)
// SetVariationProvider sets the value for a provider for the given newly created variant of
// the current module, i.e. one of the Modules returned by CreateVariations.. It panics if
// not called during the appropriate mutator or GenerateBuildActions pass for the provider,
// if the value is not of the appropriate type, or if the module is not a newly created
// variant of the current module. The value should not be modified after being passed to
// SetVariationProvider.
SetVariationProvider(module blueprint.Module, provider blueprint.ProviderKey, value interface{})
}
type bottomUpMutatorContext struct {
@@ -550,3 +558,7 @@ func (b *bottomUpMutatorContext) AliasVariation(variationName string) {
func (b *bottomUpMutatorContext) CreateAliasVariation(fromVariationName, toVariationName string) {
b.bp.CreateAliasVariation(fromVariationName, toVariationName)
}
func (b *bottomUpMutatorContext) SetVariationProvider(module blueprint.Module, provider blueprint.ProviderKey, value interface{}) {
b.bp.SetVariationProvider(module, provider, value)
}