Enable bp2build for cc modules relying on sysprop
Bug: 244439349
Test: m bp2build
Test: Inspect BUILD.bazel files
Test: Unit tests
Change-Id: I85bfb9fa69cb3f96b15bdbeb797dba86b3349804
diff --git a/bp2build/cc_binary_conversion_test.go b/bp2build/cc_binary_conversion_test.go
index 1c9fba2..c23779e 100644
--- a/bp2build/cc_binary_conversion_test.go
+++ b/bp2build/cc_binary_conversion_test.go
@@ -676,3 +676,77 @@
},
})
}
+
+func TestCcBinaryWithSyspropSrcs(t *testing.T) {
+ runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
+ description: "cc_binary with sysprop sources",
+ blueprint: `
+{rule_name} {
+ name: "foo",
+ srcs: [
+ "bar.sysprop",
+ "baz.sysprop",
+ "blah.cpp",
+ ],
+ min_sdk_version: "5",
+}`,
+ targets: []testBazelTarget{
+ {"sysprop_library", "foo_sysprop_library", AttrNameToString{
+ "srcs": `[
+ "bar.sysprop",
+ "baz.sysprop",
+ ]`,
+ }},
+ {"cc_sysprop_library_static", "foo_cc_sysprop_library_static", AttrNameToString{
+ "dep": `":foo_sysprop_library"`,
+ "min_sdk_version": `"5"`,
+ }},
+ {"cc_binary", "foo", AttrNameToString{
+ "srcs": `["blah.cpp"]`,
+ "local_includes": `["."]`,
+ "min_sdk_version": `"5"`,
+ "whole_archive_deps": `[":foo_cc_sysprop_library_static"]`,
+ }},
+ },
+ })
+}
+
+func TestCcBinaryWithSyspropSrcsSomeConfigs(t *testing.T) {
+ runCcBinaryTestCase(t, ccBinaryBp2buildTestCase{
+ description: "cc_binary with sysprop sources in some configs but not others",
+ blueprint: `
+{rule_name} {
+ name: "foo",
+ srcs: [
+ "blah.cpp",
+ ],
+ target: {
+ android: {
+ srcs: ["bar.sysprop"],
+ },
+ },
+ min_sdk_version: "5",
+}`,
+ targets: []testBazelTarget{
+ {"sysprop_library", "foo_sysprop_library", AttrNameToString{
+ "srcs": `select({
+ "//build/bazel/platforms/os:android": ["bar.sysprop"],
+ "//conditions:default": [],
+ })`,
+ }},
+ {"cc_sysprop_library_static", "foo_cc_sysprop_library_static", AttrNameToString{
+ "dep": `":foo_sysprop_library"`,
+ "min_sdk_version": `"5"`,
+ }},
+ {"cc_binary", "foo", AttrNameToString{
+ "srcs": `["blah.cpp"]`,
+ "local_includes": `["."]`,
+ "min_sdk_version": `"5"`,
+ "whole_archive_deps": `select({
+ "//build/bazel/platforms/os:android": [":foo_cc_sysprop_library_static"],
+ "//conditions:default": [],
+ })`,
+ }},
+ },
+ })
+}
diff --git a/bp2build/cc_library_conversion_test.go b/bp2build/cc_library_conversion_test.go
index f581706..c26ffa7 100644
--- a/bp2build/cc_library_conversion_test.go
+++ b/bp2build/cc_library_conversion_test.go
@@ -3132,3 +3132,97 @@
},
})
}
+
+func TestCcLibraryWithSyspropSrcs(t *testing.T) {
+ runCcLibraryTestCase(t, Bp2buildTestCase{
+ Description: "cc_library with sysprop sources",
+ ModuleTypeUnderTest: "cc_library",
+ ModuleTypeUnderTestFactory: cc.LibraryFactory,
+ Blueprint: `
+cc_library {
+ name: "foo",
+ srcs: [
+ "bar.sysprop",
+ "baz.sysprop",
+ "blah.cpp",
+ ],
+ min_sdk_version: "5",
+}`,
+ ExpectedBazelTargets: []string{
+ MakeBazelTarget("sysprop_library", "foo_sysprop_library", AttrNameToString{
+ "srcs": `[
+ "bar.sysprop",
+ "baz.sysprop",
+ ]`,
+ }),
+ MakeBazelTarget("cc_sysprop_library_static", "foo_cc_sysprop_library_static", AttrNameToString{
+ "dep": `":foo_sysprop_library"`,
+ "min_sdk_version": `"5"`,
+ }),
+ MakeBazelTarget("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
+ "srcs": `["blah.cpp"]`,
+ "local_includes": `["."]`,
+ "min_sdk_version": `"5"`,
+ "whole_archive_deps": `[":foo_cc_sysprop_library_static"]`,
+ }),
+ MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
+ "srcs": `["blah.cpp"]`,
+ "local_includes": `["."]`,
+ "min_sdk_version": `"5"`,
+ "whole_archive_deps": `[":foo_cc_sysprop_library_static"]`,
+ }),
+ },
+ })
+}
+
+func TestCcLibraryWithSyspropSrcsSomeConfigs(t *testing.T) {
+ runCcLibraryTestCase(t, Bp2buildTestCase{
+ Description: "cc_library with sysprop sources in some configs but not others",
+ ModuleTypeUnderTest: "cc_library",
+ ModuleTypeUnderTestFactory: cc.LibraryFactory,
+ Blueprint: `
+cc_library {
+ name: "foo",
+ host_supported: true,
+ srcs: [
+ "blah.cpp",
+ ],
+ target: {
+ android: {
+ srcs: ["bar.sysprop"],
+ },
+ },
+ min_sdk_version: "5",
+}`,
+ ExpectedBazelTargets: []string{
+ MakeBazelTargetNoRestrictions("sysprop_library", "foo_sysprop_library", AttrNameToString{
+ "srcs": `select({
+ "//build/bazel/platforms/os:android": ["bar.sysprop"],
+ "//conditions:default": [],
+ })`,
+ }),
+ MakeBazelTargetNoRestrictions("cc_sysprop_library_static", "foo_cc_sysprop_library_static", AttrNameToString{
+ "dep": `":foo_sysprop_library"`,
+ "min_sdk_version": `"5"`,
+ }),
+ MakeBazelTargetNoRestrictions("cc_library_static", "foo_bp2build_cc_library_static", AttrNameToString{
+ "srcs": `["blah.cpp"]`,
+ "local_includes": `["."]`,
+ "min_sdk_version": `"5"`,
+ "whole_archive_deps": `select({
+ "//build/bazel/platforms/os:android": [":foo_cc_sysprop_library_static"],
+ "//conditions:default": [],
+ })`,
+ }),
+ MakeBazelTargetNoRestrictions("cc_library_shared", "foo", AttrNameToString{
+ "srcs": `["blah.cpp"]`,
+ "local_includes": `["."]`,
+ "min_sdk_version": `"5"`,
+ "whole_archive_deps": `select({
+ "//build/bazel/platforms/os:android": [":foo_cc_sysprop_library_static"],
+ "//conditions:default": [],
+ })`,
+ }),
+ },
+ })
+}
diff --git a/bp2build/cc_library_shared_conversion_test.go b/bp2build/cc_library_shared_conversion_test.go
index 6aa8ebe..6116aee 100644
--- a/bp2build/cc_library_shared_conversion_test.go
+++ b/bp2build/cc_library_shared_conversion_test.go
@@ -718,3 +718,77 @@
},
})
}
+
+func TestCcLibrarySharedWithSyspropSrcs(t *testing.T) {
+ runCcLibrarySharedTestCase(t, Bp2buildTestCase{
+ Description: "cc_library_shared with sysprop sources",
+ Blueprint: `
+cc_library_shared {
+ name: "foo",
+ srcs: [
+ "bar.sysprop",
+ "baz.sysprop",
+ "blah.cpp",
+ ],
+ min_sdk_version: "5",
+}`,
+ ExpectedBazelTargets: []string{
+ MakeBazelTarget("sysprop_library", "foo_sysprop_library", AttrNameToString{
+ "srcs": `[
+ "bar.sysprop",
+ "baz.sysprop",
+ ]`,
+ }),
+ MakeBazelTarget("cc_sysprop_library_static", "foo_cc_sysprop_library_static", AttrNameToString{
+ "dep": `":foo_sysprop_library"`,
+ "min_sdk_version": `"5"`,
+ }),
+ MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
+ "srcs": `["blah.cpp"]`,
+ "local_includes": `["."]`,
+ "min_sdk_version": `"5"`,
+ "whole_archive_deps": `[":foo_cc_sysprop_library_static"]`,
+ }),
+ },
+ })
+}
+
+func TestCcLibrarySharedWithSyspropSrcsSomeConfigs(t *testing.T) {
+ runCcLibrarySharedTestCase(t, Bp2buildTestCase{
+ Description: "cc_library_shared with sysprop sources in some configs but not others",
+ Blueprint: `
+cc_library_shared {
+ name: "foo",
+ srcs: [
+ "blah.cpp",
+ ],
+ target: {
+ android: {
+ srcs: ["bar.sysprop"],
+ },
+ },
+ min_sdk_version: "5",
+}`,
+ ExpectedBazelTargets: []string{
+ MakeBazelTarget("sysprop_library", "foo_sysprop_library", AttrNameToString{
+ "srcs": `select({
+ "//build/bazel/platforms/os:android": ["bar.sysprop"],
+ "//conditions:default": [],
+ })`,
+ }),
+ MakeBazelTarget("cc_sysprop_library_static", "foo_cc_sysprop_library_static", AttrNameToString{
+ "dep": `":foo_sysprop_library"`,
+ "min_sdk_version": `"5"`,
+ }),
+ MakeBazelTarget("cc_library_shared", "foo", AttrNameToString{
+ "srcs": `["blah.cpp"]`,
+ "local_includes": `["."]`,
+ "min_sdk_version": `"5"`,
+ "whole_archive_deps": `select({
+ "//build/bazel/platforms/os:android": [":foo_cc_sysprop_library_static"],
+ "//conditions:default": [],
+ })`,
+ }),
+ },
+ })
+}
diff --git a/bp2build/cc_library_static_conversion_test.go b/bp2build/cc_library_static_conversion_test.go
index 37722ed..e3ea9a0 100644
--- a/bp2build/cc_library_static_conversion_test.go
+++ b/bp2build/cc_library_static_conversion_test.go
@@ -1629,3 +1629,77 @@
},
})
}
+
+func TestCcLibraryStaticWithSyspropSrcs(t *testing.T) {
+ runCcLibraryTestCase(t, Bp2buildTestCase{
+ Description: "cc_library_static with sysprop sources",
+ Blueprint: `
+cc_library_static {
+ name: "foo",
+ srcs: [
+ "bar.sysprop",
+ "baz.sysprop",
+ "blah.cpp",
+ ],
+ min_sdk_version: "5",
+}`,
+ ExpectedBazelTargets: []string{
+ MakeBazelTarget("sysprop_library", "foo_sysprop_library", AttrNameToString{
+ "srcs": `[
+ "bar.sysprop",
+ "baz.sysprop",
+ ]`,
+ }),
+ MakeBazelTarget("cc_sysprop_library_static", "foo_cc_sysprop_library_static", AttrNameToString{
+ "dep": `":foo_sysprop_library"`,
+ "min_sdk_version": `"5"`,
+ }),
+ MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
+ "srcs": `["blah.cpp"]`,
+ "local_includes": `["."]`,
+ "min_sdk_version": `"5"`,
+ "whole_archive_deps": `[":foo_cc_sysprop_library_static"]`,
+ }),
+ },
+ })
+}
+
+func TestCcLibraryStaticWithSyspropSrcsSomeConfigs(t *testing.T) {
+ runCcLibraryTestCase(t, Bp2buildTestCase{
+ Description: "cc_library_static with sysprop sources in some configs but not others",
+ Blueprint: `
+cc_library_static {
+ name: "foo",
+ srcs: [
+ "blah.cpp",
+ ],
+ target: {
+ android: {
+ srcs: ["bar.sysprop"],
+ },
+ },
+ min_sdk_version: "5",
+}`,
+ ExpectedBazelTargets: []string{
+ MakeBazelTarget("sysprop_library", "foo_sysprop_library", AttrNameToString{
+ "srcs": `select({
+ "//build/bazel/platforms/os:android": ["bar.sysprop"],
+ "//conditions:default": [],
+ })`,
+ }),
+ MakeBazelTarget("cc_sysprop_library_static", "foo_cc_sysprop_library_static", AttrNameToString{
+ "dep": `":foo_sysprop_library"`,
+ "min_sdk_version": `"5"`,
+ }),
+ MakeBazelTarget("cc_library_static", "foo", AttrNameToString{
+ "srcs": `["blah.cpp"]`,
+ "local_includes": `["."]`,
+ "min_sdk_version": `"5"`,
+ "whole_archive_deps": `select({
+ "//build/bazel/platforms/os:android": [":foo_cc_sysprop_library_static"],
+ "//conditions:default": [],
+ })`,
+ }),
+ },
+ })
+}
diff --git a/cc/Android.bp b/cc/Android.bp
index 91a3fb0..8860f78 100644
--- a/cc/Android.bp
+++ b/cc/Android.bp
@@ -45,6 +45,7 @@
"snapshot_utils.go",
"stl.go",
"strip.go",
+ "sysprop.go",
"tidy.go",
"util.go",
"vendor_snapshot.go",
diff --git a/cc/bp2build.go b/cc/bp2build.go
index 95ac598..972a828 100644
--- a/cc/bp2build.go
+++ b/cc/bp2build.go
@@ -28,14 +28,15 @@
)
const (
- cSrcPartition = "c"
- asSrcPartition = "as"
- asmSrcPartition = "asm"
- lSrcPartition = "l"
- llSrcPartition = "ll"
- cppSrcPartition = "cpp"
- protoSrcPartition = "proto"
- aidlSrcPartition = "aidl"
+ cSrcPartition = "c"
+ asSrcPartition = "as"
+ asmSrcPartition = "asm"
+ lSrcPartition = "l"
+ llSrcPartition = "ll"
+ cppSrcPartition = "cpp"
+ protoSrcPartition = "proto"
+ aidlSrcPartition = "aidl"
+ syspropSrcPartition = "sysprop"
stubsSuffix = "_stub_libs_current"
)
@@ -104,7 +105,8 @@
llSrcPartition: bazel.LabelPartition{Extensions: []string{".ll"}},
// C++ is the "catch-all" group, and comprises generated sources because we don't
// know the language of these sources until the genrule is executed.
- cppSrcPartition: bazel.LabelPartition{Extensions: []string{".cpp", ".cc", ".cxx", ".mm"}, LabelMapper: addSuffixForFilegroup("_cpp_srcs"), Keep_remainder: true},
+ cppSrcPartition: bazel.LabelPartition{Extensions: []string{".cpp", ".cc", ".cxx", ".mm"}, LabelMapper: addSuffixForFilegroup("_cpp_srcs"), Keep_remainder: true},
+ syspropSrcPartition: bazel.LabelPartition{Extensions: []string{".sysprop"}},
}
return bazel.PartitionLabelListAttribute(ctx, &srcs, labels)
@@ -320,6 +322,9 @@
llSrcs bazel.LabelListAttribute
lexopts bazel.StringListAttribute
+ // Sysprop sources
+ syspropSrcs bazel.LabelListAttribute
+
hdrs bazel.LabelListAttribute
rtti bazel.BoolAttribute
@@ -482,6 +487,7 @@
ca.asmSrcs = partitionedSrcs[asmSrcPartition]
ca.lSrcs = partitionedSrcs[lSrcPartition]
ca.llSrcs = partitionedSrcs[llSrcPartition]
+ ca.syspropSrcs = partitionedSrcs[syspropSrcPartition]
ca.absoluteIncludes.DeduplicateAxesFromBase()
ca.localIncludes.DeduplicateAxesFromBase()
@@ -734,6 +740,10 @@
(&compilerAttrs).srcs.Add(&convertedLSrcs.srcName)
(&compilerAttrs).cSrcs.Add(&convertedLSrcs.cSrcName)
+ if !compilerAttrs.syspropSrcs.IsEmpty() {
+ (&linkerAttrs).wholeArchiveDeps.Add(bp2buildCcSysprop(ctx, module.Name(), module.Properties.Min_sdk_version, compilerAttrs.syspropSrcs))
+ }
+
features := compilerAttrs.features.Clone().Append(linkerAttrs.features)
features.DeduplicateAxesFromBase()
@@ -1208,10 +1218,14 @@
return exported
}
+func BazelLabelNameForStaticModule(baseLabel string) string {
+ return baseLabel + "_bp2build_cc_library_static"
+}
+
func bazelLabelForStaticModule(ctx android.BazelConversionPathContext, m blueprint.Module) string {
label := android.BazelModuleLabel(ctx, m)
if ccModule, ok := m.(*Module); ok && ccModule.typ() == fullLibrary && !android.GetBp2BuildAllowList().GenerateCcLibraryStaticOnly(m.Name()) {
- label += "_bp2build_cc_library_static"
+ return BazelLabelNameForStaticModule(label)
}
return label
}
diff --git a/cc/gen.go b/cc/gen.go
index 08b49c9..dfbb177 100644
--- a/cc/gen.go
+++ b/cc/gen.go
@@ -229,6 +229,34 @@
return cppFile, headers.Paths()
}
+func bp2buildCcSysprop(ctx android.Bp2buildMutatorContext, moduleName string, minSdkVersion *string, srcs bazel.LabelListAttribute) *bazel.LabelAttribute {
+ labels := SyspropLibraryLabels{
+ SyspropLibraryLabel: moduleName + "_sysprop_library",
+ StaticLibraryLabel: moduleName + "_cc_sysprop_library_static",
+ }
+ Bp2buildSysprop(ctx, labels, srcs, minSdkVersion)
+ return createLabelAttributeCorrespondingToSrcs(":"+labels.StaticLibraryLabel, srcs)
+}
+
+// Creates a LabelAttribute for a given label where the value is only set for
+// the same config values that have values in a given LabelListAttribute
+func createLabelAttributeCorrespondingToSrcs(baseLabelName string, srcs bazel.LabelListAttribute) *bazel.LabelAttribute {
+ baseLabel := bazel.Label{Label: baseLabelName}
+ label := bazel.LabelAttribute{}
+ if !srcs.Value.IsNil() && !srcs.Value.IsEmpty() {
+ label.Value = &baseLabel
+ return &label
+ }
+ for axis, configToSrcs := range srcs.ConfigurableValues {
+ for config, val := range configToSrcs {
+ if !val.IsNil() && !val.IsEmpty() {
+ label.SetSelectValue(axis, config, baseLabel)
+ }
+ }
+ }
+ return &label
+}
+
// Used to communicate information from the genSources method back to the library code that uses
// it.
type generatedSourceInfo struct {
diff --git a/cc/sysprop.go b/cc/sysprop.go
new file mode 100644
index 0000000..2b1e354
--- /dev/null
+++ b/cc/sysprop.go
@@ -0,0 +1,71 @@
+// Copyright (C) 2019 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package cc
+
+import (
+ "android/soong/android"
+ "android/soong/bazel"
+)
+
+// TODO(b/240463568): Additional properties will be added for API validation
+type bazelSyspropLibraryAttributes struct {
+ Srcs bazel.LabelListAttribute
+}
+
+type bazelCcSyspropLibraryAttributes struct {
+ Dep bazel.LabelAttribute
+ Min_sdk_version *string
+}
+
+type SyspropLibraryLabels struct {
+ SyspropLibraryLabel string
+ SharedLibraryLabel string
+ StaticLibraryLabel string
+}
+
+func Bp2buildSysprop(ctx android.Bp2buildMutatorContext, labels SyspropLibraryLabels, srcs bazel.LabelListAttribute, minSdkVersion *string) {
+ ctx.CreateBazelTargetModule(
+ bazel.BazelTargetModuleProperties{
+ Rule_class: "sysprop_library",
+ Bzl_load_location: "//build/bazel/rules/sysprop:sysprop_library.bzl",
+ },
+ android.CommonAttributes{Name: labels.SyspropLibraryLabel},
+ &bazelSyspropLibraryAttributes{
+ Srcs: srcs,
+ })
+
+ attrs := &bazelCcSyspropLibraryAttributes{
+ Dep: *bazel.MakeLabelAttribute(":" + labels.SyspropLibraryLabel),
+ Min_sdk_version: minSdkVersion,
+ }
+
+ if labels.SharedLibraryLabel != "" {
+ ctx.CreateBazelTargetModule(
+ bazel.BazelTargetModuleProperties{
+ Rule_class: "cc_sysprop_library_shared",
+ Bzl_load_location: "//build/bazel/rules/cc:cc_sysprop_library.bzl",
+ },
+ android.CommonAttributes{Name: labels.SharedLibraryLabel},
+ attrs)
+ }
+
+ ctx.CreateBazelTargetModule(
+ bazel.BazelTargetModuleProperties{
+ Rule_class: "cc_sysprop_library_static",
+ Bzl_load_location: "//build/bazel/rules/cc:cc_sysprop_library.bzl",
+ },
+ android.CommonAttributes{Name: labels.StaticLibraryLabel},
+ attrs)
+}
diff --git a/sysprop/sysprop_library.go b/sysprop/sysprop_library.go
index 578dc2b..1f0d28d 100644
--- a/sysprop/sysprop_library.go
+++ b/sysprop/sysprop_library.go
@@ -573,43 +573,14 @@
}
// TODO(b/240463568): Additional properties will be added for API validation
-type bazelSyspropLibraryAttributes struct {
- Srcs bazel.LabelListAttribute
-}
-
-type bazelCcSyspropLibraryAttributes struct {
- Dep bazel.LabelAttribute
- Min_sdk_version *string
-}
-
func (m *syspropLibrary) ConvertWithBp2build(ctx android.TopDownMutatorContext) {
- ctx.CreateBazelTargetModule(
- bazel.BazelTargetModuleProperties{
- Rule_class: "sysprop_library",
- Bzl_load_location: "//build/bazel/rules/sysprop:sysprop_library.bzl",
- },
- android.CommonAttributes{Name: m.Name()},
- &bazelSyspropLibraryAttributes{
- Srcs: bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrc(ctx, m.properties.Srcs)),
- })
-
- attrs := &bazelCcSyspropLibraryAttributes{
- Dep: *bazel.MakeLabelAttribute(":" + m.Name()),
- Min_sdk_version: m.properties.Cpp.Min_sdk_version,
+ labels := cc.SyspropLibraryLabels{
+ SyspropLibraryLabel: m.BaseModuleName(),
+ SharedLibraryLabel: m.CcImplementationModuleName(),
+ StaticLibraryLabel: cc.BazelLabelNameForStaticModule(m.CcImplementationModuleName()),
}
-
- ctx.CreateBazelTargetModule(
- bazel.BazelTargetModuleProperties{
- Rule_class: "cc_sysprop_library_shared",
- Bzl_load_location: "//build/bazel/rules/cc:cc_sysprop_library.bzl",
- },
- android.CommonAttributes{Name: m.CcImplementationModuleName()},
- attrs)
- ctx.CreateBazelTargetModule(
- bazel.BazelTargetModuleProperties{
- Rule_class: "cc_sysprop_library_static",
- Bzl_load_location: "//build/bazel/rules/cc:cc_sysprop_library.bzl",
- },
- android.CommonAttributes{Name: m.CcImplementationModuleName() + "_bp2build_cc_library_static"},
- attrs)
+ cc.Bp2buildSysprop(ctx,
+ labels,
+ bazel.MakeLabelListAttribute(android.BazelLabelForModuleSrc(ctx, m.properties.Srcs)),
+ m.properties.Cpp.Min_sdk_version)
}
diff --git a/sysprop/sysprop_library_conversion_test.go b/sysprop/sysprop_library_conversion_test.go
index c72faf3..89adf7d 100644
--- a/sysprop/sysprop_library_conversion_test.go
+++ b/sysprop/sysprop_library_conversion_test.go
@@ -41,7 +41,7 @@
`,
ExpectedBazelTargets: []string{
bp2build.MakeBazelTargetNoRestrictions("sysprop_library",
- "sysprop_foo_sysprop_library",
+ "sysprop_foo",
bp2build.AttrNameToString{
"srcs": `[
"foo.sysprop",
@@ -51,12 +51,12 @@
bp2build.MakeBazelTargetNoRestrictions("cc_sysprop_library_shared",
"libsysprop_foo",
bp2build.AttrNameToString{
- "dep": `":sysprop_foo_sysprop_library"`,
+ "dep": `":sysprop_foo"`,
}),
bp2build.MakeBazelTargetNoRestrictions("cc_sysprop_library_static",
"libsysprop_foo_bp2build_cc_library_static",
bp2build.AttrNameToString{
- "dep": `":sysprop_foo_sysprop_library"`,
+ "dep": `":sysprop_foo"`,
}),
},
})
@@ -86,7 +86,7 @@
`,
ExpectedBazelTargets: []string{
bp2build.MakeBazelTargetNoRestrictions("sysprop_library",
- "sysprop_foo_sysprop_library",
+ "sysprop_foo",
bp2build.AttrNameToString{
"srcs": `[
"foo.sysprop",
@@ -96,13 +96,13 @@
bp2build.MakeBazelTargetNoRestrictions("cc_sysprop_library_shared",
"libsysprop_foo",
bp2build.AttrNameToString{
- "dep": `":sysprop_foo_sysprop_library"`,
+ "dep": `":sysprop_foo"`,
"min_sdk_version": `"5"`,
}),
bp2build.MakeBazelTargetNoRestrictions("cc_sysprop_library_static",
"libsysprop_foo_bp2build_cc_library_static",
bp2build.AttrNameToString{
- "dep": `":sysprop_foo_sysprop_library"`,
+ "dep": `":sysprop_foo"`,
"min_sdk_version": `"5"`,
}),
},