Merge "Add apex.use_vndk_as_stable property"

This commit is contained in:
Treehugger Robot
2020-07-29 01:27:46 +00:00
committed by Gerrit Code Review
2 changed files with 78 additions and 2 deletions

View File

@@ -2203,6 +2203,55 @@ func TestVendorApex(t *testing.T) {
ensureContains(t, androidMk, `LOCAL_MODULE_PATH := /tmp/target/product/test_device/vendor/apex`)
}
func TestVendorApex_use_vndk_as_stable(t *testing.T) {
ctx, _ := testApex(t, `
apex {
name: "myapex",
key: "myapex.key",
binaries: ["mybin"],
vendor: true,
use_vndk_as_stable: true,
}
apex_key {
name: "myapex.key",
public_key: "testkey.avbpubkey",
private_key: "testkey.pem",
}
cc_binary {
name: "mybin",
vendor: true,
shared_libs: ["libvndk", "libvendor"],
}
cc_library {
name: "libvndk",
vndk: {
enabled: true,
},
vendor_available: true,
}
cc_library {
name: "libvendor",
vendor: true,
}
`)
vendorVariant := "android_vendor.VER_arm64_armv8-a"
ldRule := ctx.ModuleForTests("mybin", vendorVariant+"_myapex").Rule("ld")
libs := names(ldRule.Args["libFlags"])
// VNDK libs(libvndk/libc++) as they are
ensureListContains(t, libs, buildDir+"/.intermediates/libvndk/"+vendorVariant+"_shared/libvndk.so")
ensureListContains(t, libs, buildDir+"/.intermediates/libc++/"+vendorVariant+"_shared/libc++.so")
// non-stable Vendor libs as APEX variants
ensureListContains(t, libs, buildDir+"/.intermediates/libvendor/"+vendorVariant+"_shared_myapex/libvendor.so")
// VNDK libs are not included when use_vndk_as_stable: true
ensureExactContents(t, ctx, "myapex", "android_common_myapex_image", []string{
"bin/mybin",
"lib64/libvendor.so",
})
}
func TestAndroidMk_UseVendorRequired(t *testing.T) {
ctx, config := testApex(t, `
apex {