Exporting MakeBazelTarget() in testing.go

Since we are putting conversion tests in the same
package as the module being converted from now on

Test: m bp2build
Change-Id: Ied53589d497fef70bfa11d8f6067459c9a50cd72
This commit is contained in:
Alix 2022-08-31 18:28:19 +00:00 committed by Alix Espino
parent bf9c26c364
commit e06d75be5d
25 changed files with 288 additions and 288 deletions

View file

@ -53,7 +53,7 @@ android_library {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget(
MakeBazelTarget(
"android_library",
"TestLib",
AttrNameToString{
@ -120,7 +120,7 @@ android_library_import {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget(
MakeBazelTarget(
"aar_import",
"TestImport",
AttrNameToString{

View file

@ -47,7 +47,7 @@ android_app {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("android_binary", "TestApp", AttrNameToString{
MakeBazelTarget("android_binary", "TestApp", AttrNameToString{
"srcs": `["app.java"]`,
"manifest": `"AndroidManifest.xml"`,
"resource_files": `["res/res.png"]`,
@ -79,7 +79,7 @@ android_app {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("android_binary", "TestApp", AttrNameToString{
MakeBazelTarget("android_binary", "TestApp", AttrNameToString{
"srcs": `["app.java"]`,
"manifest": `"manifest/AndroidManifest.xml"`,
"resource_files": `[
@ -119,7 +119,7 @@ android_app {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("android_binary", "TestApp", AttrNameToString{
MakeBazelTarget("android_binary", "TestApp", AttrNameToString{
"srcs": `select({
"//build/bazel/platforms/arch:arm": ["arm.java"],
"//build/bazel/platforms/arch:x86": ["x86.java"],

View file

@ -141,7 +141,7 @@ apex {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("apex", "com.android.apogee", AttrNameToString{
MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{
"android_manifest": `"ApogeeAndroidManifest.xml"`,
"binaries": `[
":cc_binary_1",
@ -203,7 +203,7 @@ apex {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("apex", "com.android.apogee", AttrNameToString{
MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{
"file_contexts": `"//a/b:com.android.apogee-file_contexts"`,
"manifest": `"apex_manifest.json"`,
}),
@ -223,7 +223,7 @@ apex {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("apex", "com.android.apogee", AttrNameToString{
MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{
"file_contexts": `"file_contexts_file"`,
"manifest": `"apex_manifest.json"`,
}),
@ -252,7 +252,7 @@ apex {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("apex", "com.android.apogee", AttrNameToString{
MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{
"file_contexts": `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
"manifest": `"apex_manifest.json"`,
}),
@ -275,7 +275,7 @@ filegroup {
},
Blueprint: createMultilibBlueprint("both"),
ExpectedBazelTargets: []string{
makeBazelTarget("apex", "com.android.apogee", AttrNameToString{
MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{
"native_shared_libs_32": `[
":native_shared_lib_1",
":native_shared_lib_3",
@ -319,7 +319,7 @@ filegroup {
},
Blueprint: createMultilibBlueprint("first"),
ExpectedBazelTargets: []string{
makeBazelTarget("apex", "com.android.apogee", AttrNameToString{
MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{
"native_shared_libs_32": `select({
"//build/bazel/platforms/arch:arm": [
":native_shared_lib_1",
@ -368,7 +368,7 @@ filegroup {
},
Blueprint: createMultilibBlueprint("32"),
ExpectedBazelTargets: []string{
makeBazelTarget("apex", "com.android.apogee", AttrNameToString{
MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{
"native_shared_libs_32": `[
":native_shared_lib_1",
":native_shared_lib_3",
@ -399,7 +399,7 @@ filegroup {
},
Blueprint: createMultilibBlueprint("64"),
ExpectedBazelTargets: []string{
makeBazelTarget("apex", "com.android.apogee", AttrNameToString{
MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{
"native_shared_libs_64": `select({
"//build/bazel/platforms/arch:arm64": [
":native_shared_lib_1",
@ -439,7 +439,7 @@ apex {
manifest: "apogee_manifest.json",
}
`,
ExpectedBazelTargets: []string{makeBazelTarget("apex", "com.android.apogee", AttrNameToString{
ExpectedBazelTargets: []string{MakeBazelTarget("apex", "com.android.apogee", AttrNameToString{
"manifest": `"apogee_manifest.json"`,
"file_contexts": `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
}),
@ -467,7 +467,7 @@ apex {
bazel_module: { bp2build_available: true },
}
`,
ExpectedBazelTargets: []string{makeBazelTarget("apex", "apogee", AttrNameToString{
ExpectedBazelTargets: []string{MakeBazelTarget("apex", "apogee", AttrNameToString{
"manifest": `"manifest.json"`,
"file_contexts": `"//system/sepolicy/apex:apogee-file_contexts"`,
}),
@ -624,7 +624,7 @@ override_apex {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
"android_manifest": `"ApogeeAndroidManifest.xml"`,
"binaries": `[
":cc_binary_1",
@ -684,7 +684,7 @@ override_apex {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
"file_contexts": `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
"manifest": `"//a/b:apex_manifest.json"`,
}),
@ -718,7 +718,7 @@ override_apex {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
"file_contexts": `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
"manifest": `"//a/b:apogee_manifest.json"`,
}),
@ -750,7 +750,7 @@ override_apex {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
"file_contexts": `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
"manifest": `"apex_manifest.json"`,
}),
@ -783,7 +783,7 @@ override_apex {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
"file_contexts": `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
"manifest": `"apogee_manifest.json"`,
}),
@ -816,7 +816,7 @@ override_apex {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
"file_contexts": `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
"manifest": `"apex_manifest.json"`,
"package_name": `"com.google.android.apogee"`,
@ -855,7 +855,7 @@ override_apex {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
"file_contexts": `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
"manifest": `"apex_manifest.json"`,
"prebuilts": `[":prebuilt_file"]`,
@ -900,7 +900,7 @@ override_apex {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
"file_contexts": `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
"manifest": `"apex_manifest.json"`,
"prebuilts": `[":prebuilt_file2"]`,
@ -940,7 +940,7 @@ override_apex {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
"file_contexts": `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
"manifest": `"apex_manifest.json"`,
"prebuilts": `[]`,
@ -974,7 +974,7 @@ override_apex {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
"file_contexts": `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
"manifest": `"apex_manifest.json"`,
"logging_parent": `"foo.bar.baz"`,
@ -1009,7 +1009,7 @@ override_apex {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
MakeBazelTarget("apex", "com.google.android.apogee", AttrNameToString{
"file_contexts": `"//system/sepolicy/apex:com.android.apogee-file_contexts"`,
"manifest": `"apex_manifest.json"`,
"logging_parent": `"foo.bar.baz.override"`,

View file

@ -238,7 +238,7 @@ func TestGenerateBazelTargetModules(t *testing.T) {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("custom", "foo", AttrNameToString{
MakeBazelTarget("custom", "foo", AttrNameToString{
"string_literal_prop": `""`,
}),
},
@ -251,7 +251,7 @@ func TestGenerateBazelTargetModules(t *testing.T) {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("custom", "foo", AttrNameToString{
MakeBazelTarget("custom", "foo", AttrNameToString{
"string_literal_prop": `"PROP"`,
}),
},
@ -267,7 +267,7 @@ func TestGenerateBazelTargetModules(t *testing.T) {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("custom", "foo", AttrNameToString{
MakeBazelTarget("custom", "foo", AttrNameToString{
"string_literal_prop": `select({
"//build/bazel/platforms/arch:arm": "ARM",
"//build/bazel/platforms/arch:arm64": "ARM64",
@ -284,7 +284,7 @@ func TestGenerateBazelTargetModules(t *testing.T) {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("custom", "foo", AttrNameToString{
MakeBazelTarget("custom", "foo", AttrNameToString{
"string_ptr_prop": `""`,
}),
},
@ -298,7 +298,7 @@ func TestGenerateBazelTargetModules(t *testing.T) {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("custom", "foo", AttrNameToString{
MakeBazelTarget("custom", "foo", AttrNameToString{
"string_list_prop": `[
"a",
"b",
@ -316,7 +316,7 @@ func TestGenerateBazelTargetModules(t *testing.T) {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("custom", "foo", AttrNameToString{
MakeBazelTarget("custom", "foo", AttrNameToString{
"string_list_prop": `[
"\t",
"\n",
@ -339,10 +339,10 @@ custom {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("custom", "dep", AttrNameToString{
MakeBazelTarget("custom", "dep", AttrNameToString{
"arch_paths": `["abc"]`,
}),
makeBazelTarget("custom", "has_dep", AttrNameToString{
MakeBazelTarget("custom", "has_dep", AttrNameToString{
"arch_paths": `[":dep"]`,
}),
},
@ -355,7 +355,7 @@ custom {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("custom", "has_dep", AttrNameToString{
MakeBazelTarget("custom", "has_dep", AttrNameToString{
"arch_paths": `[":dep__BP2BUILD__MISSING__DEP"]`,
}),
},
@ -391,7 +391,7 @@ custom {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("custom", "arch_paths", AttrNameToString{
MakeBazelTarget("custom", "arch_paths", AttrNameToString{
"arch_paths": `select({
"//build/bazel/platforms/arch:arm": [
"arm.txt",
@ -469,10 +469,10 @@ custom {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("custom", "dep", AttrNameToString{
MakeBazelTarget("custom", "dep", AttrNameToString{
"arch_paths": `["abc"]`,
}),
makeBazelTarget("custom", "has_dep", AttrNameToString{
MakeBazelTarget("custom", "has_dep", AttrNameToString{
"arch_paths": `select({
"//build/bazel/platforms/arch:x86": [":dep"],
"//conditions:default": [],
@ -488,7 +488,7 @@ custom {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("custom", "embedded_props", AttrNameToString{
MakeBazelTarget("custom", "embedded_props", AttrNameToString{
"embedded_attr": `"abc"`,
}),
},
@ -501,7 +501,7 @@ custom {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("custom", "ptr_to_embedded_props", AttrNameToString{
MakeBazelTarget("custom", "ptr_to_embedded_props", AttrNameToString{
"other_embedded_attr": `"abc"`,
}),
},
@ -1536,7 +1536,7 @@ python_library {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("py_library", "fg_foo", map[string]string{
MakeBazelTarget("py_library", "fg_foo", map[string]string{
"data": `select({
"//build/bazel/platforms/arch:arm": [":reqdarm"],
"//build/bazel/platforms/arch:x86": [":reqdx86"],
@ -1563,7 +1563,7 @@ python_library {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("py_library", "fg_foo", map[string]string{
MakeBazelTarget("py_library", "fg_foo", map[string]string{
"data": `[
"data.bin",
":reqd",

View file

@ -355,7 +355,7 @@ cc_library {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "a_bp2build_cc_library_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "a_bp2build_cc_library_static", AttrNameToString{
"copts": `[
"bothflag",
"staticflag",
@ -377,7 +377,7 @@ cc_library {
":whole_and_static_lib_for_both",
":whole_static_lib_for_static",
]`}),
makeBazelTarget("cc_library_shared", "a", AttrNameToString{
MakeBazelTarget("cc_library_shared", "a", AttrNameToString{
"copts": `[
"bothflag",
"sharedflag",
@ -463,7 +463,7 @@ cc_library {
simpleModuleDoNotConvertBp2build("cc_library", "shared_dep_for_both") +
simpleModuleDoNotConvertBp2build("cc_library", "implementation_shared_dep_for_both"),
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "a_bp2build_cc_library_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "a_bp2build_cc_library_static", AttrNameToString{
"copts": `[
"bothflag",
"staticflag",
@ -495,7 +495,7 @@ cc_library {
":whole_static_dep_for_static",
]`,
}),
makeBazelTarget("cc_library_shared", "a", AttrNameToString{
MakeBazelTarget("cc_library_shared", "a", AttrNameToString{
"copts": `[
"bothflag",
"sharedflag",
@ -560,13 +560,13 @@ cc_prebuilt_library_static { name: "whole_static_lib_for_both" }
},
Blueprint: soongCcLibraryPreamble,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "a_bp2build_cc_library_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "a_bp2build_cc_library_static", AttrNameToString{
"whole_archive_deps": `[
":whole_static_lib_for_both_alwayslink",
":whole_static_lib_for_static_alwayslink",
]`,
}),
makeBazelTarget("cc_library_shared", "a", AttrNameToString{
MakeBazelTarget("cc_library_shared", "a", AttrNameToString{
"whole_archive_deps": `[
":whole_static_lib_for_both_alwayslink",
":whole_static_lib_for_shared_alwayslink",
@ -654,7 +654,7 @@ cc_library_static { name: "android_dep_for_shared" }
},
Blueprint: soongCcLibraryPreamble,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "a_bp2build_cc_library_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "a_bp2build_cc_library_static", AttrNameToString{
"copts": `[
"bothflag",
"staticflag",
@ -678,7 +678,7 @@ cc_library_static { name: "android_dep_for_shared" }
"//conditions:default": [],
})`,
}),
makeBazelTarget("cc_library_shared", "a", AttrNameToString{
MakeBazelTarget("cc_library_shared", "a", AttrNameToString{
"copts": `[
"bothflag",
"sharedflag",
@ -807,7 +807,7 @@ filegroup {
},
Blueprint: soongCcLibraryPreamble,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "a_bp2build_cc_library_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "a_bp2build_cc_library_static", AttrNameToString{
"local_includes": `["."]`,
"srcs": `[
"both_source.cpp",
@ -832,7 +832,7 @@ filegroup {
":static_filegroup_c_srcs",
]`,
}),
makeBazelTarget("cc_library_shared", "a", AttrNameToString{
MakeBazelTarget("cc_library_shared", "a", AttrNameToString{
"local_includes": `["."]`,
"srcs": `[
"both_source.cpp",
@ -1315,8 +1315,8 @@ func makeCcLibraryTargets(name string, attrs AttrNameToString) []string {
staticAttrs[key] = val
}
}
sharedTarget := makeBazelTarget("cc_library_shared", name, sharedAttrs)
staticTarget := makeBazelTarget("cc_library_static", name+"_bp2build_cc_library_static", staticAttrs)
sharedTarget := MakeBazelTarget("cc_library_shared", name, sharedAttrs)
staticTarget := MakeBazelTarget("cc_library_static", name+"_bp2build_cc_library_static", staticAttrs)
return []string{staticTarget, sharedTarget}
}
@ -1338,7 +1338,7 @@ func makeCcStubSuiteTargets(name string, attrs AttrNameToString) string {
stubSuiteAttrs[STUB_SUITE_ATTRS[key]] = attrs[key]
}
}
return makeBazelTarget("cc_stub_suite", name+"_stub_libs", stubSuiteAttrs)
return MakeBazelTarget("cc_stub_suite", name+"_stub_libs", stubSuiteAttrs)
}
func TestCCLibraryNoLibCrtFalse(t *testing.T) {
@ -1649,10 +1649,10 @@ cc_library {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "static_empty_bp2build_cc_library_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "static_empty_bp2build_cc_library_static", AttrNameToString{
"system_dynamic_deps": "[]",
}),
makeBazelTarget("cc_library_shared", "static_empty", AttrNameToString{}),
MakeBazelTarget("cc_library_shared", "static_empty", AttrNameToString{}),
},
})
}
@ -1672,8 +1672,8 @@ cc_library {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "shared_empty_bp2build_cc_library_static", AttrNameToString{}),
makeBazelTarget("cc_library_shared", "shared_empty", AttrNameToString{
MakeBazelTarget("cc_library_static", "shared_empty_bp2build_cc_library_static", AttrNameToString{}),
MakeBazelTarget("cc_library_shared", "shared_empty", AttrNameToString{
"system_dynamic_deps": "[]",
}),
},
@ -1699,8 +1699,8 @@ cc_library {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "shared_empty_bp2build_cc_library_static", AttrNameToString{}),
makeBazelTarget("cc_library_shared", "shared_empty", AttrNameToString{
MakeBazelTarget("cc_library_static", "shared_empty_bp2build_cc_library_static", AttrNameToString{}),
MakeBazelTarget("cc_library_shared", "shared_empty", AttrNameToString{
"system_dynamic_deps": "[]",
}),
},
@ -1782,10 +1782,10 @@ cc_library {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
"system_dynamic_deps": `[":libc"]`,
}),
makeBazelTarget("cc_library_shared", "foo", AttrNameToString{
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
"system_dynamic_deps": `[
":libc",
":libm",
@ -2000,7 +2000,7 @@ cc_library_static {
}
`, name_prefix, cppStdProp, cStdProp, gnuExtensionsProp),
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", name_prefix+"_static", attrs),
MakeBazelTarget("cc_library_static", name_prefix+"_static", attrs),
},
})
@ -2019,7 +2019,7 @@ cc_library_shared {
}
`, name_prefix, cppStdProp, cStdProp, gnuExtensionsProp),
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_shared", name_prefix+"_shared", attrs),
MakeBazelTarget("cc_library_shared", name_prefix+"_shared", attrs),
},
})
})
@ -2036,14 +2036,14 @@ func TestCcLibraryProtoSimple(t *testing.T) {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("proto_library", "foo_proto", AttrNameToString{
MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
"srcs": `["foo.proto"]`,
}), makeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
}), MakeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
"deps": `[":foo_proto"]`,
}), makeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
}), MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
"implementation_whole_archive_deps": `[":foo_cc_proto_lite"]`,
"deps": `[":libprotobuf-cpp-lite"]`,
}), makeBazelTarget("cc_library_shared", "foo", AttrNameToString{
}), MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
"dynamic_deps": `[":libprotobuf-cpp-lite"]`,
}),
},
@ -2061,15 +2061,15 @@ func TestCcLibraryProtoNoCanonicalPathFromRoot(t *testing.T) {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("proto_library", "foo_proto", AttrNameToString{
MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
"srcs": `["foo.proto"]`,
"strip_import_prefix": `""`,
}), makeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
}), MakeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
"deps": `[":foo_proto"]`,
}), makeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
}), MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
"implementation_whole_archive_deps": `[":foo_cc_proto_lite"]`,
"deps": `[":libprotobuf-cpp-lite"]`,
}), makeBazelTarget("cc_library_shared", "foo", AttrNameToString{
}), MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
"dynamic_deps": `[":libprotobuf-cpp-lite"]`,
}),
},
@ -2087,14 +2087,14 @@ func TestCcLibraryProtoExplicitCanonicalPathFromRoot(t *testing.T) {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("proto_library", "foo_proto", AttrNameToString{
MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
"srcs": `["foo.proto"]`,
}), makeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
}), MakeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
"deps": `[":foo_proto"]`,
}), makeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
}), MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
"implementation_whole_archive_deps": `[":foo_cc_proto_lite"]`,
"deps": `[":libprotobuf-cpp-lite"]`,
}), makeBazelTarget("cc_library_shared", "foo", AttrNameToString{
}), MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
"dynamic_deps": `[":libprotobuf-cpp-lite"]`,
}),
},
@ -2114,14 +2114,14 @@ func TestCcLibraryProtoFull(t *testing.T) {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("proto_library", "foo_proto", AttrNameToString{
MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
"srcs": `["foo.proto"]`,
}), makeBazelTarget("cc_proto_library", "foo_cc_proto", AttrNameToString{
}), MakeBazelTarget("cc_proto_library", "foo_cc_proto", AttrNameToString{
"deps": `[":foo_proto"]`,
}), makeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
}), MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
"implementation_whole_archive_deps": `[":foo_cc_proto"]`,
"deps": `[":libprotobuf-cpp-full"]`,
}), makeBazelTarget("cc_library_shared", "foo", AttrNameToString{
}), MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
"dynamic_deps": `[":libprotobuf-cpp-full"]`,
}),
},
@ -2141,14 +2141,14 @@ func TestCcLibraryProtoLite(t *testing.T) {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("proto_library", "foo_proto", AttrNameToString{
MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
"srcs": `["foo.proto"]`,
}), makeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
}), MakeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
"deps": `[":foo_proto"]`,
}), makeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
}), MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
"implementation_whole_archive_deps": `[":foo_cc_proto_lite"]`,
"deps": `[":libprotobuf-cpp-lite"]`,
}), makeBazelTarget("cc_library_shared", "foo", AttrNameToString{
}), MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
"dynamic_deps": `[":libprotobuf-cpp-lite"]`,
}),
},
@ -2168,14 +2168,14 @@ func TestCcLibraryProtoExportHeaders(t *testing.T) {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("proto_library", "foo_proto", AttrNameToString{
MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
"srcs": `["foo.proto"]`,
}), makeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
}), MakeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
"deps": `[":foo_proto"]`,
}), makeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
}), MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
"deps": `[":libprotobuf-cpp-lite"]`,
"whole_archive_deps": `[":foo_cc_proto_lite"]`,
}), makeBazelTarget("cc_library_shared", "foo", AttrNameToString{
}), MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
"dynamic_deps": `[":libprotobuf-cpp-lite"]`,
"whole_archive_deps": `[":foo_cc_proto_lite"]`,
}),
@ -2228,65 +2228,65 @@ cc_library {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("proto_library", "a_proto", AttrNameToString{
MakeBazelTarget("proto_library", "a_proto", AttrNameToString{
"srcs": `[":a_fg_proto"]`,
}), makeBazelTarget("cc_lite_proto_library", "a_cc_proto_lite", AttrNameToString{
}), MakeBazelTarget("cc_lite_proto_library", "a_cc_proto_lite", AttrNameToString{
"deps": `[":a_proto"]`,
}), makeBazelTarget("cc_library_static", "a_bp2build_cc_library_static", AttrNameToString{
}), MakeBazelTarget("cc_library_static", "a_bp2build_cc_library_static", AttrNameToString{
"deps": `[":libprotobuf-cpp-lite"]`,
"whole_archive_deps": `[":a_cc_proto_lite"]`,
"srcs": `[":a_fg_proto_cpp_srcs"]`,
"srcs_as": `[":a_fg_proto_as_srcs"]`,
"srcs_c": `[":a_fg_proto_c_srcs"]`,
}), makeBazelTarget("cc_library_shared", "a", AttrNameToString{
}), MakeBazelTarget("cc_library_shared", "a", AttrNameToString{
"dynamic_deps": `[":libprotobuf-cpp-lite"]`,
"whole_archive_deps": `[":a_cc_proto_lite"]`,
"srcs": `[":a_fg_proto_cpp_srcs"]`,
"srcs_as": `[":a_fg_proto_as_srcs"]`,
"srcs_c": `[":a_fg_proto_c_srcs"]`,
}), makeBazelTarget("proto_library", "b_proto", AttrNameToString{
}), MakeBazelTarget("proto_library", "b_proto", AttrNameToString{
"srcs": `[":b_protos"]`,
}), makeBazelTarget("cc_lite_proto_library", "b_cc_proto_lite", AttrNameToString{
}), MakeBazelTarget("cc_lite_proto_library", "b_cc_proto_lite", AttrNameToString{
"deps": `[":b_proto"]`,
}), makeBazelTarget("cc_library_static", "b_bp2build_cc_library_static", AttrNameToString{
}), MakeBazelTarget("cc_library_static", "b_bp2build_cc_library_static", AttrNameToString{
"deps": `[":libprotobuf-cpp-lite"]`,
"whole_archive_deps": `[":b_cc_proto_lite"]`,
"srcs": `[":b_protos_cpp_srcs"]`,
"srcs_as": `[":b_protos_as_srcs"]`,
"srcs_c": `[":b_protos_c_srcs"]`,
}), makeBazelTarget("cc_library_shared", "b", AttrNameToString{
}), MakeBazelTarget("cc_library_shared", "b", AttrNameToString{
"dynamic_deps": `[":libprotobuf-cpp-lite"]`,
"whole_archive_deps": `[":b_cc_proto_lite"]`,
"srcs": `[":b_protos_cpp_srcs"]`,
"srcs_as": `[":b_protos_as_srcs"]`,
"srcs_c": `[":b_protos_c_srcs"]`,
}), makeBazelTarget("proto_library", "c_proto", AttrNameToString{
}), MakeBazelTarget("proto_library", "c_proto", AttrNameToString{
"srcs": `[":c-proto-srcs"]`,
}), makeBazelTarget("cc_lite_proto_library", "c_cc_proto_lite", AttrNameToString{
}), MakeBazelTarget("cc_lite_proto_library", "c_cc_proto_lite", AttrNameToString{
"deps": `[":c_proto"]`,
}), makeBazelTarget("cc_library_static", "c_bp2build_cc_library_static", AttrNameToString{
}), MakeBazelTarget("cc_library_static", "c_bp2build_cc_library_static", AttrNameToString{
"deps": `[":libprotobuf-cpp-lite"]`,
"whole_archive_deps": `[":c_cc_proto_lite"]`,
"srcs": `[":c-proto-srcs_cpp_srcs"]`,
"srcs_as": `[":c-proto-srcs_as_srcs"]`,
"srcs_c": `[":c-proto-srcs_c_srcs"]`,
}), makeBazelTarget("cc_library_shared", "c", AttrNameToString{
}), MakeBazelTarget("cc_library_shared", "c", AttrNameToString{
"dynamic_deps": `[":libprotobuf-cpp-lite"]`,
"whole_archive_deps": `[":c_cc_proto_lite"]`,
"srcs": `[":c-proto-srcs_cpp_srcs"]`,
"srcs_as": `[":c-proto-srcs_as_srcs"]`,
"srcs_c": `[":c-proto-srcs_c_srcs"]`,
}), makeBazelTarget("proto_library", "d_proto", AttrNameToString{
}), MakeBazelTarget("proto_library", "d_proto", AttrNameToString{
"srcs": `[":proto-srcs-d"]`,
}), makeBazelTarget("cc_lite_proto_library", "d_cc_proto_lite", AttrNameToString{
}), MakeBazelTarget("cc_lite_proto_library", "d_cc_proto_lite", AttrNameToString{
"deps": `[":d_proto"]`,
}), makeBazelTarget("cc_library_static", "d_bp2build_cc_library_static", AttrNameToString{
}), MakeBazelTarget("cc_library_static", "d_bp2build_cc_library_static", AttrNameToString{
"deps": `[":libprotobuf-cpp-lite"]`,
"whole_archive_deps": `[":d_cc_proto_lite"]`,
"srcs": `[":proto-srcs-d_cpp_srcs"]`,
"srcs_as": `[":proto-srcs-d_as_srcs"]`,
"srcs_c": `[":proto-srcs-d_c_srcs"]`,
}), makeBazelTarget("cc_library_shared", "d", AttrNameToString{
}), MakeBazelTarget("cc_library_shared", "d", AttrNameToString{
"dynamic_deps": `[":libprotobuf-cpp-lite"]`,
"whole_archive_deps": `[":d_cc_proto_lite"]`,
"srcs": `[":proto-srcs-d_cpp_srcs"]`,
@ -2385,10 +2385,10 @@ func TestCcLibrarySharedDisabled(t *testing.T) {
},
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{makeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
ExpectedBazelTargets: []string{MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
"srcs": `["foo.cpp"]`,
"target_compatible_with": `["@platforms//:incompatible"]`,
}), makeBazelTarget("cc_library_shared", "foo", AttrNameToString{
}), MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
"srcs": `["foo.cpp"]`,
"target_compatible_with": `select({
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
@ -2425,13 +2425,13 @@ func TestCcLibraryStaticDisabledForSomeArch(t *testing.T) {
},
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{makeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
ExpectedBazelTargets: []string{MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
"srcs": `["foo.cpp"]`,
"target_compatible_with": `select({
"//build/bazel/platforms/os:windows": ["@platforms//:incompatible"],
"//conditions:default": [],
})`,
}), makeBazelTarget("cc_library_shared", "foo", AttrNameToString{
}), MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
"srcs": `["foo.cpp"]`,
"target_compatible_with": `select({
"//build/bazel/platforms/os_arch:darwin_arm64": [],
@ -2513,14 +2513,14 @@ func TestCcLibraryConvertLex(t *testing.T) {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: append([]string{
makeBazelTarget("genlex", "foo_lib_genlex_l", AttrNameToString{
MakeBazelTarget("genlex", "foo_lib_genlex_l", AttrNameToString{
"srcs": `[
"foo1.l",
"foo2.l",
]`,
"lexopts": `["--foo_flags"]`,
}),
makeBazelTarget("genlex", "foo_lib_genlex_ll", AttrNameToString{
MakeBazelTarget("genlex", "foo_lib_genlex_ll", AttrNameToString{
"srcs": `[
"bar1.ll",
"bar2.ll",
@ -2552,14 +2552,14 @@ cc_library {
runtime_libs: ["foo"],
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_shared", "bar", AttrNameToString{
MakeBazelTarget("cc_library_shared", "bar", AttrNameToString{
"local_includes": `["."]`,
}),
makeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
"runtime_deps": `[":foo"]`,
"local_includes": `["."]`,
}),
makeBazelTarget("cc_library_shared", "foo", AttrNameToString{
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
"runtime_deps": `[":foo"]`,
"local_includes": `["."]`,
}),
@ -2608,10 +2608,10 @@ func TestCcLibraryEmptySuffix(t *testing.T) {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
"srcs_c": `["foo.c"]`,
}),
makeBazelTarget("cc_library_shared", "foo", AttrNameToString{
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
"srcs_c": `["foo.c"]`,
"suffix": `""`,
}),
@ -2634,10 +2634,10 @@ func TestCcLibrarySuffix(t *testing.T) {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
"srcs_c": `["foo.c"]`,
}),
makeBazelTarget("cc_library_shared", "foo", AttrNameToString{
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
"srcs_c": `["foo.c"]`,
"suffix": `"-suf"`,
}),
@ -2663,10 +2663,10 @@ func TestCcLibraryArchVariantSuffix(t *testing.T) {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
"srcs_c": `["foo.c"]`,
}),
makeBazelTarget("cc_library_shared", "foo", AttrNameToString{
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
"srcs_c": `["foo.c"]`,
"suffix": `select({
"//build/bazel/platforms/arch:arm": "-32",
@ -2701,20 +2701,20 @@ cc_library {
"srcs": `["aidl/A.aidl"]`,
"strip_import_prefix": `"aidl"`,
}),
makeBazelTarget("aidl_library", "foo_aidl_library", AttrNameToString{
MakeBazelTarget("aidl_library", "foo_aidl_library", AttrNameToString{
"srcs": `["B.aidl"]`,
}),
makeBazelTarget("cc_aidl_library", "foo_cc_aidl_library", AttrNameToString{
MakeBazelTarget("cc_aidl_library", "foo_cc_aidl_library", AttrNameToString{
"deps": `[
":A_aidl",
":foo_aidl_library",
]`,
}),
makeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
"whole_archive_deps": `[":foo_cc_aidl_library"]`,
"local_includes": `["."]`,
}),
makeBazelTarget("cc_library_shared", "foo", AttrNameToString{
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
"whole_archive_deps": `[":foo_cc_aidl_library"]`,
"local_includes": `["."]`,
}),
@ -2743,14 +2743,14 @@ cc_library {
],
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_aidl_library", "foo_cc_aidl_library", AttrNameToString{
MakeBazelTarget("cc_aidl_library", "foo_cc_aidl_library", AttrNameToString{
"deps": `["//path/to/A:A_aidl"]`,
}),
makeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
"whole_archive_deps": `[":foo_cc_aidl_library"]`,
"local_includes": `["."]`,
}),
makeBazelTarget("cc_library_shared", "foo", AttrNameToString{
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
"whole_archive_deps": `[":foo_cc_aidl_library"]`,
"local_includes": `["."]`,
}),

View file

@ -106,7 +106,7 @@ cc_library_headers {
// TODO: Also support export_header_lib_headers
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
"export_includes": `[
"dir-1",
"dir-2",
@ -183,7 +183,7 @@ cc_library_headers {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
"deps": `[":base-lib"] + select({
"//build/bazel/platforms/os:android": [":android-lib"],
"//build/bazel/platforms/os:darwin": [":darwin-lib"],
@ -223,7 +223,7 @@ cc_library_headers {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
"deps": `select({
"//build/bazel/platforms/os:android": [":exported-lib"],
"//conditions:default": [],
@ -276,7 +276,7 @@ func TestCcLibraryHeadersArchAndTargetExportSystemIncludes(t *testing.T) {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
"export_system_includes": `["shared_include_dir"] + select({
"//build/bazel/platforms/arch:arm": ["arm_include_dir"],
"//build/bazel/platforms/arch:x86_64": ["x86_64_include_dir"],
@ -318,7 +318,7 @@ cc_library_headers {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_headers", "lib-1", AttrNameToString{
MakeBazelTarget("cc_library_headers", "lib-1", AttrNameToString{
"export_includes": `["lib-1"]`,
}),
},
@ -340,7 +340,7 @@ cc_library_headers {
}
` + simpleModuleDoNotConvertBp2build("cc_library_headers", "foo_export"),
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
"deps": `[":foo_export"]`,
}),
},
@ -362,7 +362,7 @@ cc_library_headers {
}
` + simpleModuleDoNotConvertBp2build("cc_library_headers", "foo_export"),
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
"deps": `[":foo_export"]`,
}),
},
@ -384,7 +384,7 @@ cc_library_headers {
}
` + simpleModuleDoNotConvertBp2build("cc_library_headers", "foo_export"),
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
"deps": `[":foo_export"]`,
}),
},
@ -405,7 +405,7 @@ cc_library_headers {
}
` + simpleModuleDoNotConvertBp2build("cc_library_headers", "foo_export"),
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
MakeBazelTarget("cc_library_headers", "foo_headers", AttrNameToString{
"deps": `[":foo_export"]`,
}),
},

View file

@ -142,7 +142,7 @@ cc_library_shared {
// TODO: Also support export_header_lib_headers
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
"absolute_includes": `[
"include_dir_1",
"include_dir_2",
@ -202,7 +202,7 @@ cc_library_shared {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
"implementation_dynamic_deps": `select({
"//build/bazel/platforms/arch:arm64": [":shared_dep"],
"//conditions:default": [],
@ -231,7 +231,7 @@ cc_library_shared {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
"implementation_dynamic_deps": `select({
"//build/bazel/platforms/os:android": [":shared_dep"],
"//conditions:default": [],
@ -266,7 +266,7 @@ cc_library_shared {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
"implementation_dynamic_deps": `[":shared_dep"] + select({
"//build/bazel/platforms/arch:arm64": [":shared_dep3"],
"//conditions:default": [],
@ -295,7 +295,7 @@ cc_library_shared {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
"srcs_c": `[
"common.c",
"foo-a.c",
@ -322,7 +322,7 @@ cc_library_shared {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
"strip": `{
"all": True,
"keep_symbols": False,
@ -351,7 +351,7 @@ cc_library_shared {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
"additional_linker_inputs": `["version_script"]`,
"linkopts": `["-Wl,--version-script,$(location version_script)"]`,
}),
@ -374,7 +374,7 @@ cc_library_shared {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
"link_crt": `False`,
"srcs": `["impl.cpp"]`,
}),
@ -397,7 +397,7 @@ cc_library_shared {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
"srcs": `["impl.cpp"]`,
}),
},
@ -440,11 +440,11 @@ func TestCcLibrarySharedProto(t *testing.T) {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("proto_library", "foo_proto", AttrNameToString{
MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
"srcs": `["foo.proto"]`,
}), makeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
}), MakeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
"deps": `[":foo_proto"]`,
}), makeBazelTarget("cc_library_shared", "foo", AttrNameToString{
}), MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
"dynamic_deps": `[":libprotobuf-cpp-lite"]`,
"whole_archive_deps": `[":foo_cc_proto_lite"]`,
}),
@ -460,7 +460,7 @@ func TestCcLibrarySharedUseVersionLib(t *testing.T) {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_shared", "foo", AttrNameToString{
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
"use_version_lib": "True",
}),
},
@ -484,7 +484,7 @@ cc_library_shared {
`,
},
Blueprint: soongCcLibraryPreamble,
ExpectedBazelTargets: []string{makeBazelTarget("cc_library_shared", "a", AttrNameToString{
ExpectedBazelTargets: []string{MakeBazelTarget("cc_library_shared", "a", AttrNameToString{
"has_stubs": `True`,
}),
},
@ -510,7 +510,7 @@ cc_library_shared {
defaults: ["empty_defaults"],
}
`,
ExpectedBazelTargets: []string{makeBazelTarget("cc_library_shared", "empty", AttrNameToString{
ExpectedBazelTargets: []string{MakeBazelTarget("cc_library_shared", "empty", AttrNameToString{
"system_dynamic_deps": "[]",
})},
})
@ -537,21 +537,21 @@ func TestCcLibrarySharedConvertLex(t *testing.T) {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("genlex", "foo_lib_genlex_l", AttrNameToString{
MakeBazelTarget("genlex", "foo_lib_genlex_l", AttrNameToString{
"srcs": `[
"foo1.l",
"foo2.l",
]`,
"lexopts": `["--foo_flags"]`,
}),
makeBazelTarget("genlex", "foo_lib_genlex_ll", AttrNameToString{
MakeBazelTarget("genlex", "foo_lib_genlex_ll", AttrNameToString{
"srcs": `[
"bar1.ll",
"bar2.ll",
]`,
"lexopts": `["--foo_flags"]`,
}),
makeBazelTarget("cc_library_shared", "foo_lib", AttrNameToString{
MakeBazelTarget("cc_library_shared", "foo_lib", AttrNameToString{
"srcs": `[
"bar.cc",
":foo_lib_genlex_ll",
@ -576,7 +576,7 @@ func TestCcLibrarySharedClangUnknownFlags(t *testing.T) {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_shared", "foo", AttrNameToString{
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
"conlyflags": `["-a"]`,
"copts": `["-b"]`,
"cppflags": `["-c"]`,
@ -600,7 +600,7 @@ func TestCCLibraryFlagSpaceSplitting(t *testing.T) {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_shared", "foo", AttrNameToString{
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
"additional_linker_inputs": `["version_script"]`,
"conlyflags": `[
"-include",
@ -631,10 +631,10 @@ cc_library_shared {
runtime_libs: ["foo"],
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_shared", "bar", AttrNameToString{
MakeBazelTarget("cc_library_shared", "bar", AttrNameToString{
"local_includes": `["."]`,
}),
makeBazelTarget("cc_library_shared", "foo", AttrNameToString{
MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
"runtime_deps": `[":foo"]`,
"local_includes": `["."]`,
}),
@ -656,7 +656,7 @@ cc_library_shared {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
"srcs_c": `["foo.c"]`,
"suffix": `""`,
}),
@ -678,7 +678,7 @@ cc_library_shared {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
"srcs_c": `["foo.c"]`,
"suffix": `"-suf"`,
}),
@ -703,7 +703,7 @@ cc_library_shared {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
MakeBazelTarget("cc_library_shared", "foo_shared", AttrNameToString{
"srcs_c": `["foo.c"]`,
"suffix": `select({
"//build/bazel/platforms/arch:arm": "-32",

View file

@ -173,7 +173,7 @@ cc_library_static {
// TODO: Also support export_header_lib_headers
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"absolute_includes": `[
"include_dir_1",
"include_dir_2",
@ -238,7 +238,7 @@ cc_library_static {
],
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"absolute_includes": `["subpackage"]`,
"local_includes": `["."]`,
}),
@ -262,7 +262,7 @@ cc_library_static {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"export_includes": `["subpackage"]`,
}),
},
@ -285,7 +285,7 @@ cc_library_static {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"export_system_includes": `["subpackage"]`,
}),
},
@ -320,7 +320,7 @@ cc_library_static {
},
Blueprint: soongCcLibraryStaticPreamble,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"absolute_includes": `[
"subpackage/subsubpackage",
"subpackage2",
@ -352,7 +352,7 @@ cc_library_static {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"absolute_includes": `["subpackage"]`,
"local_includes": `["subpackage2"]`,
}),
@ -379,7 +379,7 @@ cc_library_static {
include_build_directory: true,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"absolute_includes": `["subpackage"]`,
"local_includes": `[
"subpackage2",
@ -409,7 +409,7 @@ cc_library_static {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"implementation_deps": `select({
"//build/bazel/platforms/arch:arm64": [":static_dep"],
"//conditions:default": [],
@ -442,7 +442,7 @@ cc_library_static {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"implementation_deps": `select({
"//build/bazel/platforms/os:android": [":static_dep"],
"//conditions:default": [],
@ -486,7 +486,7 @@ cc_library_static {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"implementation_deps": `[":static_dep"] + select({
"//build/bazel/platforms/arch:arm64": [":static_dep4"],
"//conditions:default": [],
@ -516,7 +516,7 @@ cc_library_static {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"srcs_c": `[
"common.c",
"foo-a.c",
@ -541,7 +541,7 @@ cc_library_static {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"srcs_c": `["common.c"] + select({
"//build/bazel/platforms/arch:arm": ["foo-arm.c"],
"//conditions:default": [],
@ -571,7 +571,7 @@ cc_library_static {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"srcs_c": `["common.c"] + select({
"//build/bazel/platforms/arch:arm": ["for-arm.c"],
"//conditions:default": ["not-for-arm.c"],
@ -603,7 +603,7 @@ cc_library_static {
include_build_directory: false,
} `,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"srcs_c": `["common.c"] + select({
"//build/bazel/platforms/arch:arm": [
"not-for-x86.c",
@ -652,7 +652,7 @@ cc_library_static {
include_build_directory: false,
} `,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"srcs_c": `["common.c"] + select({
"//build/bazel/platforms/arch:arm": [
"not-for-arm64.c",
@ -709,7 +709,7 @@ cc_library_static {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"srcs": `["common.cc"] + select({
"//build/bazel/platforms/arch:arm": [],
"//conditions:default": ["foo-no-arm.cc"],
@ -740,7 +740,7 @@ cc_library_static {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"srcs": `["common.cc"] + select({
"//build/bazel/platforms/arch:arm": [],
"//build/bazel/platforms/arch:x86": [
@ -769,7 +769,7 @@ cc_library_static {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"implementation_deps": `[":static_dep"]`,
}),
},
@ -794,7 +794,7 @@ cc_library_static {
include_build_directory: false,
} `,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"srcs_c": `["common.c"] + select({
"//build/bazel/platforms/arch:arm": ["for-lib32.c"],
"//build/bazel/platforms/arch:x86": ["for-lib32.c"],
@ -826,7 +826,7 @@ cc_library_static {
include_build_directory: false,
} `,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"srcs_c": `["common.c"] + select({
"//build/bazel/platforms/arch:arm": [
"not-for-lib64.c",
@ -891,7 +891,7 @@ cc_library_static {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"srcs_c": `["common.c"] + select({
"//build/bazel/platforms/arch:arm": [
"not-for-arm64.c",
@ -962,7 +962,7 @@ cc_library_static {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"export_includes": `["."]`,
"local_includes": `["."]`,
"hdrs": `[":export_generated_hdr"]`,
@ -1030,7 +1030,7 @@ cc_library_static {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"srcs": `[
"common.cpp",
":generated_src",
@ -1093,7 +1093,7 @@ cc_library_static {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"srcs_c": `select({
"//build/bazel/platforms/os:android": ["android_src.c"],
"//conditions:default": [],
@ -1132,7 +1132,7 @@ cc_library_static {
include_build_directory: false,
} `,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"copts": `select({
"//build/bazel/product_variables:binder32bit": ["-Wbinder32bit"],
"//conditions:default": [],
@ -1192,7 +1192,7 @@ cc_library_static {
include_build_directory: false,
} `,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"copts": `select({
"//build/bazel/product_variables:malloc_not_svelte": ["-Wmalloc_not_svelte"],
"//conditions:default": [],
@ -1231,7 +1231,7 @@ cc_library_static {
include_build_directory: false,
} `,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_static", AttrNameToString{
"asflags": `select({
"//build/bazel/product_variables:platform_sdk_version": ["-DPLATFORM_SDK_VERSION=$(Platform_sdk_version)"],
"//conditions:default": [],
@ -1253,7 +1253,7 @@ cc_library_static {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "root_empty", AttrNameToString{
MakeBazelTarget("cc_library_static", "root_empty", AttrNameToString{
"system_dynamic_deps": `[]`,
}),
},
@ -1277,7 +1277,7 @@ cc_library_static {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "static_empty", AttrNameToString{
MakeBazelTarget("cc_library_static", "static_empty", AttrNameToString{
"system_dynamic_deps": `[]`,
}),
},
@ -1299,7 +1299,7 @@ cc_library_static {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "target_bionic_empty", AttrNameToString{
MakeBazelTarget("cc_library_static", "target_bionic_empty", AttrNameToString{
"system_dynamic_deps": `[]`,
}),
},
@ -1325,7 +1325,7 @@ cc_library_static {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "target_linux_bionic_empty", AttrNameToString{
MakeBazelTarget("cc_library_static", "target_linux_bionic_empty", AttrNameToString{
"system_dynamic_deps": `[]`,
}),
},
@ -1348,7 +1348,7 @@ cc_library_static {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "target_bionic", AttrNameToString{
MakeBazelTarget("cc_library_static", "target_bionic", AttrNameToString{
"system_dynamic_deps": `select({
"//build/bazel/platforms/os:android": [":libc"],
"//build/bazel/platforms/os:linux_bionic": [":libc"],
@ -1377,7 +1377,7 @@ cc_library_static {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "target_linux_bionic", AttrNameToString{
MakeBazelTarget("cc_library_static", "target_linux_bionic", AttrNameToString{
"system_dynamic_deps": `[":libc"] + select({
"//build/bazel/platforms/os:linux_bionic": [":libm"],
"//conditions:default": [],
@ -1419,18 +1419,18 @@ cc_library_static {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "all", AttrNameToString{
MakeBazelTarget("cc_library_static", "all", AttrNameToString{
"implementation_dynamic_deps": `select({
"//build/bazel/platforms/os:android": [],
"//build/bazel/platforms/os:linux_bionic": [],
"//conditions:default": [":libc"],
})`,
}),
makeBazelTarget("cc_library_static", "keep_for_empty_system_shared_libs", AttrNameToString{
MakeBazelTarget("cc_library_static", "keep_for_empty_system_shared_libs", AttrNameToString{
"implementation_dynamic_deps": `[":libc"]`,
"system_dynamic_deps": `[]`,
}),
makeBazelTarget("cc_library_static", "used_in_bionic_oses", AttrNameToString{}),
MakeBazelTarget("cc_library_static", "used_in_bionic_oses", AttrNameToString{}),
},
})
}
@ -1446,11 +1446,11 @@ func TestCcLibraryStaticProto(t *testing.T) {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("proto_library", "foo_proto", AttrNameToString{
MakeBazelTarget("proto_library", "foo_proto", AttrNameToString{
"srcs": `["foo.proto"]`,
}), makeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
}), MakeBazelTarget("cc_lite_proto_library", "foo_cc_proto_lite", AttrNameToString{
"deps": `[":foo_proto"]`,
}), makeBazelTarget("cc_library_static", "foo", AttrNameToString{
}), MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
"deps": `[":libprotobuf-cpp-lite"]`,
"whole_archive_deps": `[":foo_cc_proto_lite"]`,
}),
@ -1466,7 +1466,7 @@ func TestCcLibraryStaticUseVersionLib(t *testing.T) {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
"use_version_lib": "True",
}),
},
@ -1483,7 +1483,7 @@ func TestCcLibraryStaticStdInFlags(t *testing.T) {
include_build_directory: false,
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
"conlyflags": `["-std=conly"]`,
"cppflags": `["-std=cpp"]`,
}),
@ -1553,7 +1553,7 @@ func TestCcLibraryStaticStl(t *testing.T) {
%s
}`, tc.prop),
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_static", "foo", tc.attr),
MakeBazelTarget("cc_library_static", "foo", tc.attr),
},
})
})
@ -1571,10 +1571,10 @@ cc_library_static {
runtime_libs: ["foo"],
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_library_shared", "bar", AttrNameToString{
MakeBazelTarget("cc_library_shared", "bar", AttrNameToString{
"local_includes": `["."]`,
}),
makeBazelTarget("cc_library_static", "foo", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
"runtime_deps": `[":foo"]`,
"local_includes": `["."]`,
}),

View file

@ -60,7 +60,7 @@ func TestCcObjectSimple(t *testing.T) {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_object", "foo", AttrNameToString{
MakeBazelTarget("cc_object", "foo", AttrNameToString{
"copts": `[
"-fno-addrsig",
"-Wno-gcc-compat",
@ -106,7 +106,7 @@ cc_defaults {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_object", "foo", AttrNameToString{
MakeBazelTarget("cc_object", "foo", AttrNameToString{
"copts": `[
"-Werror",
"-fno-addrsig",
@ -141,11 +141,11 @@ cc_object {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_object", "bar", AttrNameToString{
MakeBazelTarget("cc_object", "bar", AttrNameToString{
"copts": `["-fno-addrsig"]`,
"srcs": `["x/y/z.c"]`,
"system_dynamic_deps": `[]`,
}), makeBazelTarget("cc_object", "foo", AttrNameToString{
}), MakeBazelTarget("cc_object", "foo", AttrNameToString{
"copts": `["-fno-addrsig"]`,
"deps": `[":bar"]`,
"srcs": `["a/b/c.c"]`,
@ -170,7 +170,7 @@ func TestCcObjectIncludeBuildDirFalse(t *testing.T) {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_object", "foo", AttrNameToString{
MakeBazelTarget("cc_object", "foo", AttrNameToString{
"copts": `["-fno-addrsig"]`,
"srcs": `["a/b/c.c"]`,
"system_dynamic_deps": `[]`,
@ -195,7 +195,7 @@ func TestCcObjectProductVariable(t *testing.T) {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_object", "foo", AttrNameToString{
MakeBazelTarget("cc_object", "foo", AttrNameToString{
"asflags": `select({
"//build/bazel/product_variables:platform_sdk_version": ["-DPLATFORM_SDK_VERSION=$(Platform_sdk_version)"],
"//conditions:default": [],
@ -227,7 +227,7 @@ func TestCcObjectCflagsOneArch(t *testing.T) {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_object", "foo", AttrNameToString{
MakeBazelTarget("cc_object", "foo", AttrNameToString{
"copts": `["-fno-addrsig"] + select({
"//build/bazel/platforms/arch:x86": ["-fPIC"],
"//conditions:default": [],
@ -271,7 +271,7 @@ func TestCcObjectCflagsFourArch(t *testing.T) {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_object", "foo", AttrNameToString{
MakeBazelTarget("cc_object", "foo", AttrNameToString{
"copts": `["-fno-addrsig"] + select({
"//build/bazel/platforms/arch:arm": ["-Wall"],
"//build/bazel/platforms/arch:arm64": ["-Wall"],
@ -303,7 +303,7 @@ func TestCcObjectLinkerScript(t *testing.T) {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_object", "foo", AttrNameToString{
MakeBazelTarget("cc_object", "foo", AttrNameToString{
"copts": `["-fno-addrsig"]`,
"linker_script": `"bunny.lds"`,
"srcs": `["base.cpp"]`,
@ -360,7 +360,7 @@ cc_object {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_object", "foo", AttrNameToString{
MakeBazelTarget("cc_object", "foo", AttrNameToString{
"copts": `["-fno-addrsig"]`,
"deps": `select({
"//build/bazel/platforms/arch:arm": [":arm_obj"],
@ -401,7 +401,7 @@ func TestCcObjectSelectOnLinuxAndBionicArchs(t *testing.T) {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("cc_object", "foo", AttrNameToString{
MakeBazelTarget("cc_object", "foo", AttrNameToString{
"copts": `["-fno-addrsig"]`,
"srcs": `["base.cpp"] + select({
"//build/bazel/platforms/os_arch:android_arm64": [

View file

@ -36,10 +36,10 @@ cc_prebuilt_library {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("prebuilt_library_static", "libtest_bp2build_cc_library_static", AttrNameToString{
MakeBazelTarget("prebuilt_library_static", "libtest_bp2build_cc_library_static", AttrNameToString{
"static_library": `"libf.so"`,
}),
makeBazelTarget("prebuilt_library_shared", "libtest", AttrNameToString{
MakeBazelTarget("prebuilt_library_shared", "libtest", AttrNameToString{
"shared_library": `"libf.so"`,
}),
},
@ -66,14 +66,14 @@ cc_prebuilt_library {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("prebuilt_library_static", "libtest_bp2build_cc_library_static", AttrNameToString{
MakeBazelTarget("prebuilt_library_static", "libtest_bp2build_cc_library_static", AttrNameToString{
"static_library": `select({
"//build/bazel/platforms/arch:arm": "libg.so",
"//build/bazel/platforms/arch:arm64": "libf.so",
"//conditions:default": None,
})`,
}),
makeBazelTarget("prebuilt_library_shared", "libtest", AttrNameToString{
MakeBazelTarget("prebuilt_library_shared", "libtest", AttrNameToString{
"shared_library": `select({
"//build/bazel/platforms/arch:arm": "libg.so",
"//build/bazel/platforms/arch:arm64": "libf.so",
@ -104,13 +104,13 @@ cc_prebuilt_library {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("prebuilt_library_static", "libtest_bp2build_cc_library_static", AttrNameToString{
MakeBazelTarget("prebuilt_library_static", "libtest_bp2build_cc_library_static", AttrNameToString{
"static_library": `"libf.so"`,
"export_includes": `["testdir/1/"]`,
"export_system_includes": `["testdir/2/"]`,
}),
// TODO(b/229374533): When fixed, update this test
makeBazelTarget("prebuilt_library_shared", "libtest", AttrNameToString{
MakeBazelTarget("prebuilt_library_shared", "libtest", AttrNameToString{
"shared_library": `"libf.so"`,
}),
},
@ -185,10 +185,10 @@ cc_prebuilt_library {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("prebuilt_library_static", "libtest_bp2build_cc_library_static", AttrNameToString{
MakeBazelTarget("prebuilt_library_static", "libtest_bp2build_cc_library_static", AttrNameToString{
"static_library": `"libf.so"`,
}),
makeBazelTarget("prebuilt_library_shared", "libtest", AttrNameToString{
MakeBazelTarget("prebuilt_library_shared", "libtest", AttrNameToString{
"shared_library": `"libg.so"`,
}),
},

View file

@ -23,7 +23,7 @@ cc_prebuilt_library_shared {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("prebuilt_library_shared", "libtest", AttrNameToString{
MakeBazelTarget("prebuilt_library_shared", "libtest", AttrNameToString{
"shared_library": `"libf.so"`,
}),
},
@ -50,7 +50,7 @@ cc_prebuilt_library_shared {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("prebuilt_library_shared", "libtest", AttrNameToString{
MakeBazelTarget("prebuilt_library_shared", "libtest", AttrNameToString{
"shared_library": `select({
"//build/bazel/platforms/arch:arm": "libg.so",
"//build/bazel/platforms/arch:arm64": "libf.so",

View file

@ -36,7 +36,7 @@ cc_prebuilt_library_static {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("prebuilt_library_static", "libtest", AttrNameToString{
MakeBazelTarget("prebuilt_library_static", "libtest", AttrNameToString{
"static_library": `"libf.so"`,
}),
},
@ -63,7 +63,7 @@ cc_prebuilt_library_static {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("prebuilt_library_static", "libtest", AttrNameToString{
MakeBazelTarget("prebuilt_library_static", "libtest", AttrNameToString{
"static_library": `select({
"//build/bazel/platforms/arch:arm": "libg.so",
"//build/bazel/platforms/arch:arm64": "libf.so",
@ -118,21 +118,21 @@ func TestCcLibraryStaticConvertLex(t *testing.T) {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("genlex", "foo_lib_genlex_l", AttrNameToString{
MakeBazelTarget("genlex", "foo_lib_genlex_l", AttrNameToString{
"srcs": `[
"foo1.l",
"foo2.l",
]`,
"lexopts": `["--foo_flags"]`,
}),
makeBazelTarget("genlex", "foo_lib_genlex_ll", AttrNameToString{
MakeBazelTarget("genlex", "foo_lib_genlex_ll", AttrNameToString{
"srcs": `[
"bar1.ll",
"bar2.ll",
]`,
"lexopts": `["--foo_flags"]`,
}),
makeBazelTarget("cc_library_static", "foo_lib", AttrNameToString{
MakeBazelTarget("cc_library_static", "foo_lib", AttrNameToString{
"srcs": `[
"bar.cc",
":foo_lib_genlex_ll",

View file

@ -48,7 +48,7 @@ cc_library {
srcs: ["main.cpp", "myfile.asm"],
}`,
ExpectedBazelTargets: append([]string{
makeBazelTarget("yasm", "foo_yasm", map[string]string{
MakeBazelTarget("yasm", "foo_yasm", map[string]string{
"include_dirs": `["."]`,
"srcs": `["myfile.asm"]`,
}),
@ -81,7 +81,7 @@ cc_library {
srcs: ["main.cpp", "myfile.asm"],
}`,
ExpectedBazelTargets: append([]string{
makeBazelTarget("yasm", "foo_yasm", map[string]string{
MakeBazelTarget("yasm", "foo_yasm", map[string]string{
"include_dirs": `[
"include1/foo",
".",
@ -123,7 +123,7 @@ cc_library {
},
}`,
ExpectedBazelTargets: append([]string{
makeBazelTarget("yasm", "foo_yasm", map[string]string{
MakeBazelTarget("yasm", "foo_yasm", map[string]string{
"include_dirs": `["."]`,
"srcs": `select({
"//build/bazel/platforms/arch:x86": ["myfile.asm"],
@ -161,7 +161,7 @@ cc_library {
},
}`,
ExpectedBazelTargets: append([]string{
makeBazelTarget("yasm", "foo_yasm", map[string]string{
MakeBazelTarget("yasm", "foo_yasm", map[string]string{
"include_dirs": `["."]`,
"srcs": `["myfile.asm"] + select({
"//build/bazel/platforms/arch:x86": ["mysecondfile.asm"],

View file

@ -55,7 +55,7 @@ func TestJavaBinaryHost(t *testing.T) {
java_version: "8",
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("java_binary", "java-binary-host-1", AttrNameToString{
MakeBazelTarget("java_binary", "java-binary-host-1", AttrNameToString{
"srcs": `["a.java"]`,
"main_class": `"com.android.test.MainClass"`,
"deps": `["//other:jni-lib-1"]`,
@ -91,7 +91,7 @@ java_library {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("java_binary", "java-binary-host-1", AttrNameToString{
MakeBazelTarget("java_binary", "java-binary-host-1", AttrNameToString{
"main_class": `"com.android.test.MainClass"`,
"runtime_deps": `[":java-dep-1"]`,
"target_compatible_with": `select({

View file

@ -45,7 +45,7 @@ java_import {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("java_import", "example_import", AttrNameToString{
MakeBazelTarget("java_import", "example_import", AttrNameToString{
"jars": `["import.jar"]`,
}),
}})
@ -74,7 +74,7 @@ java_import {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("java_import", "example_import", AttrNameToString{
MakeBazelTarget("java_import", "example_import", AttrNameToString{
"jars": `select({
"//build/bazel/platforms/os:android": ["android.jar"],
"//build/bazel/platforms/os:linux": ["linux.jar"],

View file

@ -51,11 +51,11 @@ java_library {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("java_library", "java-lib-1", AttrNameToString{
MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
"srcs": `["a.java"]`,
"deps": `[":java-lib-2"]`,
}),
makeBazelTarget("java_library", "java-lib-2", AttrNameToString{
MakeBazelTarget("java_library", "java-lib-2", AttrNameToString{
"srcs": `["b.java"]`,
}),
},
@ -84,7 +84,7 @@ java_library {
bazel_module: { bp2build_available: false },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("java_library", "java-lib-1", AttrNameToString{
MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
"srcs": `["a.java"]`,
"deps": `[
":java-lib-2",
@ -110,7 +110,7 @@ java_library {
bazel_module: { bp2build_available: false },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("java_library", "java-lib-1", AttrNameToString{
MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
"exports": `[":java-lib-2"]`,
}),
},
@ -149,7 +149,7 @@ java_plugin {
bazel_module: { bp2build_available: false },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("java_library", "java-lib-1", AttrNameToString{
MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
"plugins": `[":java-plugin-1"]`,
}),
},
@ -166,7 +166,7 @@ func TestJavaLibraryJavaVersion(t *testing.T) {
java_version: "11",
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("java_library", "java-lib-1", AttrNameToString{
MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
"srcs": `["a.java"]`,
"javacopts": `["-source 11 -target 11"]`,
}),
@ -186,7 +186,7 @@ func TestJavaLibraryErrorproneJavacflagsEnabledManually(t *testing.T) {
},
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("java_library", "java-lib-1", AttrNameToString{
MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
"javacopts": `[
"-Xsuper-fast",
"-Xep:SpeedLimit:OFF",
@ -208,7 +208,7 @@ func TestJavaLibraryErrorproneJavacflagsErrorproneDisabledByDefault(t *testing.T
},
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("java_library", "java-lib-1", AttrNameToString{
MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
"javacopts": `["-Xsuper-fast"]`,
"srcs": `["a.java"]`,
}),
@ -228,7 +228,7 @@ func TestJavaLibraryErrorproneJavacflagsErrorproneDisabledManually(t *testing.T)
},
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("java_library", "java-lib-1", AttrNameToString{
MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
"javacopts": `["-Xsuper-fast"]`,
"srcs": `["a.java"]`,
}),
@ -252,13 +252,13 @@ func TestJavaLibraryLogTags(t *testing.T) {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("event_log_tags", "example_lib_logtags", AttrNameToString{
MakeBazelTarget("event_log_tags", "example_lib_logtags", AttrNameToString{
"srcs": `[
"a.logtag",
"b.logtag",
]`,
}),
makeBazelTarget("java_library", "example_lib", AttrNameToString{
MakeBazelTarget("java_library", "example_lib", AttrNameToString{
"srcs": `[
"a.java",
"b.java",
@ -280,7 +280,7 @@ func TestJavaLibraryResources(t *testing.T) {
java_resources: ["res/a.res", "res/b.res"],
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("java_library", "java-lib-1", AttrNameToString{
MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
"resources": `[
"res/a.res",
"res/b.res",
@ -302,7 +302,7 @@ func TestJavaLibraryResourceDirs(t *testing.T) {
java_resource_dirs: ["res"],
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("java_library", "java-lib-1", AttrNameToString{
MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
"resource_strip_prefix": `"res"`,
"resources": `[
"res/a.res",
@ -326,7 +326,7 @@ func TestJavaLibraryResourcesExcludeDir(t *testing.T) {
exclude_java_resource_dirs: ["res/exclude"],
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("java_library", "java-lib-1", AttrNameToString{
MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
"resource_strip_prefix": `"res"`,
"resources": `["res/a.res"]`,
}),
@ -347,7 +347,7 @@ func TestJavaLibraryResourcesExcludeFile(t *testing.T) {
exclude_java_resources: ["res/dir1/exclude.res"],
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("java_library", "java-lib-1", AttrNameToString{
MakeBazelTarget("java_library", "java-lib-1", AttrNameToString{
"resource_strip_prefix": `"res"`,
"resources": `[
"res/a.res",
@ -389,16 +389,16 @@ func TestJavaLibraryAidl(t *testing.T) {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("aidl_library", "example_lib_aidl_library", AttrNameToString{
MakeBazelTarget("aidl_library", "example_lib_aidl_library", AttrNameToString{
"srcs": `[
"a.aidl",
"b.aidl",
]`,
}),
makeBazelTarget("java_aidl_library", "example_lib_java_aidl_library", AttrNameToString{
MakeBazelTarget("java_aidl_library", "example_lib_java_aidl_library", AttrNameToString{
"deps": `[":example_lib_aidl_library"]`,
}),
makeBazelTarget("java_library", "example_lib", AttrNameToString{
MakeBazelTarget("java_library", "example_lib", AttrNameToString{
"deps": `[":example_lib_java_aidl_library"]`,
"exports": `[":example_lib_java_aidl_library"]`,
"srcs": `[
@ -424,13 +424,13 @@ java_library {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("aidl_library", "example_lib_aidl_library", AttrNameToString{
MakeBazelTarget("aidl_library", "example_lib_aidl_library", AttrNameToString{
"srcs": `["b.aidl"]`,
}),
makeBazelTarget("java_aidl_library", "example_lib_java_aidl_library", AttrNameToString{
MakeBazelTarget("java_aidl_library", "example_lib_java_aidl_library", AttrNameToString{
"deps": `[":example_lib_aidl_library"]`,
}),
makeBazelTarget("java_library", "example_lib", AttrNameToString{
MakeBazelTarget("java_library", "example_lib", AttrNameToString{
"deps": `[":example_lib_java_aidl_library"]`,
"exports": `[":example_lib_java_aidl_library"]`,
"srcs": `["a.java"]`,
@ -478,10 +478,10 @@ java_library {
"b.aidl",
]`,
}),
makeBazelTarget("java_aidl_library", "example_lib_java_aidl_library", AttrNameToString{
MakeBazelTarget("java_aidl_library", "example_lib_java_aidl_library", AttrNameToString{
"deps": `[":aidl_files"]`,
}),
makeBazelTarget("java_library", "example_lib", AttrNameToString{
MakeBazelTarget("java_library", "example_lib", AttrNameToString{
"deps": `[":example_lib_java_aidl_library"]`,
"exports": `[":example_lib_java_aidl_library"]`,
"srcs": `[
@ -523,10 +523,10 @@ java_library {
],
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("java_aidl_library", "foo_java_aidl_library", AttrNameToString{
MakeBazelTarget("java_aidl_library", "foo_java_aidl_library", AttrNameToString{
"deps": `["//path/to/A:A_aidl"]`,
}),
makeBazelTarget("java_library", "foo", AttrNameToString{
MakeBazelTarget("java_library", "foo", AttrNameToString{
"exports": `[":foo_java_aidl_library"]`,
}),
},

View file

@ -46,7 +46,7 @@ java_library_host {
java_version: "9",
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("java_library", "java-lib-host-1", AttrNameToString{
MakeBazelTarget("java_library", "java-lib-host-1", AttrNameToString{
"srcs": `["a.java"]`,
"deps": `[":java-lib-host-2"]`,
"target_compatible_with": `select({
@ -54,7 +54,7 @@ java_library_host {
"//conditions:default": [],
})`,
}),
makeBazelTarget("java_library", "java-lib-host-2", AttrNameToString{
MakeBazelTarget("java_library", "java-lib-host-2", AttrNameToString{
"javacopts": `["-source 1.9 -target 1.9"]`,
"srcs": `["c.java"]`,
"target_compatible_with": `select({

View file

@ -54,7 +54,7 @@ java_library {
bazel_module: { bp2build_available: false },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("java_plugin", "java-plug-1", AttrNameToString{
MakeBazelTarget("java_plugin", "java-plug-1", AttrNameToString{
"target_compatible_with": `select({
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
"//conditions:default": [],
@ -95,7 +95,7 @@ java_library {
bazel_module: { bp2build_available: false },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("java_plugin", "java-plug-1", AttrNameToString{
MakeBazelTarget("java_plugin", "java-plug-1", AttrNameToString{
"target_compatible_with": `select({
"//build/bazel/platforms/os:android": ["@platforms//:incompatible"],
"//conditions:default": [],

View file

@ -70,7 +70,7 @@ func TestJavaProto(t *testing.T) {
srcs: ["a.proto"],
}`
protoLibrary := makeBazelTarget("proto_library", "java-protos_proto", AttrNameToString{
protoLibrary := MakeBazelTarget("proto_library", "java-protos_proto", AttrNameToString{
"srcs": `["a.proto"]`,
})
@ -82,13 +82,13 @@ func TestJavaProto(t *testing.T) {
Blueprint: fmt.Sprintf(bp, tc.protoType),
ExpectedBazelTargets: []string{
protoLibrary,
makeBazelTarget(
MakeBazelTarget(
tc.javaLibraryType,
javaLibraryName,
AttrNameToString{
"deps": `[":java-protos_proto"]`,
}),
makeBazelTarget("java_library", "java-protos", AttrNameToString{
MakeBazelTarget("java_library", "java-protos", AttrNameToString{
"exports": fmt.Sprintf(`[":%s"]`, javaLibraryName),
}),
},
@ -106,16 +106,16 @@ func TestJavaProtoDefault(t *testing.T) {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("proto_library", "java-protos_proto", AttrNameToString{
MakeBazelTarget("proto_library", "java-protos_proto", AttrNameToString{
"srcs": `["a.proto"]`,
}),
makeBazelTarget(
MakeBazelTarget(
"java_lite_proto_library",
"java-protos_java_proto_lite",
AttrNameToString{
"deps": `[":java-protos_proto"]`,
}),
makeBazelTarget("java_library", "java-protos", AttrNameToString{
MakeBazelTarget("java_library", "java-protos", AttrNameToString{
"exports": `[":java-protos_java_proto_lite"]`,
"javacopts": `["-source 1.7 -target 1.7"]`,
}),

View file

@ -37,7 +37,7 @@ linker_config {
src: "a.json",
}
`,
ExpectedBazelTargets: []string{makeBazelTarget("linker_config", "foo", AttrNameToString{
ExpectedBazelTargets: []string{MakeBazelTarget("linker_config", "foo", AttrNameToString{
"src": `"a.json"`,
})},
})

View file

@ -45,7 +45,7 @@ prebuilt_etc {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("prebuilt_file", "apex_tz_version", AttrNameToString{
MakeBazelTarget("prebuilt_file", "apex_tz_version", AttrNameToString{
"filename": `"tz_version"`,
"installable": `False`,
"src": `"version/tz_version"`,
@ -75,7 +75,7 @@ prebuilt_etc {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("prebuilt_file", "apex_tz_version", AttrNameToString{
MakeBazelTarget("prebuilt_file", "apex_tz_version", AttrNameToString{
"filename": `"tz_version"`,
"installable": `False`,
"src": `select({
@ -114,7 +114,7 @@ prebuilt_etc {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("prebuilt_file", "apex_tz_version", AttrNameToString{
MakeBazelTarget("prebuilt_file", "apex_tz_version", AttrNameToString{
"filename": `"tz_version"`,
"installable": `False`,
"src": `select({
@ -153,7 +153,7 @@ prebuilt_usr_share {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("prebuilt_file", "apex_tz_version", AttrNameToString{
MakeBazelTarget("prebuilt_file", "apex_tz_version", AttrNameToString{
"filename": `"tz_version"`,
"installable": `False`,
"src": `"version/tz_version"`,
@ -174,7 +174,7 @@ prebuilt_etc {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("prebuilt_file", "apex_tz_version", AttrNameToString{
MakeBazelTarget("prebuilt_file", "apex_tz_version", AttrNameToString{
"filename": `"tz_version"`,
"installable": `False`,
"src": `"version/tz_version"`,

View file

@ -42,7 +42,7 @@ func TestPythonBinaryHostSimple(t *testing.T) {
bazel_module: { bp2build_available: false },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("py_binary", "foo", AttrNameToString{
MakeBazelTarget("py_binary", "foo", AttrNameToString{
"data": `["files/data.txt"]`,
"deps": `[":bar"]`,
"main": `"a.py"`,
@ -82,7 +82,7 @@ func TestPythonBinaryHostPy2(t *testing.T) {
}
`,
ExpectedBazelTargets: []string{
makeBazelTarget("py_binary", "foo", AttrNameToString{
MakeBazelTarget("py_binary", "foo", AttrNameToString{
"python_version": `"PY2"`,
"imports": `["."]`,
"srcs": `["a.py"]`,
@ -117,7 +117,7 @@ func TestPythonBinaryHostPy3(t *testing.T) {
`,
ExpectedBazelTargets: []string{
// python_version is PY3 by default.
makeBazelTarget("py_binary", "foo", AttrNameToString{
MakeBazelTarget("py_binary", "foo", AttrNameToString{
"imports": `["."]`,
"srcs": `["a.py"]`,
"target_compatible_with": `select({
@ -150,7 +150,7 @@ func TestPythonBinaryHostArchVariance(t *testing.T) {
},
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("py_binary", "foo-arm", AttrNameToString{
MakeBazelTarget("py_binary", "foo-arm", AttrNameToString{
"imports": `["."]`,
"srcs": `select({
"//build/bazel/platforms/arch:arm": ["arm.py"],

View file

@ -35,7 +35,7 @@ func convertPythonLibTestCaseToBp2build_Host(tc pythonLibBp2BuildTestCase) Bp2bu
func convertPythonLibTestCaseToBp2build(tc pythonLibBp2BuildTestCase) Bp2buildTestCase {
var bp2BuildTargets []string
for _, t := range tc.expectedBazelTargets {
bp2BuildTargets = append(bp2BuildTargets, makeBazelTarget(t.typ, t.name, t.attrs))
bp2BuildTargets = append(bp2BuildTargets, MakeBazelTarget(t.typ, t.name, t.attrs))
}
// Copy the filesystem so that we can change stuff in it later without it
// affecting the original pythonLibBp2BuildTestCase

View file

@ -66,7 +66,7 @@ func TestShBinarySimple(t *testing.T) {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("sh_binary", "foo", AttrNameToString{
MakeBazelTarget("sh_binary", "foo", AttrNameToString{
"srcs": `["foo.sh"]`,
"filename": `"foo.exe"`,
"sub_dir": `"sub"`,
@ -85,7 +85,7 @@ func TestShBinaryDefaults(t *testing.T) {
bazel_module: { bp2build_available: true },
}`,
ExpectedBazelTargets: []string{
makeBazelTarget("sh_binary", "foo", AttrNameToString{
MakeBazelTarget("sh_binary", "foo", AttrNameToString{
"srcs": `["foo.sh"]`,
})},
})

View file

@ -444,6 +444,6 @@ func MakeBazelTargetNoRestrictions(typ, name string, attrs AttrNameToString) str
// makeBazelTargetNoRestrictions returns bazel target build file definition that is device specific
// as this is the most common default in Soong.
func makeBazelTarget(typ, name string, attrs AttrNameToString) string {
func MakeBazelTarget(typ, name string, attrs AttrNameToString) string {
return makeBazelTargetHostOrDevice(typ, name, attrs, android.DeviceSupported)
}