Add dex_import module type
Add a module type for importing a prebuilt jar that contains
classes.dex files.
Test: m with a prebuilt jar that contains classes.dex files in
PRODUCT_BOOT_JARS
Test: java_test.go, dexpreopt_test.go, dexpreopt_bootjars_test.go
Bug: 124804356
Bug: 125517186
Change-Id: I496848f9dca11f758d49b1cb68168cec7f8e1718
diff --git a/java/java_test.go b/java/java_test.go
index 952da11..35dd696 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -79,6 +79,7 @@
ctx.RegisterModuleType("java_system_modules", android.ModuleFactoryAdaptor(SystemModulesFactory))
ctx.RegisterModuleType("java_genrule", android.ModuleFactoryAdaptor(genRuleFactory))
ctx.RegisterModuleType("java_plugin", android.ModuleFactoryAdaptor(PluginFactory))
+ ctx.RegisterModuleType("dex_import", android.ModuleFactoryAdaptor(DexImportFactory))
ctx.RegisterModuleType("filegroup", android.ModuleFactoryAdaptor(android.FileGroupFactory))
ctx.RegisterModuleType("genrule", android.ModuleFactoryAdaptor(genrule.GenRuleFactory))
ctx.RegisterModuleType("droiddoc", android.ModuleFactoryAdaptor(DroiddocFactory))
@@ -330,6 +331,11 @@
name: "baz",
jars: ["b.jar"],
}
+
+ dex_import {
+ name: "qux",
+ jars: ["b.jar"],
+ }
`)
javac := ctx.ModuleForTests("foo", "android_common").Rule("javac")
@@ -344,6 +350,8 @@
if len(combineJar.Inputs) != 2 || combineJar.Inputs[1].String() != bazJar.String() {
t.Errorf("foo combineJar inputs %v does not contain %q", combineJar.Inputs, bazJar.String())
}
+
+ ctx.ModuleForTests("qux", "android_common").Rule("Cp")
}
func TestDefaults(t *testing.T) {