From 6b76d7332deb4be5d6fdf0a9307ce2177400fa90 Mon Sep 17 00:00:00 2001 From: Jakob Buchgraber Date: Thu, 27 Apr 2017 14:56:16 +0200 Subject: 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 --- .../build/lib/buildtool/buildevent/BuildCompleteEvent.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/google/devtools/build/lib/buildtool') 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(); -- cgit v1.2.3