Create a product variable for skipping apex contribution contents

This denylist will be used to ignore the prebuilt google apexes listed
in apex_contributions of vendor/google/build when building aosp products
in next.

Test: go build ./android
Bug: 308187268
Change-Id: Ib2c018a2aeda5578cf3f1a6a56253bf84850ba5f
Merged-In: Ib2c018a2aeda5578cf3f1a6a56253bf84850ba5f
This commit is contained in:
Spandan Das
2024-02-14 02:09:21 +00:00
parent 7870d329a5
commit 68a6e29ed5
3 changed files with 10 additions and 0 deletions

View File

@@ -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())
}

View File

@@ -2015,3 +2015,7 @@ func (c *config) AllApexContributions() []string {
}
return ret
}
func (c *config) BuildIgnoreApexContributionContents() []string {
return c.productVariables.BuildIgnoreApexContributionContents
}

View File

@@ -495,6 +495,8 @@ type ProductVariables struct {
BuildFlags map[string]string `json:",omitempty"`
BuildFromSourceStub *bool `json:",omitempty"`
BuildIgnoreApexContributionContents []string `json:",omitempty"`
}
type PartitionQualifiedVariablesType struct {