aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/buildtool
diff options
context:
space:
mode:
authorGravatar Jakob Buchgraber <buchgr@google.com>2017-04-27 14:56:16 +0200
committerGravatar Vladimir Moskva <vladmos@google.com>2017-04-27 15:28:25 +0200
commit6b76d7332deb4be5d6fdf0a9307ce2177400fa90 (patch)
tree6cc312dc3836eb42e2c1fcc72cc41ea39bb844c5 /src/main/java/com/google/devtools/build/lib/buildtool
parent902af4e05c87ae819ab77da9bee04265bdb264a8 (diff)
BEP: Report exit code in BuildCompleteEvent
We decided to use the exit code as opposed to a status enum as bazel reports the build status as an exit code internally and the number of exit codes is dynamic. That is, a bazel module might add additional exit codes and thus we need to support reporting these. The overall_success field is now redundant and has thus been removed. A build was successfull iff ExitCode.code equals zero. Change-Id: I268db972b09d983f6cd07df34e3a384efb607358 PiperOrigin-RevId: 154413356
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/buildtool')
-rw-r--r--src/main/java/com/google/devtools/build/lib/buildtool/buildevent/BuildCompleteEvent.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/buildtool/buildevent/BuildCompleteEvent.java b/src/main/java/com/google/devtools/build/lib/buildtool/buildevent/BuildCompleteEvent.java
index f8e419e65f..936aeb12a5 100644
--- a/src/main/java/com/google/devtools/build/lib/buildtool/buildevent/BuildCompleteEvent.java
+++ b/src/main/java/com/google/devtools/build/lib/buildtool/buildevent/BuildCompleteEvent.java
@@ -60,9 +60,15 @@ public final class BuildCompleteEvent implements BuildEvent {
@Override
public BuildEventStreamProtos.BuildEvent asStreamProto(BuildEventConverters converters) {
+ BuildEventStreamProtos.BuildFinished.ExitCode exitCode =
+ BuildFinished.ExitCode.newBuilder()
+ .setName(result.getExitCondition().name())
+ .setCode(result.getExitCondition().getNumericExitCode())
+ .build();
+
BuildFinished finished =
BuildFinished.newBuilder()
- .setOverallSuccess(result.getSuccess())
+ .setExitCode(exitCode)
.setFinishTimeMillis(result.getStopTime())
.build();
return GenericBuildEvent.protoChaining(this).setFinished(finished).build();