Call rm -rf in mixed build build statement preamble.
https://android-review.git.corp.google.com/q/topic:bazel_using_txt added
a tree artifact output for an action. This CL adds "-r" to the rm calls
to support deleting the old tree artifact outputs.
Test: presubmits
Fixes: 257956807
Change-Id: Ia44b1bef4f8031fe75a239fb162972e8827e3c19
diff --git a/android/bazel_handler.go b/android/bazel_handler.go
index 1f87410..d7f55c3 100644
--- a/android/bazel_handler.go
+++ b/android/bazel_handler.go
@@ -1082,7 +1082,7 @@
// Remove old outputs, as some actions might not rerun if the outputs are detected.
if len(buildStatement.OutputPaths) > 0 {
- cmd.Text("rm -f")
+ cmd.Text("rm -rf") // -r because outputs can be Bazel dir/tree artifacts.
for _, outputPath := range buildStatement.OutputPaths {
cmd.Text(fmt.Sprintf("'%s'", outputPath))
}