Add support for cc_binary in module_exports

Bug: 142920869
Test: m nothing
Change-Id: Ib7e16cb323806782c2186e73e13642e4485fc149
This commit is contained in:
Paul Duffin
2020-01-16 11:47:25 +00:00
parent 7c9662a8e9
commit 25ce04bd3a
4 changed files with 211 additions and 0 deletions

View File

@@ -337,6 +337,68 @@ arm64/include/Arm64Test.h -> arm64/include/arm64/include/Arm64Test.h
)
}
func TestSnapshotWithCcBinary(t *testing.T) {
result := testSdkWithCc(t, `
module_exports {
name: "mymodule_exports",
native_binaries: ["mynativebinary"],
}
cc_binary {
name: "mynativebinary",
srcs: [
"Test.cpp",
],
compile_multilib: "both",
system_shared_libs: [],
stl: "none",
}
`)
result.CheckSnapshot("mymodule_exports", "android_common", "",
checkAndroidBpContents(`
// This is auto-generated. DO NOT EDIT.
cc_prebuilt_binary {
name: "mymodule_exports_mynativebinary@current",
sdk_member_name: "mynativebinary",
compile_multilib: "both",
arch: {
arm64: {
srcs: ["arm64/bin/mynativebinary"],
},
arm: {
srcs: ["arm/bin/mynativebinary"],
},
},
}
cc_prebuilt_binary {
name: "mynativebinary",
prefer: false,
compile_multilib: "both",
arch: {
arm64: {
srcs: ["arm64/bin/mynativebinary"],
},
arm: {
srcs: ["arm/bin/mynativebinary"],
},
},
}
module_exports_snapshot {
name: "mymodule_exports@current",
native_binaries: ["mymodule_exports_mynativebinary@current"],
}
`),
checkAllCopyRules(`
.intermediates/mynativebinary/android_arm64_armv8-a/mynativebinary -> arm64/bin/mynativebinary
.intermediates/mynativebinary/android_arm_armv7-a-neon/mynativebinary -> arm/bin/mynativebinary
`),
)
}
func TestSnapshotWithCcSharedLibrary(t *testing.T) {
result := testSdkWithCc(t, `
sdk {