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,7 +106,13 @@ 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) {
ctx.AddDependency(ctx.Module(), AcDepTag, ctx.Config().AllApexContributions()...) // 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 // Set PrebuiltSelectionInfoProvider in post deps phase
@@ -126,19 +132,13 @@ func (a *allApexContributions) SetPrebuiltSelectionInfoProvider(ctx BaseModuleCo
} }
p := PrebuiltSelectionInfoMap{} p := PrebuiltSelectionInfoMap{}
// Skip apex_contributions if BuildApexContributionContents is true ctx.VisitDirectDepsWithTag(AcDepTag, func(child Module) {
// This product config var allows some products in the same family to use mainline modules from source if m, ok := child.(*apexContributions); ok {
// (e.g. shiba and shiba_fullmte) addContentsToProvider(&p, m)
// Eventually these product variants will have their own release config maps. } else {
if !proptools.Bool(ctx.Config().BuildIgnoreApexContributionContents()) { ctx.ModuleErrorf("%s is not an apex_contributions module\n", child.Name())
ctx.VisitDirectDepsWithTag(AcDepTag, func(child Module) { }
if m, ok := child.(*apexContributions); ok { })
addContentsToProvider(&p, m)
} else {
ctx.ModuleErrorf("%s is not an apex_contributions module\n", child.Name())
}
})
}
SetProvider(ctx, PrebuiltSelectionInfoProvider, p) SetProvider(ctx, PrebuiltSelectionInfoProvider, p)
} }