Rename prebuilt_library_* to cc_prebuilt_library_*

Follow the convention of everything else in `cc`

Test: CI
Change-Id: I133d0b7119d4e9b357aada3467bc079f20dc0f60
This commit is contained in:
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux 2022-10-17 14:48:57 +00:00
parent a9e1df1522
commit c5184ec089
4 changed files with 22 additions and 22 deletions

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("cc_prebuilt_library_static", "libtest_bp2build_cc_library_static", AttrNameToString{
"static_library": `"libf.so"`,
}),
MakeBazelTarget("prebuilt_library_shared", "libtest", AttrNameToString{
MakeBazelTarget("cc_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("cc_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("cc_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("cc_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("cc_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("cc_prebuilt_library_static", "libtest_bp2build_cc_library_static", AttrNameToString{
"static_library": `"libf.so"`,
}),
MakeBazelTarget("prebuilt_library_shared", "libtest", AttrNameToString{
MakeBazelTarget("cc_prebuilt_library_shared", "libtest", AttrNameToString{
"shared_library": `"libg.so"`,
}),
},
@ -215,7 +215,7 @@ cc_prebuilt_library {
// bazel_module: { bp2build_available: true },
//}`,
// expectedBazelTargets: []string{
// makeBazelTarget("prebuilt_library_shared", "libtest", attrNameToString{
// makeBazelTarget("cc_prebuilt_library_shared", "libtest", attrNameToString{
// "shared_library": `"libf.so"`,
// }),
// },
@ -242,7 +242,7 @@ cc_prebuilt_library {
// bazel_module: { bp2build_available: true },
//}`,
// expectedBazelTargets: []string{
// makeBazelTarget("prebuilt_library_static", "libtest_bp2build_cc_library_static", attrNameToString{
// makeBazelTarget("cc_prebuilt_library_static", "libtest_bp2build_cc_library_static", attrNameToString{
// "static_library": `"libf.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("cc_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("cc_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("cc_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("cc_prebuilt_library_static", "libtest", AttrNameToString{
"static_library": `select({
"//build/bazel/platforms/arch:arm": "libg.so",
"//build/bazel/platforms/arch:arm64": "libf.so",

View file

@ -358,12 +358,12 @@ type bazelPrebuiltLibraryStaticAttributes struct {
// TODO(b/228623543): The below is not entirely true until the bug is fixed. For now, both targets are always generated
// Implements bp2build for cc_prebuilt_library modules. This will generate:
// - Only a prebuilt_library_static if the shared.enabled property is set to false across all variants.
// - Only a prebuilt_library_shared if the static.enabled property is set to false across all variants
// - Both a prebuilt_library_static and prebuilt_library_shared if the aforementioned properties are not false across
// - Only a cc_prebuilt_library_static if the shared.enabled property is set to false across all variants.
// - Only a cc_prebuilt_library_shared if the static.enabled property is set to false across all variants
// - Both a cc_prebuilt_library_static and cc_prebuilt_library_shared if the aforementioned properties are not false across
// all variants
//
// In all cases, prebuilt_library_static target names will be appended with "_bp2build_cc_library_static".
// In all cases, cc_prebuilt_library_static target names will be appended with "_bp2build_cc_library_static".
func prebuiltLibraryBp2Build(ctx android.TopDownMutatorContext, module *Module) {
prebuiltLibraryStaticBp2Build(ctx, module, true)
prebuiltLibrarySharedBp2Build(ctx, module)
@ -380,8 +380,8 @@ func prebuiltLibraryStaticBp2Build(ctx android.TopDownMutatorContext, module *Mo
}
props := bazel.BazelTargetModuleProperties{
Rule_class: "prebuilt_library_static",
Bzl_load_location: "//build/bazel/rules/cc:prebuilt_library_static.bzl",
Rule_class: "cc_prebuilt_library_static",
Bzl_load_location: "//build/bazel/rules/cc:cc_prebuilt_library_static.bzl",
}
name := android.RemoveOptionalPrebuiltPrefix(module.Name())
@ -403,8 +403,8 @@ func prebuiltLibrarySharedBp2Build(ctx android.TopDownMutatorContext, module *Mo
}
props := bazel.BazelTargetModuleProperties{
Rule_class: "prebuilt_library_shared",
Bzl_load_location: "//build/bazel/rules/cc:prebuilt_library_shared.bzl",
Rule_class: "cc_prebuilt_library_shared",
Bzl_load_location: "//build/bazel/rules/cc:cc_prebuilt_library_shared.bzl",
}
name := android.RemoveOptionalPrebuiltPrefix(module.Name())