Rename java_prebuilt_library to java_import
And make it work like bazel's java_import, using a "jars" property
instead of "srcs", and allowing multiple jars to be listed.
Test: soong tests
Change-Id: Ida2ace6412bd77b4feb423646000a1401004e0ea
diff --git a/java/java_test.go b/java/java_test.go
index de3be49..eb116c9 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -55,7 +55,7 @@
ctx := android.NewTestContext()
ctx.RegisterModuleType("android_app", android.ModuleFactoryAdaptor(AndroidAppFactory))
ctx.RegisterModuleType("java_library", android.ModuleFactoryAdaptor(LibraryFactory))
- ctx.RegisterModuleType("java_prebuilt_library", android.ModuleFactoryAdaptor(PrebuiltFactory))
+ ctx.RegisterModuleType("java_import", android.ModuleFactoryAdaptor(ImportFactory))
ctx.RegisterModuleType("java_defaults", android.ModuleFactoryAdaptor(defaultsFactory))
ctx.PreArchMutators(android.RegisterPrebuiltsPreArchMutators)
ctx.PreArchMutators(android.RegisterPrebuiltsPostDepsMutators)
@@ -209,14 +209,14 @@
static_libs: ["baz"],
}
- java_prebuilt_library {
+ java_import {
name: "bar",
- srcs: ["a.jar"],
+ jars: ["a.jar"],
}
- java_prebuilt_library {
+ java_import {
name: "baz",
- srcs: ["b.jar"],
+ jars: ["b.jar"],
}
`)
@@ -228,7 +228,7 @@
t.Errorf("foo classpath %v does not contain %q", javac.Args["classpath"], bar)
}
- baz := filepath.Join(buildDir, ".intermediates", "baz", "extracted", "classes.list")
+ baz := filepath.Join(buildDir, ".intermediates", "baz", "extracted0", "classes.list")
if !strings.Contains(jar.Args["jarArgs"], baz) {
t.Errorf("foo jarArgs %v does not contain %q", jar.Args["jarArgs"], baz)
}