Loading java/java_test.go +13 −0 Original line number Diff line number Diff line Loading @@ -1099,6 +1099,12 @@ func TestJavaSdkLibrary(t *testing.T) { libs: ["foo"], sdk_version: "test_current", } java_library { name: "baz-29", srcs: ["c.java"], libs: ["foo"], sdk_version: "system_29", } `) // check the existence of the internal modules Loading Loading @@ -1138,6 +1144,13 @@ func TestJavaSdkLibrary(t *testing.T) { "foo.stubs.test.jar") } baz29Javac := ctx.ModuleForTests("baz-29", "android_common").Rule("javac") // tests if baz-29 is actually linked to the system 29 stubs lib if !strings.Contains(baz29Javac.Args["classpath"], "prebuilts/sdk/29/system/foo.jar") { t.Errorf("baz-29 javac classpath %v does not contain %q", baz29Javac.Args["classpath"], "prebuilts/sdk/29/system/foo.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 +3 −2 Original line number Diff line number Diff line Loading @@ -683,8 +683,9 @@ func (module *SdkLibrary) sdkJars( sdkVersion sdkSpec, headerJars bool) android.Paths { // This module is just a wrapper for the stubs. if ctx.Config().UnbundledBuildUsePrebuiltSdks() { // If a specific numeric version has been requested or the build is explicitly configured // for it then use prebuilt versions of the sdk. if sdkVersion.version.isNumbered() || ctx.Config().UnbundledBuildUsePrebuiltSdks() { return module.PrebuiltJars(ctx, sdkVersion) } else { if !sdkVersion.specified() { Loading java/testing.go +1 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ func TestConfig(buildDir string, env map[string]string, bp string, fs map[string "prebuilts/sdk/29/public/android.jar": nil, "prebuilts/sdk/29/public/framework.aidl": nil, "prebuilts/sdk/29/system/android.jar": nil, "prebuilts/sdk/29/system/foo.jar": nil, "prebuilts/sdk/current/core/android.jar": nil, "prebuilts/sdk/current/public/android.jar": nil, "prebuilts/sdk/current/public/framework.aidl": nil, Loading Loading
java/java_test.go +13 −0 Original line number Diff line number Diff line Loading @@ -1099,6 +1099,12 @@ func TestJavaSdkLibrary(t *testing.T) { libs: ["foo"], sdk_version: "test_current", } java_library { name: "baz-29", srcs: ["c.java"], libs: ["foo"], sdk_version: "system_29", } `) // check the existence of the internal modules Loading Loading @@ -1138,6 +1144,13 @@ func TestJavaSdkLibrary(t *testing.T) { "foo.stubs.test.jar") } baz29Javac := ctx.ModuleForTests("baz-29", "android_common").Rule("javac") // tests if baz-29 is actually linked to the system 29 stubs lib if !strings.Contains(baz29Javac.Args["classpath"], "prebuilts/sdk/29/system/foo.jar") { t.Errorf("baz-29 javac classpath %v does not contain %q", baz29Javac.Args["classpath"], "prebuilts/sdk/29/system/foo.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 +3 −2 Original line number Diff line number Diff line Loading @@ -683,8 +683,9 @@ func (module *SdkLibrary) sdkJars( sdkVersion sdkSpec, headerJars bool) android.Paths { // This module is just a wrapper for the stubs. if ctx.Config().UnbundledBuildUsePrebuiltSdks() { // If a specific numeric version has been requested or the build is explicitly configured // for it then use prebuilt versions of the sdk. if sdkVersion.version.isNumbered() || ctx.Config().UnbundledBuildUsePrebuiltSdks() { return module.PrebuiltJars(ctx, sdkVersion) } else { if !sdkVersion.specified() { Loading
java/testing.go +1 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ func TestConfig(buildDir string, env map[string]string, bp string, fs map[string "prebuilts/sdk/29/public/android.jar": nil, "prebuilts/sdk/29/public/framework.aidl": nil, "prebuilts/sdk/29/system/android.jar": nil, "prebuilts/sdk/29/system/foo.jar": nil, "prebuilts/sdk/current/core/android.jar": nil, "prebuilts/sdk/current/public/android.jar": nil, "prebuilts/sdk/current/public/framework.aidl": nil, Loading