Add support for using sdk_version: "module_<ver>"
Fixes a panic when trying to build something with sdk_version: "module_30". Test: m nothing Change-Id: I9b2ce50957f59e2bead335ffa58888e15cda1f78
This commit is contained in:
@@ -1487,6 +1487,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
|
||||
@@ -1533,6 +1539,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 {
|
||||
|
Reference in New Issue
Block a user