Handle missing apex_contributions
Some minimal branches have v/g_s/build/release (where apex_contibutions have been set to mainline prebuilts), but not v/g/b (where the apex_contributions for prebuilts have been defined). These minimal branches are unsuitable for building a product that consume mainline prebuilts, but they would still like to do aosp product builds. aosp products should not use the mainline prebuilts anyways, but this has been implemented as - always create the dependency edge to the selected apex contributions - do not visit the dependency edge subsequently if IgnoreApexContributions is set set to true To support aosp product builds in minimal branches, this CL updates the implementation to skip creating the dependency edge when IgnoreApexContributions is set to true Test: go test ./android Change-Id: Iaa0971760e64f9b7a03542f179231ce2268b6616
This commit is contained in:
@@ -106,8 +106,14 @@ var (
|
||||
|
||||
// Creates a dep to each selected apex_contributions
|
||||
func (a *allApexContributions) DepsMutator(ctx BottomUpMutatorContext) {
|
||||
// Skip apex_contributions if BuildApexContributionContents is true
|
||||
// This product config var allows some products in the same family to use mainline modules from source
|
||||
// (e.g. shiba and shiba_fullmte)
|
||||
// Eventually these product variants will have their own release config maps.
|
||||
if !proptools.Bool(ctx.Config().BuildIgnoreApexContributionContents()) {
|
||||
ctx.AddDependency(ctx.Module(), AcDepTag, ctx.Config().AllApexContributions()...)
|
||||
}
|
||||
}
|
||||
|
||||
// Set PrebuiltSelectionInfoProvider in post deps phase
|
||||
func (a *allApexContributions) SetPrebuiltSelectionInfoProvider(ctx BaseModuleContext) {
|
||||
@@ -126,11 +132,6 @@ func (a *allApexContributions) SetPrebuiltSelectionInfoProvider(ctx BaseModuleCo
|
||||
}
|
||||
|
||||
p := PrebuiltSelectionInfoMap{}
|
||||
// Skip apex_contributions if BuildApexContributionContents is true
|
||||
// This product config var allows some products in the same family to use mainline modules from source
|
||||
// (e.g. shiba and shiba_fullmte)
|
||||
// Eventually these product variants will have their own release config maps.
|
||||
if !proptools.Bool(ctx.Config().BuildIgnoreApexContributionContents()) {
|
||||
ctx.VisitDirectDepsWithTag(AcDepTag, func(child Module) {
|
||||
if m, ok := child.(*apexContributions); ok {
|
||||
addContentsToProvider(&p, m)
|
||||
@@ -138,7 +139,6 @@ func (a *allApexContributions) SetPrebuiltSelectionInfoProvider(ctx BaseModuleCo
|
||||
ctx.ModuleErrorf("%s is not an apex_contributions module\n", child.Name())
|
||||
}
|
||||
})
|
||||
}
|
||||
SetProvider(ctx, PrebuiltSelectionInfoProvider, p)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user