Merge "Support a quieter bp2build" am: 8db8140b77 am: 5cbe6d49b6

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1894884

Change-Id: I68a9ce984b13f11593b66f99e91a531fb63bf8ee
This commit is contained in:
Liz Kammer
2021-12-03 18:31:52 +00:00
committed by Automerger Merge Worker

View File

@@ -386,7 +386,7 @@ func touch(path string) {
// - won't be overwritten by corresponding bp2build generated files // - won't be overwritten by corresponding bp2build generated files
// //
// And return their paths so they can be left out of the Bazel workspace dir (i.e. ignored) // And return their paths so they can be left out of the Bazel workspace dir (i.e. ignored)
func getPathsToIgnoredBuildFiles(topDir string, generatedRoot string, srcDirBazelFiles []string) []string { func getPathsToIgnoredBuildFiles(topDir string, generatedRoot string, srcDirBazelFiles []string, verbose bool) []string {
paths := make([]string, 0) paths := make([]string, 0)
for _, srcDirBazelFileRelativePath := range srcDirBazelFiles { for _, srcDirBazelFileRelativePath := range srcDirBazelFiles {
@@ -416,7 +416,9 @@ func getPathsToIgnoredBuildFiles(topDir string, generatedRoot string, srcDirBaze
// BUILD file clash resolution happens later in the symlink forest creation // BUILD file clash resolution happens later in the symlink forest creation
continue continue
} }
fmt.Fprintf(os.Stderr, "Ignoring existing BUILD file: %s\n", srcDirBazelFileRelativePath) if verbose {
fmt.Fprintf(os.Stderr, "Ignoring existing BUILD file: %s\n", srcDirBazelFileRelativePath)
}
paths = append(paths, srcDirBazelFileRelativePath) paths = append(paths, srcDirBazelFileRelativePath)
} }
@@ -523,7 +525,7 @@ func runBp2Build(configuration android.Config, extraNinjaDeps []string) {
os.Exit(1) os.Exit(1)
} }
pathsToIgnoredBuildFiles := getPathsToIgnoredBuildFiles(topDir, generatedRoot, existingBazelRelatedFiles) pathsToIgnoredBuildFiles := getPathsToIgnoredBuildFiles(topDir, generatedRoot, existingBazelRelatedFiles, configuration.IsEnvTrue("BP2BUILD_VERBOSE"))
excludes = append(excludes, pathsToIgnoredBuildFiles...) excludes = append(excludes, pathsToIgnoredBuildFiles...)
excludes = append(excludes, getTemporaryExcludes()...) excludes = append(excludes, getTemporaryExcludes()...)