Handle missing apex_contributions am: a866713ddb

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3107540

Change-Id: I57c743f75192f1f8cd3e39720cade587f97fbb8a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Spandan Das
2024-05-30 19:12:21 +00:00
committed by Automerger Merge Worker

View File

@@ -106,8 +106,14 @@ var (
// Creates a dep to each selected apex_contributions // Creates a dep to each selected apex_contributions
func (a *allApexContributions) DepsMutator(ctx BottomUpMutatorContext) { 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()...) ctx.AddDependency(ctx.Module(), AcDepTag, ctx.Config().AllApexContributions()...)
} }
}
// Set PrebuiltSelectionInfoProvider in post deps phase // Set PrebuiltSelectionInfoProvider in post deps phase
func (a *allApexContributions) SetPrebuiltSelectionInfoProvider(ctx BaseModuleContext) { func (a *allApexContributions) SetPrebuiltSelectionInfoProvider(ctx BaseModuleContext) {
@@ -126,11 +132,6 @@ func (a *allApexContributions) SetPrebuiltSelectionInfoProvider(ctx BaseModuleCo
} }
p := PrebuiltSelectionInfoMap{} 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) { ctx.VisitDirectDepsWithTag(AcDepTag, func(child Module) {
if m, ok := child.(*apexContributions); ok { if m, ok := child.(*apexContributions); ok {
addContentsToProvider(&p, m) 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()) ctx.ModuleErrorf("%s is not an apex_contributions module\n", child.Name())
} }
}) })
}
SetProvider(ctx, PrebuiltSelectionInfoProvider, p) SetProvider(ctx, PrebuiltSelectionInfoProvider, p)
} }