summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
author Jihoon Kang <jihoonkang@google.com> 2023-01-26 08:08:52 +0000
committer Jihoon Kang <jihoonkang@google.com> 2023-01-26 18:44:25 +0000
commit3198f3cb52c07addf3953edae1a826947b0714eb (patch)
treeab085f1a21c49467d6d73c636f59e0762ebe158a /java/java_test.go
parentba46e7662221801867534444e64928f438511a5b (diff)
Generate java_api_contribution module from droidstubs module
Context - droidstubs module are either generated from the java_sdk_library module or defined in the bp files. - Since droidstubs module contains API text file property, java_api_contribution module can by dynamically created from droidstubs. Implementation - Add `api_surface` property in droidstubs module. This property is either inherited from the java_sdk_library or written in the module definition in the bp file. - Add defaultable hook in droidstubs module to generate the child java_api_contribution module. Test: m Change-Id: Ica43d65614723c623cd0c155266f9844e69e5d5e
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/java/java_test.go b/java/java_test.go
index ae77842a5..04a112c0a 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -1840,6 +1840,20 @@ func TestDeviceBinaryWrapperGeneration(t *testing.T) {
}`)
}
+func TestJavaApiContributionEmptyApiFile(t *testing.T) {
+ testJavaError(t,
+ "Error: foo has an empty api file.",
+ `java_api_contribution {
+ name: "foo",
+ }
+ java_api_library {
+ name: "bar",
+ api_surface: "public",
+ api_contributions: ["foo"],
+ }
+ `)
+}
+
func TestJavaApiLibraryAndProviderLink(t *testing.T) {
provider_bp_a := `
java_api_contribution {