Use handcrafted build targets in bp2build

If both bp2build_available and label are specified, label will be
preferred.

Initially, we copy the entire BUILD.bazel file. Eventually we may move
this to use bazel query for a more accurate result.

Test: go test *
Test: build/bazel/scripts/milestone-2/demo.sh full
Test: GENERATE_BAZEL_FILES=true m nothing
      edit bionic/libc/tools/BUILD.bazel
      GENERATE_BAZEL_FILES=true m nothing and verify changes picked up
Bug: 180516554
Change-Id: I43025583300e6b10d2c18032cd4a76237b578d59
This commit is contained in:
Liz Kammer
2021-02-17 13:22:03 -05:00
parent ca5e611e0a
commit ba3ea16f14
12 changed files with 339 additions and 54 deletions

View File

@@ -19,21 +19,6 @@ import (
"sort"
)
type bazelModuleProperties struct {
// The label of the Bazel target replacing this Soong module.
Label string
// If true, bp2build will generate the converted Bazel target for this module.
Bp2build_available bool
}
// Properties contains common module properties for Bazel migration purposes.
type Properties struct {
// In USE_BAZEL_ANALYSIS=1 mode, this represents the Bazel target replacing
// this Soong module.
Bazel_module bazelModuleProperties
}
// BazelTargetModuleProperties contain properties and metadata used for
// Blueprint to BUILD file conversion.
type BazelTargetModuleProperties struct {