summaryrefslogtreecommitdiff
path: root/java/bootclasspath_fragment.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-20 16:43:01 +0000
commit5be6333692b6881b223b672c2251efaf4605bb33 (patch)
treedc793a41ec9dc4d4f3cc7a0af05168129582624c /java/bootclasspath_fragment.go
parenta4cca85eeabdb2f7e35f447936c449a345428d5a (diff)
Use the correct bootjars when multiple prebuilt apexes exist
hiddenapi and dexpreopt require boot and system server jars from apexes. When building with prebuilts, this comes via java_import/java_sdk_library_import, which acts as a hook for prebuilt_apex/apex_set. If we have multiple apexes in the tree, this hook becomes 1:many. This CL prepares dex_bootjars to select the right deapexerd .jar files when mutliple prebuilts exist. Implementation details - Update prebuilt module types (prebuilt_apex/apex_set) and source apexes to set a map of library name to dex jar path on host. - dex_bootjars will access the path of the .dex jar on host via the provider. These then copied/installed to the right locations. This CL does not drop the old mechanism to get the dex file (i.e. by creating a dep on java_library). Once all mainline modules have been flagged using apex_contributions, the old mechanism will be dropped Bug: 308790457 Test: git_master-art-host:art-gtest https://android-build.corp.google.com/builds/abtd/run/L21500030000926533 Test: git_main:art_standalone_dexpreopt_tests https://android-build.corp.google.com/builds/abtd/run/L99000030000891212 Test: Added a unit test that checks that the right .jar is selected when multiple prebuilts exists Change-Id: I6ef94135b9303a35135810930af4b641df13a583
Diffstat (limited to 'java/bootclasspath_fragment.go')
-rw-r--r--java/bootclasspath_fragment.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/java/bootclasspath_fragment.go b/java/bootclasspath_fragment.go
index 010dbec8f..ae2440466 100644
--- a/java/bootclasspath_fragment.go
+++ b/java/bootclasspath_fragment.go
@@ -385,6 +385,10 @@ func (i BootclasspathFragmentApexContentInfo) DexBootJarPathForContentModule(mod
}
}
+func (i BootclasspathFragmentApexContentInfo) DexBootJarPathMap() bootDexJarByModule {
+ return i.contentModuleDexJarPaths
+}
+
func (i BootclasspathFragmentApexContentInfo) ProfilePathOnHost() android.Path {
return i.profilePathOnHost
}
@@ -1034,10 +1038,6 @@ func (module *PrebuiltBootclasspathFragmentModule) produceHiddenAPIOutput(ctx an
return android.PathForModuleSrc(ctx, *src)
}
- // Retrieve the dex files directly from the content modules. They in turn should retrieve the
- // encoded dex jars from the prebuilt .apex files.
- encodedBootDexJarsByModule := extractEncodedDexJarsFromModules(ctx, contents)
-
output := HiddenAPIOutput{
HiddenAPIFlagOutput: HiddenAPIFlagOutput{
AnnotationFlagsPath: pathForSrc("hidden_api.annotation_flags", module.prebuiltProperties.Hidden_api.Annotation_flags),
@@ -1048,8 +1048,6 @@ func (module *PrebuiltBootclasspathFragmentModule) produceHiddenAPIOutput(ctx an
StubFlagsPath: pathForOptionalSrc(module.prebuiltProperties.Hidden_api.Stub_flags, nil),
AllFlagsPath: pathForOptionalSrc(module.prebuiltProperties.Hidden_api.All_flags, nil),
},
-
- EncodedBootDexFilesByModule: encodedBootDexJarsByModule,
}
// TODO: Temporarily fallback to stub_flags/all_flags properties until prebuilts have been updated.