Merge "VNDK APEX: skips VNDK-Ext"
This commit is contained in:
@@ -3368,6 +3368,37 @@ func ensureExactContents(t *testing.T, ctx *android.TestContext, moduleName, var
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestVndkApexCurrent(t *testing.T) {
|
func TestVndkApexCurrent(t *testing.T) {
|
||||||
|
commonFiles := []string{
|
||||||
|
"lib/libc++.so",
|
||||||
|
"lib64/libc++.so",
|
||||||
|
"etc/llndk.libraries.29.txt",
|
||||||
|
"etc/vndkcore.libraries.29.txt",
|
||||||
|
"etc/vndksp.libraries.29.txt",
|
||||||
|
"etc/vndkprivate.libraries.29.txt",
|
||||||
|
"etc/vndkproduct.libraries.29.txt",
|
||||||
|
}
|
||||||
|
testCases := []struct {
|
||||||
|
vndkVersion string
|
||||||
|
expectedFiles []string
|
||||||
|
}{
|
||||||
|
{
|
||||||
|
vndkVersion: "current",
|
||||||
|
expectedFiles: append(commonFiles,
|
||||||
|
"lib/libvndk.so",
|
||||||
|
"lib/libvndksp.so",
|
||||||
|
"lib64/libvndk.so",
|
||||||
|
"lib64/libvndksp.so"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
vndkVersion: "",
|
||||||
|
expectedFiles: append(commonFiles,
|
||||||
|
// Legacy VNDK APEX contains only VNDK-SP files (of core variant)
|
||||||
|
"lib/libvndksp.so",
|
||||||
|
"lib64/libvndksp.so"),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
for _, tc := range testCases {
|
||||||
|
t.Run("VNDK.current with DeviceVndkVersion="+tc.vndkVersion, func(t *testing.T) {
|
||||||
ctx := testApex(t, `
|
ctx := testApex(t, `
|
||||||
apex_vndk {
|
apex_vndk {
|
||||||
name: "com.android.vndk.current",
|
name: "com.android.vndk.current",
|
||||||
@@ -3407,21 +3438,39 @@ func TestVndkApexCurrent(t *testing.T) {
|
|||||||
stl: "none",
|
stl: "none",
|
||||||
apex_available: [ "com.android.vndk.current" ],
|
apex_available: [ "com.android.vndk.current" ],
|
||||||
}
|
}
|
||||||
`+vndkLibrariesTxtFiles("current"))
|
|
||||||
|
|
||||||
ensureExactContents(t, ctx, "com.android.vndk.current", "android_common_image", []string{
|
// VNDK-Ext should not cause any problems
|
||||||
"lib/libvndk.so",
|
|
||||||
"lib/libvndksp.so",
|
cc_library {
|
||||||
"lib/libc++.so",
|
name: "libvndk.ext",
|
||||||
"lib64/libvndk.so",
|
srcs: ["mylib2.cpp"],
|
||||||
"lib64/libvndksp.so",
|
vendor: true,
|
||||||
"lib64/libc++.so",
|
vndk: {
|
||||||
"etc/llndk.libraries.29.txt",
|
enabled: true,
|
||||||
"etc/vndkcore.libraries.29.txt",
|
extends: "libvndk",
|
||||||
"etc/vndksp.libraries.29.txt",
|
},
|
||||||
"etc/vndkprivate.libraries.29.txt",
|
system_shared_libs: [],
|
||||||
"etc/vndkproduct.libraries.29.txt",
|
stl: "none",
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_library {
|
||||||
|
name: "libvndksp.ext",
|
||||||
|
srcs: ["mylib2.cpp"],
|
||||||
|
vendor: true,
|
||||||
|
vndk: {
|
||||||
|
enabled: true,
|
||||||
|
support_system_process: true,
|
||||||
|
extends: "libvndksp",
|
||||||
|
},
|
||||||
|
system_shared_libs: [],
|
||||||
|
stl: "none",
|
||||||
|
}
|
||||||
|
`+vndkLibrariesTxtFiles("current"), android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||||
|
variables.DeviceVndkVersion = proptools.StringPtr(tc.vndkVersion)
|
||||||
|
}))
|
||||||
|
ensureExactContents(t, ctx, "com.android.vndk.current", "android_common_image", tc.expectedFiles)
|
||||||
})
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestVndkApexWithPrebuilt(t *testing.T) {
|
func TestVndkApexWithPrebuilt(t *testing.T) {
|
||||||
|
@@ -371,7 +371,7 @@ func IsForVndkApex(mctx android.BottomUpMutatorContext, m *Module) bool {
|
|||||||
if mctx.ModuleName() == "libz" {
|
if mctx.ModuleName() == "libz" {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return m.ImageVariation().Variation == android.CoreVariation && lib.shared() && m.IsVndkSp()
|
return m.ImageVariation().Variation == android.CoreVariation && lib.shared() && m.IsVndkSp() && !m.IsVndkExt()
|
||||||
}
|
}
|
||||||
|
|
||||||
useCoreVariant := m.VndkVersion() == mctx.DeviceConfig().PlatformVndkVersion() &&
|
useCoreVariant := m.VndkVersion() == mctx.DeviceConfig().PlatformVndkVersion() &&
|
||||||
|
Reference in New Issue
Block a user