Merge "dex_import can be added to apex" into rvc-dev

This commit is contained in:
Anton Hansson
2020-06-05 10:05:50 +00:00
committed by Android (Google) Code Review
3 changed files with 25 additions and 13 deletions

View File

@@ -291,7 +291,10 @@ func TestBasicApex(t *testing.T) {
binaries: ["foo",],
}
},
java_libs: ["myjar"],
java_libs: [
"myjar",
"myjar_dex",
],
}
apex {
@@ -400,6 +403,15 @@ func TestBasicApex(t *testing.T) {
],
}
dex_import {
name: "myjar_dex",
jars: ["prebuilt.jar"],
apex_available: [
"//apex_available:platform",
"myapex",
],
}
java_library {
name: "myotherjar",
srcs: ["foo/bar/MyClass.java"],
@@ -435,6 +447,7 @@ func TestBasicApex(t *testing.T) {
// Ensure that apex variant is created for the direct dep
ensureListContains(t, ctx.ModuleVariantsForTests("mylib"), "android_arm64_armv8-a_shared_myapex")
ensureListContains(t, ctx.ModuleVariantsForTests("myjar"), "android_common_myapex")
ensureListContains(t, ctx.ModuleVariantsForTests("myjar_dex"), "android_common_myapex")
// Ensure that apex variant is created for the indirect dep
ensureListContains(t, ctx.ModuleVariantsForTests("mylib2"), "android_arm64_armv8-a_shared_myapex")
@@ -444,6 +457,7 @@ func TestBasicApex(t *testing.T) {
ensureContains(t, copyCmds, "image.apex/lib64/mylib.so")
ensureContains(t, copyCmds, "image.apex/lib64/mylib2.so")
ensureContains(t, copyCmds, "image.apex/javalib/myjar_stem.jar")
ensureContains(t, copyCmds, "image.apex/javalib/myjar_dex.jar")
// .. but not for java libs
ensureNotContains(t, copyCmds, "image.apex/javalib/myotherjar.jar")
ensureNotContains(t, copyCmds, "image.apex/javalib/msharedjar.jar")