diff options
author | Paul Duffin <paulduffin@google.com> | 2021-06-07 19:28:15 +0100 |
---|---|---|
committer | Paul Duffin <paulduffin@google.com> | 2021-06-18 12:11:17 +0100 |
commit | e11254793da8f6934c54db415a8e3dec97c44c52 (patch) | |
tree | 72d638675526269fdd9a7c2b2a5a25d2e72d22e0 /sdk | |
parent | 360f8359f3c853d168db609e300e505a93d50c4d (diff) |
Move boot jars package check into platform_bootclasspath
Bug: 177892522
Bug: 189298093
Test: m check-boot-jars
m SOONG_CONFIG_art_module_source_build=false check-boot-jars
- Ran both commands with and without java.lang in the
package_allowed_list.txt
Merged-In: Iba1a881c8f6b6919d5c0c0520eb3073658f3b8d2
Change-Id: Iba1a881c8f6b6919d5c0c0520eb3073658f3b8d2
(cherry picked from commit c8ead41ba9426a31c8ca3d7228991a45ccff6299)
Diffstat (limited to 'sdk')
-rw-r--r-- | sdk/bootclasspath_fragment_sdk_test.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sdk/bootclasspath_fragment_sdk_test.go b/sdk/bootclasspath_fragment_sdk_test.go index f2ab6a198..1f28ed39a 100644 --- a/sdk/bootclasspath_fragment_sdk_test.go +++ b/sdk/bootclasspath_fragment_sdk_test.go @@ -40,6 +40,7 @@ func fixtureAddPlatformBootclasspathForBootclasspathFragment(apex, fragment stri } `, apex, fragment)), android.FixtureAddFile("frameworks/base/config/boot-profile.txt", nil), + android.FixtureAddFile("build/soong/scripts/check_boot_jars/package_allowed_list.txt", nil), ) } @@ -173,9 +174,29 @@ sdk_snapshot { .intermediates/mybootlib/android_common/javac/mybootlib.jar -> java/mybootlib.jar `), snapshotTestPreparer(checkSnapshotWithoutSource, preparerForSnapshot), + + // Check the behavior of the snapshot without the source. + snapshotTestChecker(checkSnapshotWithoutSource, func(t *testing.T, result *android.TestResult) { + // Make sure that the boot jars package check rule includes the dex jar retrieved from the prebuilt apex. + checkBootJarsPackageCheckRule(t, result, "out/soong/.intermediates/prebuilts/apex/com.android.art.deapexer/android_common/deapexer/javalib/mybootlib.jar") + }), + snapshotTestPreparer(checkSnapshotWithSourcePreferred, preparerForSnapshot), snapshotTestPreparer(checkSnapshotPreferredWithSource, preparerForSnapshot), ) + + // Make sure that the boot jars package check rule includes the dex jar created from the source. + checkBootJarsPackageCheckRule(t, result, "out/soong/.intermediates/mybootlib/android_common_apex10000/aligned/mybootlib.jar") +} + +// checkBootJarsPackageCheckRule checks that the supplied module is an input to the boot jars +// package check rule. +func checkBootJarsPackageCheckRule(t *testing.T, result *android.TestResult, expectedModule string) { + platformBcp := result.ModuleForTests("platform-bootclasspath", "android_common") + bootJarsCheckRule := platformBcp.Rule("boot_jars_package_check") + command := bootJarsCheckRule.RuleParams.Command + expectedCommandArgs := " out/soong/host/linux-x86/bin/dexdump build/soong/scripts/check_boot_jars/package_allowed_list.txt " + expectedModule + " &&" + android.AssertStringDoesContain(t, "boot jars package check", command, expectedCommandArgs) } func TestSnapshotWithBootClasspathFragment_Contents(t *testing.T) { |