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
diff --git a/android/config.go b/android/config.go
index 5dcb959..cb2fc61 100644
--- a/android/config.go
+++ b/android/config.go
@@ -158,7 +158,7 @@
mockBpList string
runningAsBp2Build bool
- bp2buildPackageConfig Bp2BuildConfig
+ bp2buildPackageConfig bp2BuildConversionAllowlist
Bp2buildSoongConfigDefinitions soongconfig.Bp2BuildSoongConfigDefinitions
// If testAllowNonExistentPaths is true then PathForSource and PathForModuleSrc won't error
@@ -550,7 +550,7 @@
}
config.BazelContext, err = NewBazelContext(config)
- config.bp2buildPackageConfig = bp2buildDefaultConfig
+ config.bp2buildPackageConfig = bp2buildAllowlist
return Config{config}, err
}