summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2020-04-28 10:44:03 +0100
committerPaul Duffin <paulduffin@google.com>2020-05-08 07:51:00 +0100
commit3375e35d99b428460f0dd8404c74a9e1ccb0b5ab (patch)
tree4a30a6cd29c460fffd843d78aae841a832ebac74 /java/java_test.go
parent06938a0a16a297041b4c914d0e2dda1413e556ea (diff)
java_sdk_library: Control API surfaces generated
Adds a per scope set of properties that allows explicit control over the API surfaces generated. Previously, the term active was used to determine whether it was generated but that was a little abstract and unclear so has been replaced by generated. Test: m nothing Bug: 155164730 Change-Id: I7539d89618b61f6b9d1a4b60cc3f9614b157f0d9
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/java/java_test.go b/java/java_test.go
index e8a1a7c83..0033f319d 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -1229,6 +1229,24 @@ func TestJavaSdkLibrary(t *testing.T) {
}
}
+func TestJavaSdkLibrary_InvalidScopes(t *testing.T) {
+ testJavaError(t, `module "foo": enabled api scope "system" depends on disabled scope "public"`, `
+ java_sdk_library {
+ name: "foo",
+ srcs: ["a.java", "b.java"],
+ api_packages: ["foo"],
+ // Explicitly disable public to test the check that ensures the set of enabled
+ // scopes is consistent.
+ public: {
+ enabled: false,
+ },
+ system: {
+ enabled: true,
+ },
+ }
+ `)
+}
+
var compilerFlagsTestCases = []struct {
in string
out bool