summaryrefslogtreecommitdiff
path: root/java/java_test.go
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2020-09-30 15:17:25 +0100
committerAnton Hansson <hansson@google.com>2021-03-04 08:11:48 +0000
commit5a6cfa060b81a50dbf9acdc32f99413655518bd8 (patch)
tree19e956694525135776b31e8d731f3611a2f9354d /java/java_test.go
parentf17a64cd602ae6f18d0aff76ca56f8493db74dee (diff)
Add support for using sdk_version: "module_<ver>"
Fixes a panic when trying to build something with sdk_version: "module_30". Change-Id: I5b625eee45130cc288e3082d05fe45c9d006d0b6 Test: m nothing Merged-In: I9b2ce50957f59e2bead335ffa58888e15cda1f78
Diffstat (limited to 'java/java_test.go')
-rw-r--r--java/java_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/java/java_test.go b/java/java_test.go
index fc8dd7ecb..c93dddee2 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -1303,6 +1303,12 @@ func TestJavaSdkLibrary(t *testing.T) {
libs: ["foo"],
sdk_version: "system_29",
}
+ java_library {
+ name: "baz-module-30",
+ srcs: ["c.java"],
+ libs: ["foo"],
+ sdk_version: "module_30",
+ }
`)
// check the existence of the internal modules
@@ -1349,6 +1355,13 @@ func TestJavaSdkLibrary(t *testing.T) {
"prebuilts/sdk/29/system/foo.jar")
}
+ bazModule30Javac := ctx.ModuleForTests("baz-module-30", "android_common").Rule("javac")
+ // tests if "baz-module-30" is actually linked to the module 30 stubs lib
+ if !strings.Contains(bazModule30Javac.Args["classpath"], "prebuilts/sdk/30/module-lib/foo.jar") {
+ t.Errorf("baz-module-30 javac classpath %v does not contain %q", bazModule30Javac.Args["classpath"],
+ "prebuilts/sdk/30/module-lib/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 {