Merge "prevent module being enabled if in existing BUILD file" am: fe86b81aab
am: 6e826bab74
am: 6c5cab3cfc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1999892 Change-Id: I31724af2f66bd1fca8a8bd023348ccad348d480d
This commit is contained in:
@@ -679,14 +679,21 @@ func (b *BazelModuleBase) shouldConvertWithBp2build(ctx BazelConversionContext,
|
|||||||
}
|
}
|
||||||
|
|
||||||
packagePath := ctx.OtherModuleDir(module)
|
packagePath := ctx.OtherModuleDir(module)
|
||||||
config := ctx.Config().bp2buildPackageConfig
|
if alwaysConvert && ShouldKeepExistingBuildFileForDir(packagePath) {
|
||||||
|
ctx.(BaseModuleContext).ModuleErrorf("A module cannot be in a directory listed in bp2buildKeepExistingBuildFile"+
|
||||||
|
" and also be in bp2buildModuleAlwaysConvert. Directory: '%s'", packagePath)
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
config := ctx.Config().bp2buildPackageConfig
|
||||||
// This is a tristate value: true, false, or unset.
|
// This is a tristate value: true, false, or unset.
|
||||||
propValue := b.bazelProperties.Bazel_module.Bp2build_available
|
propValue := b.bazelProperties.Bazel_module.Bp2build_available
|
||||||
if bp2buildDefaultTrueRecursively(packagePath, config) {
|
if bp2buildDefaultTrueRecursively(packagePath, config) {
|
||||||
if alwaysConvert {
|
if alwaysConvert {
|
||||||
ctx.(BaseModuleContext).ModuleErrorf("a module cannot be in a directory marked Bp2BuildDefaultTrue" +
|
ctx.(BaseModuleContext).ModuleErrorf("A module cannot be in a directory marked Bp2BuildDefaultTrue"+
|
||||||
" or Bp2BuildDefaultTrueRecursively and also be in bp2buildModuleAlwaysConvert")
|
" or Bp2BuildDefaultTrueRecursively and also be in bp2buildModuleAlwaysConvert. Directory: '%s'",
|
||||||
|
packagePath)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allow modules to explicitly opt-out.
|
// Allow modules to explicitly opt-out.
|
||||||
|
Reference in New Issue
Block a user