bootclasspath_fragment: Require at least one hidden_api package property

Previously, the split_packages, single_packages and package_prefixes
properties were all optional and the split_packages defaulted to ["*"].
As that value conflicted with the other package properties that meant
that split_packages always had to be specified even if it was to just
set it to an empty array.

This change requires at least one of them to be specified and defaults
split_packages to an empty list which means it is not required,
although it can be helpful to make that explicit.

Bug: 194063708
Test: m nothing
Change-Id: I5a4c2d68e72e39f5c4a2441326dfce8685fc8ff2
(cherry picked from commit 9fd564711e)
Merged-In: I5a4c2d68e72e39f5c4a2441326dfce8685fc8ff2
This commit is contained in:
Paul Duffin
2022-03-31 15:42:30 +01:00
committed by Cherrypicker Worker
parent e2c7fd9b8c
commit 3532c556ed
8 changed files with 120 additions and 3 deletions

View File

@@ -101,6 +101,9 @@ func TestSnapshotWithBootclasspathFragment_ImageName(t *testing.T) {
image_name: "art",
contents: ["mybootlib"],
apex_available: ["com.android.art"],
hidden_api: {
split_packages: ["*"],
},
}
apex_key {
@@ -223,6 +226,9 @@ func testSnapshotWithBootClasspathFragment_Contents(t *testing.T, sdk string, co
// This should be automatically added to the sdk_snapshot as a java_sdk_libs module.
stub_libs: ["mycoreplatform"],
},
hidden_api: {
split_packages: ["*"],
},
}
java_library {
@@ -507,6 +513,9 @@ func TestSnapshotWithBootClasspathFragment_Fragments(t *testing.T) {
contents: [
"myotherlib",
],
hidden_api: {
split_packages: ["*"],
},
}
java_library {
@@ -536,6 +545,9 @@ func TestSnapshotWithBootClasspathFragment_Fragments(t *testing.T) {
module: "myotherbootclasspathfragment"
},
],
hidden_api: {
split_packages: ["*"],
},
}
java_sdk_library {
@@ -615,6 +627,9 @@ func TestBasicSdkWithBootclasspathFragment(t *testing.T) {
image_name: "art",
contents: ["mybootlib"],
apex_available: ["myapex"],
hidden_api: {
split_packages: ["*"],
},
}
java_library {
@@ -722,6 +737,7 @@ func TestSnapshotWithBootclasspathFragment_HiddenAPI(t *testing.T) {
unsupported_packages: [
"my-unsupported-packages.txt",
],
split_packages: ["*"],
},
}