Merge "Identify profile providing apexes using ApexInfo" into main am: 4039516f32
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3114508 Change-Id: Iea4312baee09a9114748f008321050729e3e0b33 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
b9bc2f388a
2 changed files with 36 additions and 4 deletions
|
@ -197,6 +197,12 @@ func TestBootclasspathFragmentInArtApex(t *testing.T) {
|
|||
updatable: false,
|
||||
}
|
||||
|
||||
override_apex {
|
||||
name: "com.mycompany.android.art",
|
||||
base: "com.android.art",
|
||||
min_sdk_version: "33", // mycompany overrides the min_sdk_version
|
||||
}
|
||||
|
||||
apex_key {
|
||||
name: "com.android.art.key",
|
||||
public_key: "testkey.avbpubkey",
|
||||
|
@ -325,6 +331,26 @@ func TestBootclasspathFragmentInArtApex(t *testing.T) {
|
|||
checkCopiesToPredefinedLocationForArt(t, result.Config, module, "bar", "foo")
|
||||
})
|
||||
|
||||
t.Run("boot image files from source of override apex", func(t *testing.T) {
|
||||
result := android.GroupFixturePreparers(
|
||||
commonPreparer,
|
||||
|
||||
// Configure some libraries in the art bootclasspath_fragment that match the source
|
||||
// bootclasspath_fragment's contents property.
|
||||
java.FixtureConfigureBootJars("com.android.art:foo", "com.android.art:bar"),
|
||||
dexpreopt.FixtureSetTestOnlyArtBootImageJars("com.android.art:foo", "com.android.art:bar"),
|
||||
addSource("foo", "bar"),
|
||||
java.FixtureSetBootImageInstallDirOnDevice("art", "apex/com.android.art/javalib"),
|
||||
).RunTest(t)
|
||||
|
||||
ensureExactContents(t, result.TestContext, "com.android.art", "android_common_com.mycompany.android.art_com.mycompany.android.art", []string{
|
||||
"etc/boot-image.prof",
|
||||
"etc/classpaths/bootclasspath.pb",
|
||||
"javalib/bar.jar",
|
||||
"javalib/foo.jar",
|
||||
})
|
||||
})
|
||||
|
||||
t.Run("generate boot image profile even if dexpreopt is disabled", func(t *testing.T) {
|
||||
result := android.GroupFixturePreparers(
|
||||
commonPreparer,
|
||||
|
|
|
@ -524,12 +524,18 @@ func (b *BootclasspathFragmentModule) getProfileProviderApex(ctx android.BaseMod
|
|||
}
|
||||
|
||||
// Bootclasspath fragment modules that are for the platform do not produce boot related files.
|
||||
apexInfo, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
|
||||
apexInfos, _ := android.ModuleProvider(ctx, android.AllApexInfoProvider)
|
||||
if apexInfos == nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
for _, apexInfo := range apexInfos.ApexInfos {
|
||||
for _, apex := range apexInfo.InApexVariants {
|
||||
if isProfileProviderApex(ctx, apex) {
|
||||
return apex
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue