diff options
author | Paul Duffin <paulduffin@google.com> | 2021-05-21 19:27:58 +0100 |
---|---|---|
committer | Paul Duffin <paulduffin@google.com> | 2021-05-25 09:30:20 +0100 |
commit | 0788cd603894a6d843c8e3017fd3969b898e716c (patch) | |
tree | df9ee673b02adb000deb0d1cb1cf435695f9ed34 /apex | |
parent | 973bedb9874301f774d4e47272b3048303bf98cb (diff) | |
download | soong-0788cd603894a6d843c8e3017fd3969b898e716c.tar.gz |
Only export boot image files to APEX if they are actually created
Previously, the generation of the rules to create the boot image files
was separate from the code to provide those files to the APEX which
meant that it was possible for the APEX to try and use files that had
no rules to create them.
This changes avoids that by only exporting the files once the rules
have been created.
This necessitated a few changes to tests that were relying on the
previous behavior. Including removing completely the test that used an
image_name: "boot" as that is no longer a valid configuration name as
its functionality has been replaced by platform_bootclasspath.
A follow up change will make the validation of the properties of
bootclasspath_fragment stricter to prevent "boot" being used as the
image_name.
Bug: 177892522
Bug: 188680624
Test: lunch qemu_trusty_arm64-userdebug
m droid dist
- verify that before this change it fails and after this change
it works.
m com.android.art
- verify that this change does not change the APEX contents with
either qemu_trusty_arm64-userdebug or aosp_arm64-userdebug
Merged-In: I0497a151eb0731cbe6a1a7e7bbbb1e4dda75898f
Change-Id: I0497a151eb0731cbe6a1a7e7bbbb1e4dda75898f
(cherry picked from commit 58e0e769c9b1f4dbad95acfd1792dd91e716e456)
Diffstat (limited to 'apex')
-rw-r--r-- | apex/bootclasspath_fragment_test.go | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/apex/bootclasspath_fragment_test.go b/apex/bootclasspath_fragment_test.go index 9965f83bd..84cf9c499 100644 --- a/apex/bootclasspath_fragment_test.go +++ b/apex/bootclasspath_fragment_test.go @@ -62,6 +62,7 @@ func TestBootclasspathFragments(t *testing.T) { apex { name: "com.android.art", key: "com.android.art.key", + bootclasspath_fragments: ["art-bootclasspath-fragment"], java_libs: [ "baz", "quuz", @@ -100,32 +101,12 @@ func TestBootclasspathFragments(t *testing.T) { "com.android.art", ], } - - bootclasspath_fragment { - name: "framework-bootclasspath-fragment", - image_name: "boot", - } `, ) - // Make sure that the framework-bootclasspath-fragment is using the correct configuration. - checkBootclasspathFragment(t, result, "framework-bootclasspath-fragment", "platform:foo,platform:bar", ` -test_device/dex_bootjars/android/system/framework/arm/boot-foo.art -test_device/dex_bootjars/android/system/framework/arm/boot-foo.oat -test_device/dex_bootjars/android/system/framework/arm/boot-foo.vdex -test_device/dex_bootjars/android/system/framework/arm/boot-bar.art -test_device/dex_bootjars/android/system/framework/arm/boot-bar.oat -test_device/dex_bootjars/android/system/framework/arm/boot-bar.vdex -test_device/dex_bootjars/android/system/framework/arm64/boot-foo.art -test_device/dex_bootjars/android/system/framework/arm64/boot-foo.oat -test_device/dex_bootjars/android/system/framework/arm64/boot-foo.vdex -test_device/dex_bootjars/android/system/framework/arm64/boot-bar.art -test_device/dex_bootjars/android/system/framework/arm64/boot-bar.oat -test_device/dex_bootjars/android/system/framework/arm64/boot-bar.vdex -`) - // Make sure that the art-bootclasspath-fragment is using the correct configuration. - checkBootclasspathFragment(t, result, "art-bootclasspath-fragment", "com.android.art:baz,com.android.art:quuz", ` + checkBootclasspathFragment(t, result, "art-bootclasspath-fragment", "android_common_apex10000", + "com.android.art:baz,com.android.art:quuz", ` test_device/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.art test_device/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.oat test_device/dex_artjars/android/apex/art_boot_images/javalib/arm/boot.vdex @@ -263,10 +244,10 @@ func TestBootclasspathFragments_FragmentDependency(t *testing.T) { checkSdkKindStubs("other", otherInfo, android.SdkCorePlatform) } -func checkBootclasspathFragment(t *testing.T, result *android.TestResult, moduleName string, expectedConfiguredModules string, expectedBootclasspathFragmentFiles string) { +func checkBootclasspathFragment(t *testing.T, result *android.TestResult, moduleName, variantName string, expectedConfiguredModules string, expectedBootclasspathFragmentFiles string) { t.Helper() - bootclasspathFragment := result.ModuleForTests(moduleName, "android_common").Module().(*java.BootclasspathFragmentModule) + bootclasspathFragment := result.ModuleForTests(moduleName, variantName).Module().(*java.BootclasspathFragmentModule) bootclasspathFragmentInfo := result.ModuleProvider(bootclasspathFragment, java.BootclasspathFragmentApexContentInfoProvider).(java.BootclasspathFragmentApexContentInfo) modules := bootclasspathFragmentInfo.Modules() |