From d0fe1307aafc7714f3f9e9949a2c143be04fcf44 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Wed, 14 Sep 2022 17:04:51 +0000 Subject: [PATCH] Revert "bootclasspath_fragment: Treat some specific modules as test" This reverts commit ff9b6faba2b9a949289c70657db87c0b1790cc07. Reason for revert: No longer needed Bug: 194063708 Test: m nothing Change-Id: Ic2f6761c9a0a00a612724cb429f002a16522e53f --- java/bootclasspath_fragment.go | 17 +---------------- java/bootclasspath_fragment_test.go | 22 ---------------------- 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/java/bootclasspath_fragment.go b/java/bootclasspath_fragment.go index b28d70cab..11634fabf 100644 --- a/java/bootclasspath_fragment.go +++ b/java/bootclasspath_fragment.go @@ -827,22 +827,7 @@ func (b *BootclasspathFragmentModule) createHiddenAPIFlagInput(ctx android.Modul // isTestFragment returns true if the current module is a test bootclasspath_fragment. func (b *BootclasspathFragmentModule) isTestFragment() bool { - if b.testFragment { - return true - } - - // TODO(b/194063708): Once test fragments all use bootclasspath_fragment_test - // Some temporary exceptions until all test fragments use the - // bootclasspath_fragment_test module type. - name := b.BaseModuleName() - if strings.HasPrefix(name, "test_") { - return true - } - if name == "apex.apexd_test_bootclasspath-fragment" { - return true - } - - return false + return b.testFragment } // produceHiddenAPIOutput produces the hidden API all-flags.csv file (and supporting files) diff --git a/java/bootclasspath_fragment_test.go b/java/bootclasspath_fragment_test.go index 8ffe99a77..2307ce02b 100644 --- a/java/bootclasspath_fragment_test.go +++ b/java/bootclasspath_fragment_test.go @@ -293,22 +293,6 @@ func TestBootclasspathFragment_Test(t *testing.T) { }, } - bootclasspath_fragment { - name: "test_fragment", - contents: ["mysdklibrary"], - hidden_api: { - split_packages: [], - }, - } - - bootclasspath_fragment { - name: "apex.apexd_test_bootclasspath-fragment", - contents: ["mysdklibrary"], - hidden_api: { - split_packages: [], - }, - } - bootclasspath_fragment_test { name: "a_test_fragment", contents: ["mysdklibrary"], @@ -330,12 +314,6 @@ func TestBootclasspathFragment_Test(t *testing.T) { fragment := result.Module("myfragment", "android_common").(*BootclasspathFragmentModule) android.AssertBoolEquals(t, "not a test fragment", false, fragment.isTestFragment()) - fragment = result.Module("test_fragment", "android_common").(*BootclasspathFragmentModule) - android.AssertBoolEquals(t, "is a test fragment by prefix", true, fragment.isTestFragment()) - fragment = result.Module("a_test_fragment", "android_common").(*BootclasspathFragmentModule) android.AssertBoolEquals(t, "is a test fragment by type", true, fragment.isTestFragment()) - - fragment = result.Module("apex.apexd_test_bootclasspath-fragment", "android_common").(*BootclasspathFragmentModule) - android.AssertBoolEquals(t, "is a test fragment by name", true, fragment.isTestFragment()) }