Merge "print module name on allowlist errors" into main am: 922e6adfd2
am: 2d7d8ba64e
am: fa670eeae5
am: f177c75e47
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2741113 Change-Id: I83367978ceac7abe83d34e15a928a2a866216fbf Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -533,13 +533,13 @@ func (b *BazelModuleBase) shouldConvertWithBp2build(ctx shouldConvertModuleConte
|
|||||||
moduleTypeAllowed := allowlist.moduleTypeAlwaysConvert[p.moduleType]
|
moduleTypeAllowed := allowlist.moduleTypeAlwaysConvert[p.moduleType]
|
||||||
allowlistConvert := moduleNameAllowed || moduleTypeAllowed
|
allowlistConvert := moduleNameAllowed || moduleTypeAllowed
|
||||||
if moduleNameAllowed && moduleTypeAllowed {
|
if moduleNameAllowed && moduleTypeAllowed {
|
||||||
ctx.ModuleErrorf("A module cannot be in moduleAlwaysConvert and also be in moduleTypeAlwaysConvert")
|
ctx.ModuleErrorf("A module %q of type %q cannot be in moduleAlwaysConvert and also be in moduleTypeAlwaysConvert", moduleName, p.moduleType)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if allowlist.moduleDoNotConvert[moduleName] {
|
if allowlist.moduleDoNotConvert[moduleName] {
|
||||||
if moduleNameAllowed {
|
if moduleNameAllowed {
|
||||||
ctx.ModuleErrorf("a module cannot be in moduleDoNotConvert and also be in moduleAlwaysConvert")
|
ctx.ModuleErrorf("a module %q cannot be in moduleDoNotConvert and also be in moduleAlwaysConvert", moduleName)
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@@ -252,7 +252,7 @@ func TestBp2BuildAllowlist(t *testing.T) {
|
|||||||
{
|
{
|
||||||
description: "module in name allowlist and type allowlist fails",
|
description: "module in name allowlist and type allowlist fails",
|
||||||
shouldConvert: false,
|
shouldConvert: false,
|
||||||
expectedErrors: []string{"A module cannot be in moduleAlwaysConvert and also be in moduleTypeAlwaysConvert"},
|
expectedErrors: []string{"A module \"foo\" of type \"rule1\" cannot be in moduleAlwaysConvert and also be in moduleTypeAlwaysConvert"},
|
||||||
module: TestBazelModule{
|
module: TestBazelModule{
|
||||||
TestModuleInfo: bazel.TestModuleInfo{
|
TestModuleInfo: bazel.TestModuleInfo{
|
||||||
ModuleName: "foo",
|
ModuleName: "foo",
|
||||||
@@ -273,7 +273,7 @@ func TestBp2BuildAllowlist(t *testing.T) {
|
|||||||
{
|
{
|
||||||
description: "module in allowlist and denylist fails",
|
description: "module in allowlist and denylist fails",
|
||||||
shouldConvert: false,
|
shouldConvert: false,
|
||||||
expectedErrors: []string{"a module cannot be in moduleDoNotConvert and also be in moduleAlwaysConvert"},
|
expectedErrors: []string{"a module \"foo\" cannot be in moduleDoNotConvert and also be in moduleAlwaysConvert"},
|
||||||
module: TestBazelModule{
|
module: TestBazelModule{
|
||||||
TestModuleInfo: bazel.TestModuleInfo{
|
TestModuleInfo: bazel.TestModuleInfo{
|
||||||
ModuleName: "foo",
|
ModuleName: "foo",
|
||||||
|
Reference in New Issue
Block a user