Remove old BUILD file merging code

It's not needed anymore since aosp/2197837,
it should've been removed in that cl but I forgot.

Bug: 234167862
Test: ./build/bazel/ci/bp2build.sh
Change-Id: I3d67a6e1894ad401525070ad37d3158708898306
This commit is contained in:
Cole Faust
2022-08-31 14:48:26 -07:00
parent 52d9b95f54
commit ea602c5a41
5 changed files with 9 additions and 124 deletions

View File

@@ -295,6 +295,7 @@ var (
"external/bazel-skylib":/* recursive = */ true,
"external/guava":/* recursive = */ true,
"external/jsr305":/* recursive = */ true,
"external/protobuf":/* recursive = */ false,
"frameworks/ex/common":/* recursive = */ true,
"packages/apps/Music":/* recursive = */ true,
@@ -302,6 +303,7 @@ var (
"prebuilts/bazel":/* recursive = */ true,
"prebuilts/bundletool":/* recursive = */ true,
"prebuilts/clang/host/linux-x86":/* recursive = */ false,
"prebuilts/gcc":/* recursive = */ true,
"prebuilts/build-tools":/* recursive = */ true,
"prebuilts/jdk/jdk11":/* recursive = */ false,

View File

@@ -17,9 +17,6 @@ package android
import (
"bufio"
"errors"
"fmt"
"io/ioutil"
"path/filepath"
"strings"
"github.com/google/blueprint"
@@ -117,7 +114,6 @@ type Bazelable interface {
GetBazelLabel(ctx BazelConversionPathContext, module blueprint.Module) string
ShouldConvertWithBp2build(ctx BazelConversionContext) bool
shouldConvertWithBp2build(ctx bazelOtherModuleContext, module blueprint.Module) bool
GetBazelBuildFileContents(c Config, path, name string) (string, error)
ConvertWithBp2build(ctx TopDownMutatorContext)
// namespacedVariableProps is a map from a soong config variable namespace
@@ -498,28 +494,6 @@ func bp2buildDefaultTrueRecursively(packagePath string, config allowlists.Bp2Bui
return false, packagePath
}
// GetBazelBuildFileContents returns the file contents of a hand-crafted BUILD file if available or
// an error if there are errors reading the file.
// TODO(b/181575318): currently we append the whole BUILD file, let's change that to do
// something more targeted based on the rule type and target.
func (b *BazelModuleBase) GetBazelBuildFileContents(c Config, path, name string) (string, error) {
if !strings.Contains(b.HandcraftedLabel(), path) {
return "", fmt.Errorf("%q not found in bazel_module.label %q", path, b.HandcraftedLabel())
}
name = filepath.Join(path, name)
f, err := c.fs.Open(name)
if err != nil {
return "", err
}
defer f.Close()
data, err := ioutil.ReadAll(f)
if err != nil {
return "", err
}
return string(data[:]), nil
}
func registerBp2buildConversionMutator(ctx RegisterMutatorsContext) {
ctx.TopDown("bp2build_conversion", convertWithBp2build).Parallel()
}