bp2build: add allowlist for package-level conversions.
This CL adds the support for specifying lists of directories in
build/soong/android/bazel.go, which are then written into
out/soong/bp2build/MANIFEST. Using this configuration,
modules/directories can either default to bp2build_available: true or
false, while still retaining the ability to opt-in or out at the module level.
It also ensures that ConvertWithBp2Build returns true iff the module
type has a registered bp2build converter.
Test: go tests
Test: demo.sh full
Test: TreeHugger presubmits for bp2build and mixed builds.
Change-Id: I0e0f6f4b1b2ec045f2f1c338f7084defc5d23a55
diff --git a/android/paths.go b/android/paths.go
index f648c55..7a54e01 100644
--- a/android/paths.go
+++ b/android/paths.go
@@ -340,6 +340,7 @@
GetDirectDep(name string) (blueprint.Module, blueprint.DependencyTag)
Module() Module
+ ModuleType() string
OtherModuleName(m blueprint.Module) string
OtherModuleDir(m blueprint.Module) string
}
@@ -450,7 +451,7 @@
// TODO(b/165114590): Convert tag (":name{.tag}") to corresponding Bazel implicit output targets.
b, ok := module.(Bazelable)
// TODO(b/181155349): perhaps return an error here if the module can't be/isn't being converted
- if !ok || !b.ConvertedToBazel() {
+ if !ok || !b.ConvertedToBazel(ctx) {
return bp2buildModuleLabel(ctx, module)
}
return b.GetBazelLabel(ctx, module)