Revert "Split Java libraries per apex"

This reverts commit aa53324ac8.

Reason for revert: b/138337109 (broke ndk build)

Change-Id: I9497cb4337add3f8c491a684bcaadea3bdbfaa85
This commit is contained in:
Jiyong Park
2019-07-25 04:38:02 +00:00
parent aa53324ac8
commit f0f7ca8335
4 changed files with 3 additions and 63 deletions

View File

@@ -91,8 +91,6 @@ func testApexContext(t *testing.T, bp string) (*android.TestContext, android.Con
ctx.RegisterModuleType("sh_binary", android.ModuleFactoryAdaptor(android.ShBinaryFactory))
ctx.RegisterModuleType("android_app_certificate", android.ModuleFactoryAdaptor(java.AndroidAppCertificateFactory))
ctx.RegisterModuleType("filegroup", android.ModuleFactoryAdaptor(android.FileGroupFactory))
ctx.RegisterModuleType("java_library", android.ModuleFactoryAdaptor(java.LibraryFactory))
ctx.PreArchMutators(func(ctx android.RegisterMutatorsContext) {
ctx.BottomUp("prebuilts", android.PrebuiltMutator).Parallel()
})
@@ -207,7 +205,6 @@ func testApexContext(t *testing.T, bp string) (*android.TestContext, android.Con
"mytest3.cpp": nil,
"myprebuilt": nil,
"my_include": nil,
"foo/bar/MyClass.java": nil,
"vendor/foo/devkeys/test.x509.pem": nil,
"vendor/foo/devkeys/test.pk8": nil,
"testkey.x509.pem": nil,
@@ -283,8 +280,7 @@ func TestBasicApex(t *testing.T) {
both: {
binaries: ["foo",],
}
},
java_libs: ["myjar"],
}
}
apex {
@@ -342,23 +338,6 @@ func TestBasicApex(t *testing.T) {
stl: "none",
notice: "custom_notice",
}
java_library {
name: "myjar",
srcs: ["foo/bar/MyClass.java"],
sdk_version: "none",
system_modules: "none",
compile_dex: true,
static_libs: ["myotherjar"],
}
java_library {
name: "myotherjar",
srcs: ["foo/bar/MyClass.java"],
sdk_version: "none",
system_modules: "none",
compile_dex: true,
}
`)
apexRule := ctx.ModuleForTests("myapex", "android_common_myapex").Rule("apexRule")
@@ -375,24 +354,17 @@ func TestBasicApex(t *testing.T) {
// Ensure that apex variant is created for the direct dep
ensureListContains(t, ctx.ModuleVariantsForTests("mylib"), "android_arm64_armv8-a_core_shared_myapex")
ensureListContains(t, ctx.ModuleVariantsForTests("myjar"), "android_common_myapex")
// Ensure that apex variant is created for the indirect dep
ensureListContains(t, ctx.ModuleVariantsForTests("mylib2"), "android_arm64_armv8-a_core_shared_myapex")
ensureListContains(t, ctx.ModuleVariantsForTests("myotherjar"), "android_common_myapex")
// Ensure that both direct and indirect deps are copied into apex
ensureContains(t, copyCmds, "image.apex/lib64/mylib.so")
ensureContains(t, copyCmds, "image.apex/lib64/mylib2.so")
ensureContains(t, copyCmds, "image.apex/javalib/myjar.jar")
// .. but not for java libs
ensureNotContains(t, copyCmds, "image.apex/javalib/myotherjar.jar")
// Ensure that the platform variant ends with _core_shared or _common
// Ensure that the platform variant ends with _core_shared
ensureListContains(t, ctx.ModuleVariantsForTests("mylib"), "android_arm64_armv8-a_core_shared")
ensureListContains(t, ctx.ModuleVariantsForTests("mylib2"), "android_arm64_armv8-a_core_shared")
ensureListContains(t, ctx.ModuleVariantsForTests("myjar"), "android_common")
ensureListContains(t, ctx.ModuleVariantsForTests("myotherjar"), "android_common")
// Ensure that all symlinks are present.
found_foo_link_64 := false