adding /out/soong_injection/metrics/converted_modules_path_map.json
This file can be used by atest/scripts/tools to determine which modules
have been converted and what their bazel build path is.
Test: b build //packages/modules/adb/...
will generate the file at /out/soong_injection/metrics/converted_modules_path_map.json
Also added a unit test to check that the file is created.
{
"adbd": "//packages/modules/adb",
"adbd_test": "//packages/modules/adb",
"add_ext4_encrypt": "//external/e2fsprogs/contrib",
....
}
Change-Id: Ibd424c487840d84c8a4fb635828a73541220b36b
diff --git a/bp2build/conversion.go b/bp2build/conversion.go
index b6190c6..522c10e 100644
--- a/bp2build/conversion.go
+++ b/bp2build/conversion.go
@@ -34,6 +34,12 @@
files = append(files, newFile("metrics", "converted_modules.txt", strings.Join(metrics.convertedModules, "\n")))
+ convertedModulePathMap, err := json.MarshalIndent(metrics.convertedModulePathMap, "", "\t")
+ if err != nil {
+ panic(err)
+ }
+ files = append(files, newFile("metrics", "converted_modules_path_map.json", string(convertedModulePathMap)))
+
files = append(files, newFile("product_config", "soong_config_variables.bzl", cfg.Bp2buildSoongConfigDefinitions.String()))
files = append(files, newFile("product_config", "arch_configuration.bzl", android.StarlarkArchConfigurations()))