aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools')
-rw-r--r--src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto22
-rw-r--r--src/main/java/com/google/devtools/build/lib/buildtool/buildevent/BuildCompleteEvent.java8
2 files changed, 27 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto b/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto
index a59ef39cb3..c4ae568f91 100644
--- a/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto
+++ b/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto
@@ -361,8 +361,26 @@ message TestSummary {
// Event indicating the end of a build.
message BuildFinished {
- // If the build succeeded or failed.
- bool overall_success = 1;
+ // Exit code of a build. The possible values correspond to the predefined
+ // codes in bazel's lib.ExitCode class, as well as any custom exit code a
+ // module might define. The predefined exit codes are subject to change (but
+ // rarely do) and are not part of the public API.
+ //
+ // A build was successfull iff ExitCode.code equals 0.
+ message ExitCode {
+ // The name of the exit code.
+ string name = 1;
+
+ // The exit code.
+ int32 code = 2;
+ }
+
+ reserved 1;
+
+ // The overall status of the build. A build was successfull iff
+ // ExitCode.code equals 0.
+ ExitCode exit_code = 3;
+
// Time in milliseconds since the epoch.
// TODO(buchgr): Use google.protobuf.Timestamp once bazel's protoc supports
// it.
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();