Always merge build files

Previous behavior:

- Packge not listed in bp2buildKeepExistingBuildFile:
    - Use bp2build generated build file
- Package listed in bp2buildKeepExistingBuildFile:
    - Use handcrafted build file even if there were allowlisted bp2build
      modules in the same package.
- Package listed in bp2buildKeepExistingBuildFile and a soong module has
  a bp2build: { label } attribute:
    - Merge the handcrafted and bp2build generated build files

New behavior:

- Packge not listed in bp2buildKeepExistingBuildFile:
    - Use bp2build generated build file
- Package listed in bp2buildKeepExistingBuildFile:
    - Merge with bp2build generated build file.

Bug: 234167862
Test: ./build/bazel/ci/bp2build.sh
Change-Id: Ifbaf4f8f0f5158b5b2bd6d534eb2311e2e5f399b
This commit is contained in:
Cole Faust
2022-08-23 15:29:05 -07:00
parent f9f9ed7cf1
commit 324a92e404
9 changed files with 171 additions and 148 deletions

View File

@@ -189,7 +189,7 @@ type config struct {
mockBpList string
BuildMode SoongBuildMode
bp2buildPackageConfig bp2BuildConversionAllowlist
Bp2buildPackageConfig Bp2BuildConversionAllowlist
Bp2buildSoongConfigDefinitions soongconfig.Bp2BuildSoongConfigDefinitions
// If testAllowNonExistentPaths is true then PathForSource and PathForModuleSrc won't error
@@ -482,7 +482,7 @@ func NewConfig(moduleListFile string, buildMode SoongBuildMode, runGoTests bool,
config.BuildMode = buildMode
config.BazelContext, err = NewBazelContext(config)
config.bp2buildPackageConfig = GetBp2BuildAllowList()
config.Bp2buildPackageConfig = GetBp2BuildAllowList()
return Config{config}, err
}