summaryrefslogtreecommitdiff
path: root/java/hiddenapi_singleton_test.go
diff options
context:
space:
mode:
authorScott Lobdell <slobdell@google.com>2021-03-11 19:08:45 +0000
committerScott Lobdell <slobdell@google.com>2021-03-16 00:44:22 +0000
commit85534c36f81cf1557ddaa01605199bfc3a9fd76c (patch)
treef9b65ea011ac58731bc866a621f526ea8fa7e39f /java/hiddenapi_singleton_test.go
parent5989878a55d2d34a1a8e5e16bb37349c4949758b (diff)
parentedc1fc38c73698499b37c40435b25ef2a5ade887 (diff)
Merge SP1A.210311.001
Change-Id: I28e9aad9ed4dd91092fd24efb136f0aac7bdb68e
Diffstat (limited to 'java/hiddenapi_singleton_test.go')
-rw-r--r--java/hiddenapi_singleton_test.go30
1 files changed, 23 insertions, 7 deletions
diff --git a/java/hiddenapi_singleton_test.go b/java/hiddenapi_singleton_test.go
index 4670d0311..fb63820a8 100644
--- a/java/hiddenapi_singleton_test.go
+++ b/java/hiddenapi_singleton_test.go
@@ -89,12 +89,6 @@ func TestHiddenAPIIndexSingleton(t *testing.T) {
}
java_library {
- name: "foo-hiddenapi",
- srcs: ["a.java"],
- compile_dex: true,
- }
-
- java_library {
name: "foo-hiddenapi-annotations",
srcs: ["a.java"],
compile_dex: true,
@@ -118,7 +112,6 @@ func TestHiddenAPIIndexSingleton(t *testing.T) {
indexRule := hiddenAPIIndex.Rule("singleton-merged-hiddenapi-index")
CheckHiddenAPIRuleInputs(t, `
.intermediates/bar/android_common/hiddenapi/index.csv
-.intermediates/foo-hiddenapi/android_common/hiddenapi/index.csv
.intermediates/foo/android_common/hiddenapi/index.csv
`,
indexRule)
@@ -133,6 +126,29 @@ func TestHiddenAPIIndexSingleton(t *testing.T) {
`, indexParams)
}
+func TestHiddenAPISingletonWithSourceAndPrebuiltPreferredButNoDex(t *testing.T) {
+ config := testConfigWithBootJars(`
+ java_library {
+ name: "foo",
+ srcs: ["a.java"],
+ compile_dex: true,
+ }
+
+ java_import {
+ name: "foo",
+ jars: ["a.jar"],
+ prefer: true,
+ }
+ `, []string{"platform:foo"}, nil)
+
+ ctx := testContextWithHiddenAPI(config)
+
+ runWithErrors(t, ctx, config,
+ "hiddenapi has determined that the source module \"foo\" should be ignored as it has been"+
+ " replaced by the prebuilt module \"prebuilt_foo\" but unfortunately it does not provide a"+
+ " suitable boot dex jar")
+}
+
func TestHiddenAPISingletonWithPrebuilt(t *testing.T) {
ctx, _ := testHiddenAPIBootJars(t, `
java_import {