summaryrefslogtreecommitdiff
path: root/android/apex_contributions.go
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2023-12-13 00:06:32 +0000
committer Spandan Das <spandandas@google.com> 2023-12-19 22:37:29 +0000
commitda739a30a6575ae0345e6694da6ff65b1eceabba (patch)
tree09a84b8f6f747610c2ffb1cee0ae2ee3d003cb87 /android/apex_contributions.go
parentfae468ef14fa7fd902c8e004dbd55a3e79b8a30f (diff)
Use the correct prof file when multiple prebuilt apexes exist
Generating boot image requires a .prof file provided by the ART apex. When building with prebuilts, this comes via the prebuilt_bootclasspath_fragment module, which acts as a shim for prebuilt_apex/apex_set. If we have multiple prebuilt apexes in the tree, this shim becomes 1:many. This CL prepares dex_bootjars to select the right .prof file when multiple prebuilts exist. Implementation details - Update deps mutator of dex_bootjars to create a dep on all_apex_contributions. The latter contains information about which apex is selected in a specific release configuration. dex_bootjars will create a dependency on the selected apex in a postdeps phase mutator. - All apex module types (apex, prebuilt_apex and apex_set) will set a provider that contains info about the location of the .prof file on host - dex_bootjars will access the provider of the selected apex to get the location of the .prof file This CL does not drop the old mechanism to get the .prof file (i.e. by creating a dep on {prebuilt_}bootclasspath_fragment). Once all mainline modules have been flagged using apex_contributions, the old mechanism will be dropped Bug: 308790457 Test: Added a unit test that checks that the right .prof is selected when multiple prebuilts exists Change-Id: I40fdb21416c46bed32f6ff187ce5153711ec2c69
Diffstat (limited to 'android/apex_contributions.go')
-rw-r--r--android/apex_contributions.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/android/apex_contributions.go b/android/apex_contributions.go
index 34941c091..a30964080 100644
--- a/android/apex_contributions.go
+++ b/android/apex_contributions.go
@@ -164,6 +164,18 @@ func (p *PrebuiltSelectionInfoMap) IsSelected(baseModuleName, name string) bool
}
}
+// Return the list of soong modules selected for this api domain
+// In the case of apexes, it is the canonical name of the apex on device (/apex/<apex_name>)
+func (p *PrebuiltSelectionInfoMap) GetSelectedModulesForApiDomain(apiDomain string) []string {
+ selected := []string{}
+ for _, entry := range *p {
+ if entry.apiDomain == apiDomain {
+ selected = append(selected, entry.selectedModuleName)
+ }
+ }
+ return selected
+}
+
// This module type does not have any build actions.
func (a *allApexContributions) GenerateAndroidBuildActions(ctx ModuleContext) {
}