Revert "Convert BuildIgnoreApexContritbutions variable to a boolean"

This revert was created by Android Culprit Assistant. The culprit was identified in the following culprit search session (http://go/aca-get/53721efb-c49e-4ce8-b96c-fd03598b4202).

Change-Id: I197b03b650bc6c22ff3c5eb9605522fd9650e98f
This commit is contained in:
Android Culprit Assistant
2024-03-22 06:15:51 +00:00
committed by Gerrit Code Review
parent aa1b7c9124
commit d4afe20481
3 changed files with 13 additions and 15 deletions

View File

@@ -115,6 +115,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
}
// 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
@@ -137,19 +141,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)
}

View File

@@ -2076,6 +2076,6 @@ func (c *config) AllApexContributions() []string {
return ret
}
func (c *config) BuildIgnoreApexContributionContents() *bool {
func (c *config) BuildIgnoreApexContributionContents() []string {
return c.productVariables.BuildIgnoreApexContributionContents
}

View File

@@ -495,7 +495,7 @@ type ProductVariables struct {
BuildFromSourceStub *bool `json:",omitempty"`
BuildIgnoreApexContributionContents *bool `json:",omitempty"`
BuildIgnoreApexContributionContents []string `json:",omitempty"`
HiddenapiExportableStubs *bool `json:",omitempty"`