|
@@ -1146,6 +1146,76 @@ apex {
|
|
|
}})
|
|
|
}
|
|
|
|
|
|
+func TestApexWithStubLib(t *testing.T) {
|
|
|
+ runApexTestCase(t, Bp2buildTestCase{
|
|
|
+ Description: "apex - static variant of stub lib should not have apex_available tag",
|
|
|
+ ModuleTypeUnderTest: "apex",
|
|
|
+ ModuleTypeUnderTestFactory: apex.BundleFactory,
|
|
|
+ Filesystem: map[string]string{},
|
|
|
+ Blueprint: `
|
|
|
+cc_library{
|
|
|
+ name: "foo",
|
|
|
+ stubs: { symbol_file: "foo.map.txt", versions: ["28", "29", "current"] },
|
|
|
+ apex_available: ["myapex"],
|
|
|
+}
|
|
|
+
|
|
|
+cc_binary{
|
|
|
+ name: "bar",
|
|
|
+ static_libs: ["foo"],
|
|
|
+ apex_available: ["myapex"],
|
|
|
+}
|
|
|
+
|
|
|
+apex {
|
|
|
+ name: "myapex",
|
|
|
+ manifest: "myapex_manifest.json",
|
|
|
+ file_contexts: ":myapex-file_contexts",
|
|
|
+ binaries: ["bar"],
|
|
|
+ native_shared_libs: ["foo"],
|
|
|
+}
|
|
|
+` + simpleModuleDoNotConvertBp2build("filegroup", "myapex-file_contexts"),
|
|
|
+ ExpectedBazelTargets: []string{
|
|
|
+ MakeBazelTarget("cc_binary", "bar", AttrNameToString{
|
|
|
+ "local_includes": `["."]`,
|
|
|
+ "deps": `[":foo_bp2build_cc_library_static"]`,
|
|
|
+ "tags": `["apex_available=myapex"]`,
|
|
|
+ }),
|
|
|
+ MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
|
|
|
+ "local_includes": `["."]`,
|
|
|
+ }),
|
|
|
+ MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
|
|
|
+ "local_includes": `["."]`,
|
|
|
+ "stubs_symbol_file": `"foo.map.txt"`,
|
|
|
+ "tags": `["apex_available=myapex"]`,
|
|
|
+ }),
|
|
|
+ MakeBazelTarget("cc_stub_suite", "foo_stub_libs", AttrNameToString{
|
|
|
+ "soname": `"foo.so"`,
|
|
|
+ "source_library": `":foo"`,
|
|
|
+ "symbol_file": `"foo.map.txt"`,
|
|
|
+ "versions": `[
|
|
|
+ "28",
|
|
|
+ "29",
|
|
|
+ "current",
|
|
|
+ ]`,
|
|
|
+ }),
|
|
|
+ MakeBazelTarget("apex", "myapex", AttrNameToString{
|
|
|
+ "file_contexts": `":myapex-file_contexts"`,
|
|
|
+ "manifest": `"myapex_manifest.json"`,
|
|
|
+ "binaries": `[":bar"]`,
|
|
|
+ "native_shared_libs_32": `select({
|
|
|
+ "//build/bazel/platforms/arch:arm": [":foo"],
|
|
|
+ "//build/bazel/platforms/arch:x86": [":foo"],
|
|
|
+ "//conditions:default": [],
|
|
|
+ })`,
|
|
|
+ "native_shared_libs_64": `select({
|
|
|
+ "//build/bazel/platforms/arch:arm64": [":foo"],
|
|
|
+ "//build/bazel/platforms/arch:x86_64": [":foo"],
|
|
|
+ "//conditions:default": [],
|
|
|
+ })`,
|
|
|
+ }),
|
|
|
+ },
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
func TestApexCertificateIsSrc(t *testing.T) {
|
|
|
runApexTestCase(t, Bp2buildTestCase{
|
|
|
Description: "apex - certificate is src",
|