From c7ef9892dd3c1e51bc54321e585b6badfbd8beb4 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Tue, 23 Mar 2021 23:21:59 +0000 Subject: Add dependencies for art boot_image Adds dependencies for the art boot image. The art boot image only includes modules from the com.android.art APEX and so this change adds some verification to make sure that the APEX component of the configuration is compatible with the boot_image's apex_availabilty settings and then just adds dependencies on the modules. It relies on the normal APEX processing to cause the com.android.art variant of the boot_image to depend on the equivalent variant of its contents. This purposely does not check that the configuration specifies an APEX of com.android.art and instead relies on the apex_available property being set. Bug: 177892522 Test: m nothing Change-Id: I75a8238546b01e1f166a1d1444215f4afb441780 --- java/boot_image_test.go | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'java/boot_image_test.go') diff --git a/java/boot_image_test.go b/java/boot_image_test.go index 37906ff8d..a289df877 100644 --- a/java/boot_image_test.go +++ b/java/boot_image_test.go @@ -64,3 +64,40 @@ func TestUnknownPrebuiltBootImage(t *testing.T) { } `) } + +func TestBootImageInconsistentArtConfiguration_Platform(t *testing.T) { + android.GroupFixturePreparers( + prepareForTestWithBootImage, + dexpreopt.FixtureSetArtBootJars("platform:foo", "apex:bar"), + ). + ExtendWithErrorHandler(android.FixtureExpectsAtLeastOneErrorMatchingPattern( + `\QArtApexJars is invalid as it requests a platform variant of "foo"\E`)). + RunTestWithBp(t, ` + boot_image { + name: "boot-image", + image_name: "art", + apex_available: [ + "apex", + ], + } + `) +} + +func TestBootImageInconsistentArtConfiguration_ApexMixture(t *testing.T) { + android.GroupFixturePreparers( + prepareForTestWithBootImage, + dexpreopt.FixtureSetArtBootJars("apex1:foo", "apex2:bar"), + ). + ExtendWithErrorHandler(android.FixtureExpectsAtLeastOneErrorMatchingPattern( + `\QArtApexJars configuration is inconsistent, expected all jars to be in the same apex but it specifies apex "apex1" and "apex2"\E`)). + RunTestWithBp(t, ` + boot_image { + name: "boot-image", + image_name: "art", + apex_available: [ + "apex1", + "apex2", + ], + } + `) +} -- cgit v1.2.3-59-g8ed1b