diff options
author | 2018-05-07 08:03:06 -0700 | |
---|---|---|
committer | 2018-05-07 08:04:15 -0700 | |
commit | d06a366c63b13f361bd8b80baab32ad3c708443f (patch) | |
tree | d0b976795f2b5b272f567547c74a77d5c0c4133b /src/main/java/com/google/devtools/build/lib/buildeventservice | |
parent | b0b2d2a3a09d6696e893b213c47aab8eebbb5823 (diff) |
bes: add --bes_results_url
Closes #4628
Closes #5155.
PiperOrigin-RevId: 195662967
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/buildeventservice')
2 files changed, 26 insertions, 5 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceModule.java b/src/main/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceModule.java index bc806be07c..b0ca6d72f8 100644 --- a/src/main/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceModule.java +++ b/src/main/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceModule.java @@ -20,6 +20,7 @@ import static com.google.devtools.build.lib.buildeventservice.BuildEventServiceT import static java.lang.String.format; import com.google.common.annotations.VisibleForTesting; +import com.google.common.base.Strings; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.devtools.build.lib.authandtls.AuthAndTLSOptions; @@ -218,11 +219,20 @@ public abstract class BuildEventServiceModule<T extends BuildEventServiceOptions logger.fine(format("Will create BuildEventServiceTransport streaming to '%s'", besOptions.besBackend)); - commandLineReporter.handle( - Event.info( - format( - "Streaming Build Event Protocol to %s build_request_id: %s invocation_id: %s", - besOptions.besBackend, buildRequestId, invocationId))); + final String message; + if (!Strings.isNullOrEmpty(besOptions.besResultsUrl)) { + String url = + besOptions.besResultsUrl.endsWith("/") + ? besOptions.besResultsUrl + : besOptions.besResultsUrl + "/"; + message = "Streaming Build Event Protocol to " + url + invocationId; + } else { + message = + format( + "Streaming Build Event Protocol to %s build_request_id: %s " + "invocation_id: %s", + besOptions.besBackend, buildRequestId, invocationId); + } + commandLineReporter.handle(Event.info(message)); BuildEventTransport besTransport = new BuildEventServiceTransport( diff --git a/src/main/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceOptions.java b/src/main/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceOptions.java index 0d1adae243..a6216ecf3a 100644 --- a/src/main/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceOptions.java +++ b/src/main/java/com/google/devtools/build/lib/buildeventservice/BuildEventServiceOptions.java @@ -104,4 +104,15 @@ public class BuildEventServiceOptions extends OptionsBase { + "event, even if larger than the specified value." ) public long besOuterrBufferSize; + + @Option( + name = "bes_results_url", + defaultValue = "", + documentationCategory = OptionDocumentationCategory.LOGGING, + effectTags = {OptionEffectTag.TERMINAL_OUTPUT}, + help = + "Specifies the base URL where a user can view the information streamed to the BES" + + " backend. Bazel will output the URL appended by the invocation id to the" + + " terminal.") + public String besResultsUrl; } |