From 1c2317315c7a4232a79cefa507b7d1a638b74d1c Mon Sep 17 00:00:00 2001 From: Jingwen Chen Date: Fri, 5 Feb 2021 09:38:15 -0500 Subject: [PATCH] bp2build: make generated BUILD files publicly visible. This is obviously not good build hygiene, but since Soong modules are in a global namespace, making BUILD files fully public will increase our velocity during the initial migration phases. We'd want to lock visibility down to private by default as soon as possible, but for the purposes of migration, these will be public. Test: bazel build //bionic/... Change-Id: I99d62f3f8826712240decd325928435333870352 --- bp2build/conversion.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bp2build/conversion.go b/bp2build/conversion.go index 62cd8d4b6..4a4b3f8b9 100644 --- a/bp2build/conversion.go +++ b/bp2build/conversion.go @@ -50,7 +50,12 @@ func createBuildFiles(buildToTargets map[string]BazelTargets, mode CodegenMode) sort.Slice(targets, func(i, j int) bool { return targets[i].name < targets[j].name }) content := soongModuleLoad if mode == Bp2Build { - content = targets.LoadStatements() + content = `# This file was automatically generated by bp2build for the Bazel migration project. +# Feel free to edit or test it, but do *not* check it into your version control system.` + content += "\n\n" + content += "package(default_visibility = [\"//visibility:public\"])" + content += "\n\n" + content += targets.LoadStatements() } if content != "" { // If there are load statements, add a couple of newlines.