summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2024-05-30 16:46:44 +0000
committer Spandan Das <spandandas@google.com> 2024-05-30 16:51:51 +0000
commita866713ddb8698616f83e3f49857a8bb42f616fd (patch)
tree0dce7e7c6b1d66f434acd25dd759f32da5d1a1d2
parent2f9af23734a53041e37437c9d22a664fd4db2313 (diff)
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
-rw-r--r--android/apex_contributions.go28
1 files changed, 14 insertions, 14 deletions
diff --git a/android/apex_contributions.go b/android/apex_contributions.go
index 91549e5d8..8b72f8e4f 100644
--- a/android/apex_contributions.go
+++ b/android/apex_contributions.go
@@ -106,7 +106,13 @@ var (
// Creates a dep to each selected apex_contributions
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
@@ -126,19 +132,13 @@ 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)
- } else {
- 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)
}