Loading java/java_test.go +13 −0 Original line number Diff line number Diff line Loading @@ -1043,6 +1043,12 @@ func TestJavaSdkLibrary(t *testing.T) { libs: ["baz"], sdk_version: "system_current", } java_library { name: "baz-test", srcs: ["c.java"], libs: ["foo"], sdk_version: "test_current", } `) // check the existence of the internal modules Loading Loading @@ -1075,6 +1081,13 @@ func TestJavaSdkLibrary(t *testing.T) { "foo.stubs.jar") } bazTestJavac := ctx.ModuleForTests("baz-test", "android_common").Rule("javac") // tests if baz-test is actually linked to the test stubs lib if !strings.Contains(bazTestJavac.Args["classpath"], "foo.stubs.test.jar") { t.Errorf("baz-test javac classpath %v does not contain %q", bazTestJavac.Args["classpath"], "foo.stubs.test.jar") } // test if baz has exported SDK lib names foo and bar to qux qux := ctx.ModuleForTests("qux", "android_common") if quxLib, ok := qux.Module().(*Library); ok { Loading java/sdk_library.go +6 −3 Original line number Diff line number Diff line Loading @@ -689,16 +689,19 @@ func (module *SdkLibrary) sdkJars( return module.Library.ImplementationJars() } } var paths *scopePaths var apiScope *apiScope switch sdkVersion.kind { case sdkSystem: paths = module.getScopePaths(apiScopeSystem) apiScope = apiScopeSystem case sdkTest: apiScope = apiScopeTest case sdkPrivate: return module.Library.HeaderJars() default: paths = module.getScopePaths(apiScopePublic) apiScope = apiScopePublic } paths := module.getScopePaths(apiScope) if headerJars { return paths.stubsHeaderPath } else { Loading Loading
java/java_test.go +13 −0 Original line number Diff line number Diff line Loading @@ -1043,6 +1043,12 @@ func TestJavaSdkLibrary(t *testing.T) { libs: ["baz"], sdk_version: "system_current", } java_library { name: "baz-test", srcs: ["c.java"], libs: ["foo"], sdk_version: "test_current", } `) // check the existence of the internal modules Loading Loading @@ -1075,6 +1081,13 @@ func TestJavaSdkLibrary(t *testing.T) { "foo.stubs.jar") } bazTestJavac := ctx.ModuleForTests("baz-test", "android_common").Rule("javac") // tests if baz-test is actually linked to the test stubs lib if !strings.Contains(bazTestJavac.Args["classpath"], "foo.stubs.test.jar") { t.Errorf("baz-test javac classpath %v does not contain %q", bazTestJavac.Args["classpath"], "foo.stubs.test.jar") } // test if baz has exported SDK lib names foo and bar to qux qux := ctx.ModuleForTests("qux", "android_common") if quxLib, ok := qux.Module().(*Library); ok { Loading
java/sdk_library.go +6 −3 Original line number Diff line number Diff line Loading @@ -689,16 +689,19 @@ func (module *SdkLibrary) sdkJars( return module.Library.ImplementationJars() } } var paths *scopePaths var apiScope *apiScope switch sdkVersion.kind { case sdkSystem: paths = module.getScopePaths(apiScopeSystem) apiScope = apiScopeSystem case sdkTest: apiScope = apiScopeTest case sdkPrivate: return module.Library.HeaderJars() default: paths = module.getScopePaths(apiScopePublic) apiScope = apiScopePublic } paths := module.getScopePaths(apiScope) if headerJars { return paths.stubsHeaderPath } else { Loading