diff options
author | Klaus Aehlig <aehlig@google.com> | 2016-04-19 07:43:10 +0000 |
---|---|---|
committer | Damien Martin-Guillerez <dmarting@google.com> | 2016-04-19 09:48:16 +0000 |
commit | b7e1004952dcb319963a2c426f43b975dcb31644 (patch) | |
tree | 2ea4444347f5b04a3e6987a827c4b4a05aedaaea /src | |
parent | f1df38a5131a06a8b7047b99a5f887938e5a7623 (diff) |
Signal that the version command does not build
The version command is not expected to every run any actions.
Hence any messages about progress of the build process or running
actions would be confusing. Therefore, signal this fact to allow
the experimental UI to present information accordingly.
--
Change-Id: I8a75704a39e161f52c4d008677f62e4b36097647
Reviewed-on: https://bazel-review.googlesource.com/#/c/3387
MOS_MIGRATED_REVID=120203058
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/runtime/commands/VersionCommand.java | 2 | ||||
-rwxr-xr-x | src/test/shell/integration/experimental_ui_test.sh | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/VersionCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/VersionCommand.java index ac75f8f528..97f3cc1358 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/commands/VersionCommand.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/VersionCommand.java @@ -14,6 +14,7 @@ package com.google.devtools.build.lib.runtime.commands; import com.google.devtools.build.lib.analysis.BlazeVersionInfo; +import com.google.devtools.build.lib.analysis.NoBuildEvent; import com.google.devtools.build.lib.events.Event; import com.google.devtools.build.lib.runtime.BlazeCommand; import com.google.devtools.build.lib.runtime.Command; @@ -43,6 +44,7 @@ public final class VersionCommand implements BlazeCommand { env.getReporter().handle(Event.error("Version information not available")); return ExitCode.COMMAND_LINE_ERROR; } + env.getEventBus().post(new NoBuildEvent()); env.getReporter().getOutErr().printOutLn(info.getSummary()); return ExitCode.SUCCESS; } diff --git a/src/test/shell/integration/experimental_ui_test.sh b/src/test/shell/integration/experimental_ui_test.sh index 1c41ea2965..ea250e32a6 100755 --- a/src/test/shell/integration/experimental_ui_test.sh +++ b/src/test/shell/integration/experimental_ui_test.sh @@ -156,6 +156,13 @@ function test_help_color_nobuild { expect_not_log "Building" } +function test_version_nobuild { + bazel version --experimental_ui --curses=yes 2>$TEST_log \ + || fail "bazel version failed" + expect_not_log "action" + expect_not_log "Building" +} + function test_subcommand { bazel clean || fail "bazel clean failed" bazel build --experimental_ui -s pkg:gentext 2>$TEST_log \ |