From 8ab28dd61d3f59f2370e0886d3856ad4780d62eb Mon Sep 17 00:00:00 2001 From: Spandan Das Date: Sat, 17 Feb 2024 03:31:45 +0000 Subject: [PATCH] Revert "Revert "Create a product variable for skipping apex cont..." Revert submission 2966055-revert-2964509-skip-apex-contributions-EOKWOFHENC Reason for revert: The root cause CL has been reverted https://googleplex-android-review.git.corp.google.com/c/platform/vendor/google/build/+/26268799 Reverted changes: /q/submissionid:2966055-revert-2964509-skip-apex-contributions-EOKWOFHENC Change-Id: I93e8f60124a09b4fba4675ac7f128ab553102bf7 --- android/apex_contributions.go | 4 ++++ android/config.go | 4 ++++ android/variable.go | 2 ++ 3 files changed, 10 insertions(+) diff --git a/android/apex_contributions.go b/android/apex_contributions.go index 236abf663..89e27b97b 100644 --- a/android/apex_contributions.go +++ b/android/apex_contributions.go @@ -98,6 +98,10 @@ 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 + } if !ctx.OtherModuleExists(content) && !ctx.Config().AllowMissingDependencies() { ctx.ModuleErrorf("%s listed in apex_contributions %s does not exist\n", content, m.Name()) } diff --git a/android/config.go b/android/config.go index d94a86f71..40497d174 100644 --- a/android/config.go +++ b/android/config.go @@ -2015,3 +2015,7 @@ func (c *config) AllApexContributions() []string { } return ret } + +func (c *config) BuildIgnoreApexContributionContents() []string { + return c.productVariables.BuildIgnoreApexContributionContents +} diff --git a/android/variable.go b/android/variable.go index a4917c54c..4a8da821b 100644 --- a/android/variable.go +++ b/android/variable.go @@ -495,6 +495,8 @@ type ProductVariables struct { BuildFlags map[string]string `json:",omitempty"` BuildFromSourceStub *bool `json:",omitempty"` + + BuildIgnoreApexContributionContents []string `json:",omitempty"` } type PartitionQualifiedVariablesType struct {