summaryrefslogtreecommitdiff
path: root/java/hiddenapi_singleton_test.go
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2021-02-12 11:46:42 +0000
committerPaul Duffin <paulduffin@google.com>2021-02-16 13:28:26 +0000
commit031d8693b3dae7edaca2e5fef3d017ac2e67424d (patch)
tree496cc3cd5c3166c0b4c048fe7e66e5833e46a93a /java/hiddenapi_singleton_test.go
parent7ad17bdad5b613d483d4f77d3c7637c407904211 (diff)
Allow explicitly specified additional annotations for hiddenapi
Adds the hiddenapi_additional_annotations to allow a library to list the libraries that provided additional hiddenapi related annotations for a library. Modifies merge_csv.py so it can process multiple zip files at the same time and uses that to merge the embedded .uau files from a module and those it depends upon. Bug: 180102243 Test: m droid Verified that hiddenapi files (both aggregated ones and for the individual modules) are not affected by this change. Change-Id: I796520021c7357398a9e2a09f1029e4a578b05b3
Diffstat (limited to 'java/hiddenapi_singleton_test.go')
-rw-r--r--java/hiddenapi_singleton_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/java/hiddenapi_singleton_test.go b/java/hiddenapi_singleton_test.go
index df825bb3a..4670d0311 100644
--- a/java/hiddenapi_singleton_test.go
+++ b/java/hiddenapi_singleton_test.go
@@ -82,6 +82,10 @@ func TestHiddenAPIIndexSingleton(t *testing.T) {
name: "foo",
srcs: ["a.java"],
compile_dex: true,
+
+ hiddenapi_additional_annotations: [
+ "foo-hiddenapi-annotations",
+ ],
}
java_library {
@@ -90,6 +94,12 @@ func TestHiddenAPIIndexSingleton(t *testing.T) {
compile_dex: true,
}
+ java_library {
+ name: "foo-hiddenapi-annotations",
+ srcs: ["a.java"],
+ compile_dex: true,
+ }
+
java_import {
name: "foo",
jars: ["a.jar"],
@@ -112,6 +122,15 @@ func TestHiddenAPIIndexSingleton(t *testing.T) {
.intermediates/foo/android_common/hiddenapi/index.csv
`,
indexRule)
+
+ // Make sure that the foo-hiddenapi-annotations.jar is included in the inputs to the rules that
+ // creates the index.csv file.
+ foo := ctx.ModuleForTests("foo", "android_common")
+ indexParams := foo.Output("hiddenapi/index.csv")
+ CheckHiddenAPIRuleInputs(t, `
+.intermediates/foo-hiddenapi-annotations/android_common/javac/foo-hiddenapi-annotations.jar
+.intermediates/foo/android_common/javac/foo.jar
+`, indexParams)
}
func TestHiddenAPISingletonWithPrebuilt(t *testing.T) {