From ba6afd0dbab19efedc5a849ab2bc6f7923ec6ce3 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Tue, 19 Nov 2019 19:44:10 +0000 Subject: Allow contents and image_name to be specified together Previously, only one of the contents or image_name properties could be specified at once which meant that there was no way to create a prebuilt which lists its fixed contents while at the same time allowing it to check that that the contents matched what the build configuration required. e.g. a prebuilt_bootclasspath_fragment that had image_name: "art", could not list its contents and also check that those contents matched the ART_APEX_JARS which the build configuration required. This change allows contents and image_name to be specified together and adds a check to make sure that the contents are consistent with the configuration appropriate to the image_name. The check is only performed for modules that are active so that a prebuilt_bootclasspath_fragment which was created without coverage enabled (the default) would not cause a build failure in a coverage build unless it was preferred. Bug: 177892522 Test: m nothing Change-Id: Ie601f29f707b3f6030fa7d252afa2c4826cc9f8e --- java/bootclasspath_fragment_test.go | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'java/bootclasspath_fragment_test.go') diff --git a/java/bootclasspath_fragment_test.go b/java/bootclasspath_fragment_test.go index 0db93619c..0419a469b 100644 --- a/java/bootclasspath_fragment_test.go +++ b/java/bootclasspath_fragment_test.go @@ -113,19 +113,6 @@ func TestBootclasspathFragmentWithoutImageNameOrContents(t *testing.T) { `) } -func TestBootclasspathFragmentWithImageNameAndContents(t *testing.T) { - prepareForTestWithBootclasspathFragment. - ExtendWithErrorHandler(android.FixtureExpectsAtLeastOneErrorMatchingPattern( - `\Qboth of the "image_name" and "contents" properties\E`)). - RunTestWithBp(t, ` - bootclasspath_fragment { - name: "bootclasspath-fragment", - image_name: "boot", - contents: ["other"], - } - `) -} - func TestBootclasspathFragment_Coverage(t *testing.T) { prepareForTestWithFrameworkCoverage := android.FixtureMergeEnv(map[string]string{ "EMMA_INSTRUMENT": "true", -- cgit v1.2.3