Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0d24adea authored by Spandan Das's avatar Spandan Das
Browse files

Convert BuildIgnoreApexContritbutions variable to a boolean

(This relands aosp/3007754. The previous sdk build failures have been
resolved now)

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
Merged-In: Ibdd1e0d0d4f08f4f5251b9c4baa1aaf42e7df34f
(cherry picked from commit f3df7305d653471c70d131177e773b4723247e3a)
Change-Id: I9d57d899c6a9a321e2eb3579c954641f2cb04709
parent 219ce554
Loading
Loading
Loading
Loading
+13 −11
Original line number Diff line number Diff line
@@ -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,6 +137,11 @@ 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)
@@ -148,6 +149,7 @@ func (a *allApexContributions) SetPrebuiltSelectionInfoProvider(ctx BaseModuleCo
				ctx.ModuleErrorf("%s is not an apex_contributions module\n", child.Name())
			}
		})
	}
	SetProvider(ctx, PrebuiltSelectionInfoProvider, p)
}

+1 −1
Original line number Diff line number Diff line
@@ -2126,7 +2126,7 @@ func (c *config) AllApexContributions() []string {
	return ret
}

func (c *config) BuildIgnoreApexContributionContents() []string {
func (c *config) BuildIgnoreApexContributionContents() *bool {
	return c.productVariables.BuildIgnoreApexContributionContents
}

+1 −1
Original line number Diff line number Diff line
@@ -500,7 +500,7 @@ type ProductVariables struct {

	BuildFromSourceStub *bool `json:",omitempty"`

	BuildIgnoreApexContributionContents []string `json:",omitempty"`
	BuildIgnoreApexContributionContents *bool `json:",omitempty"`

	HiddenapiExportableStubs *bool `json:",omitempty"`