aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSpandan Das <spandandas@google.com>2024-03-08 04:20:15 +0000
committerSpandan Das <spandandas@google.com>2024-03-21 18:04:53 +0000
commitaa1b7c912407cb4ce10979b6a31f443c32191ade (patch)
treecb449175bebebf4137bc4e1d9777db39fe776481
parentc36d579c2bb0d59e5b9455affbd46519b73ce8cd (diff)
downloadsoong-aa1b7c912407cb4ce10979b6a31f443c32191ade.tar.gz
Convert BuildIgnoreApexContritbutions variable to a boolean
The ignore list is burdensome to maintain once we start adding the module sdk contents to apex_contributions. Convert the variable to a boolean. When set to true, all contents in `apex_contributions` will be ignored Bug: 308187268 Test: m nothing on aosp,google and google_fullmte devices Ignore-AOSP-first: CL topic does a cleanup of an internal only denylist Change-Id: Ibdd1e0d0d4f08f4f5251b9c4baa1aaf42e7df34f Merged-In: Ibdd1e0d0d4f08f4f5251b9c4baa1aaf42e7df34f (cherry picked from commit f3df7305d653471c70d131177e773b4723247e3a)
-rw-r--r--android/apex_contributions.go24
-rw-r--r--android/config.go2
-rw-r--r--android/variable.go2
3 files changed, 15 insertions, 13 deletions
diff --git a/android/apex_contributions.go b/android/apex_contributions.go
index c76d9c235..dd09fbf44 100644
--- a/android/apex_contributions.go
+++ b/android/apex_contributions.go
@@ -115,10 +115,6 @@ func (a *allApexContributions) DepsMutator(ctx BottomUpMutatorContext) {
func (a *allApexContributions) SetPrebuiltSelectionInfoProvider(ctx BaseModuleContext) {
addContentsToProvider := func(p *PrebuiltSelectionInfoMap, m *apexContributions) {
for _, content := range m.Contents() {
- // Skip any apexes that have been added to the product specific ignore list
- if InList(content, ctx.Config().BuildIgnoreApexContributionContents()) {
- continue
- }
// Coverage builds for TARGET_RELEASE=foo should always build from source,
// even if TARGET_RELEASE=foo uses prebuilt mainline modules.
// This is necessary because the checked-in prebuilts were generated with
@@ -141,13 +137,19 @@ func (a *allApexContributions) SetPrebuiltSelectionInfoProvider(ctx BaseModuleCo
}
p := PrebuiltSelectionInfoMap{}
- 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())
- }
- })
+ // 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())
+ }
+ })
+ }
SetProvider(ctx, PrebuiltSelectionInfoProvider, p)
}
diff --git a/android/config.go b/android/config.go
index 567ebd83f..dcefdf354 100644
--- a/android/config.go
+++ b/android/config.go
@@ -2076,6 +2076,6 @@ func (c *config) AllApexContributions() []string {
return ret
}
-func (c *config) BuildIgnoreApexContributionContents() []string {
+func (c *config) BuildIgnoreApexContributionContents() *bool {
return c.productVariables.BuildIgnoreApexContributionContents
}
diff --git a/android/variable.go b/android/variable.go
index 73f5bfd1f..7a49a6838 100644
--- a/android/variable.go
+++ b/android/variable.go
@@ -495,7 +495,7 @@ type ProductVariables struct {
BuildFromSourceStub *bool `json:",omitempty"`
- BuildIgnoreApexContributionContents []string `json:",omitempty"`
+ BuildIgnoreApexContributionContents *bool `json:",omitempty"`
HiddenapiExportableStubs *bool `json:",omitempty"`