Correct allowlisting for override modules
Prevoiusly, we were partially correcting for override modules in
bp2build/mixed builds in some but not all places. Now we always check
for override modules and ensure that Bazel_module properties are
propagated properly for override modules.
Bug: 279609939
Test: go test soong tests
Change-Id: I5445aa71f4c8013315415a2ca9ab9c6b3be6bce0
diff --git a/android/bazel.go b/android/bazel.go
index 58d9d87..3fe063c 100644
--- a/android/bazel.go
+++ b/android/bazel.go
@@ -431,7 +431,7 @@
}
propValue := b.bazelProperties.Bazel_module.Bp2build_available
- packagePath := ctx.OtherModuleDir(module)
+ packagePath := moduleDirWithPossibleOverride(ctx, module)
// Modules in unit tests which are enabled in the allowlist by type or name
// trigger this conditional because unit tests run under the "." package path
@@ -440,7 +440,7 @@
return true
}
- moduleName := module.Name()
+ moduleName := moduleNameWithPossibleOverride(ctx, module)
allowlist := ctx.Config().Bp2buildPackageConfig
moduleNameAllowed := allowlist.moduleAlwaysConvert[moduleName]
moduleTypeAllowed := allowlist.moduleTypeAlwaysConvert[ctx.OtherModuleType(module)]