aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java b/src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java
index c9d31ba945..879806de79 100644
--- a/src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java
+++ b/src/main/java/com/google/devtools/build/lib/runtime/commands/QueryCommand.java
@@ -19,6 +19,7 @@ import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import com.google.devtools.build.lib.analysis.NoBuildEvent;
+import com.google.devtools.build.lib.analysis.NoBuildRequestFinishedEvent;
import com.google.devtools.build.lib.events.Event;
import com.google.devtools.build.lib.packages.Target;
import com.google.devtools.build.lib.pkgcache.PackageCacheOptions;
@@ -207,7 +208,7 @@ public final class QueryCommand implements BlazeCommand {
}
}
- env.getEventBus().post(new NoBuildEvent(env.getCommandName(), env.getCommandStartTime()));
+ env.getEventBus().post(new NoBuildEvent(env.getCommandName(), env.getCommandStartTime(), true));
if (!streamResults) {
disableAnsiCharactersFiltering(env);
try {
@@ -241,7 +242,10 @@ public final class QueryCommand implements BlazeCommand {
env.getReporter().handle(Event.info("Empty results"));
}
- return result.getSuccess() ? ExitCode.SUCCESS : ExitCode.PARTIAL_ANALYSIS_FAILURE;
+ ExitCode exitCode = result.getSuccess() ? ExitCode.SUCCESS : ExitCode.PARTIAL_ANALYSIS_FAILURE;
+ env.getEventBus()
+ .post(new NoBuildRequestFinishedEvent(exitCode, runtime.getClock().currentTimeMillis()));
+ return exitCode;
}
/**