From 3375e35d99b428460f0dd8404c74a9e1ccb0b5ab Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Tue, 28 Apr 2020 10:44:03 +0100 Subject: 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 --- java/java_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'java/java_test.go') 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 -- cgit v1.2.3-59-g8ed1b