Add exclude_* properties to apex arch-specific properties

The libcronet prebuilt JNI library doesn't exist for riscv64 yet.
Add exclude_* properties to apex arch-specific properties so that
the libcronet dependency can be excluded from the apex that contains
when the arch is riscv64 until it exists for riscv64.

Test: TestApexWithArch
Change-Id: Ic395a077824f0f60b90178530fbfae8a96b3782f
This commit is contained in:
Colin Cross
2022-11-02 13:14:20 -07:00
parent 1265bfdfbd
commit 70572ed01e
2 changed files with 79 additions and 24 deletions

View File

@@ -4399,12 +4399,15 @@ func TestApexWithArch(t *testing.T) {
name: "myapex",
key: "myapex.key",
updatable: false,
native_shared_libs: ["mylib.generic"],
arch: {
arm64: {
native_shared_libs: ["mylib.arm64"],
exclude_native_shared_libs: ["mylib.generic"],
},
x86_64: {
native_shared_libs: ["mylib.x64"],
exclude_native_shared_libs: ["mylib.generic"],
},
}
}
@@ -4415,6 +4418,18 @@ func TestApexWithArch(t *testing.T) {
private_key: "testkey.pem",
}
cc_library {
name: "mylib.generic",
srcs: ["mylib.cpp"],
system_shared_libs: [],
stl: "none",
// TODO: remove //apex_available:platform
apex_available: [
"//apex_available:platform",
"myapex",
],
}
cc_library {
name: "mylib.arm64",
srcs: ["mylib.cpp"],
@@ -4445,6 +4460,7 @@ func TestApexWithArch(t *testing.T) {
// Ensure that apex variant is created for the direct dep
ensureListContains(t, ctx.ModuleVariantsForTests("mylib.arm64"), "android_arm64_armv8-a_shared_apex10000")
ensureListNotContains(t, ctx.ModuleVariantsForTests("mylib.generic"), "android_arm64_armv8-a_shared_apex10000")
ensureListNotContains(t, ctx.ModuleVariantsForTests("mylib.x64"), "android_arm64_armv8-a_shared_apex10000")
// Ensure that both direct and indirect deps are copied into apex