refactor bp2build module allowlists into struct

To make testing easier, refactor existing module-global variables into a
struct that can be mocked.

Test: build/bazel/bp2build.go
Change-Id: I9d177677644ea743641a745b1839a3a8b29f902a
This commit is contained in:
Sam Delmerico
2022-03-28 19:53:03 +00:00
parent 5e7455996e
commit 24c5603815
12 changed files with 698 additions and 527 deletions

View File

@@ -79,6 +79,7 @@ type BazelConversionContext interface {
OtherModuleType(m blueprint.Module) string
OtherModuleName(m blueprint.Module) string
OtherModuleDir(m blueprint.Module) string
ModuleErrorf(format string, args ...interface{})
}
// A subset of the ModuleContext methods which are sufficient to resolve references to paths/deps in