aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Klaus Aehlig <aehlig@google.com>2016-03-30 09:39:58 +0000
committerGravatar Klaus Aehlig <aehlig@google.com>2016-03-30 10:40:49 +0000
commit8730b322cfc2a155ce399eb5264441c34748c206 (patch)
tree8753fc1f23a1c0860200e0e74aa89fb976c7fec6 /src
parent16aa254795e1affcd11cf39f2df7345d3d664e0e (diff)
Signal that clean does not build
bazel clean never runs any actions, hence any message about running actions would confuse the user. Therefore, signal that clean is a non-building command so that the experimental UI knows not the report about progress of building. -- Change-Id: I193f199b052e990992359bc9efdbe34db397ac5f Reviewed-on: https://bazel-review.googlesource.com/#/c/3125 MOS_MIGRATED_REVID=118554435
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/commands/CleanCommand.java3
-rwxr-xr-xsrc/test/shell/integration/experimental_ui_test.sh14
2 files changed, 17 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/CleanCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/CleanCommand.java
index 62222337b8..c6e3a2a3ee 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/commands/CleanCommand.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/CleanCommand.java
@@ -14,6 +14,7 @@
package com.google.devtools.build.lib.runtime.commands;
import com.google.devtools.build.lib.actions.ExecException;
+import com.google.devtools.build.lib.analysis.NoBuildEvent;
import com.google.devtools.build.lib.buildtool.BuildRequest;
import com.google.devtools.build.lib.buildtool.OutputDirectoryLinksUtils;
import com.google.devtools.build.lib.events.Event;
@@ -90,6 +91,8 @@ public final class CleanCommand implements BlazeCommand {
cleanOptions.expunge_async = cleanOptions.cleanStyle.equals("expunge_async");
cleanOptions.expunge = cleanOptions.cleanStyle.equals("expunge");
+ env.getEventBus().post(new NoBuildEvent());
+
if (!cleanOptions.expunge && !cleanOptions.expunge_async
&& !cleanOptions.cleanStyle.isEmpty()) {
env.getReporter().handle(Event.error(
diff --git a/src/test/shell/integration/experimental_ui_test.sh b/src/test/shell/integration/experimental_ui_test.sh
index deffba802a..fbfd5b24bd 100755
--- a/src/test/shell/integration/experimental_ui_test.sh
+++ b/src/test/shell/integration/experimental_ui_test.sh
@@ -93,4 +93,18 @@ function test_query_spacing() {
true
}
+function test_clean_nobuild {
+ bazel clean --experimental_ui 2>$TEST_log \
+ || fail "bazel shutdown failed"
+ expect_not_log "actions running"
+ expect_not_log "Building"
+}
+
+function test_clean_color_nobuild {
+ bazel clean --experimental_ui --color=yes 2>$TEST_log \
+ || fail "bazel shutdown failed"
+ expect_not_log "actions running"
+ expect_not_log "Building"
+}
+
run_suite "Integration tests for bazel's experimental UI"