use of com.google.idea.blaze.base.async.process.PrintOutputLineProcessor in project intellij by bazelbuild.
the class BlazeInfoRunnerImpl method runBlazeInfo.
private static ByteArrayOutputStream runBlazeInfo(String binaryPath, WorkspaceRoot workspaceRoot, @Nullable String key, List<String> blazeFlags, BlazeContext context) throws BlazeInfoException {
BlazeCommand.Builder builder = BlazeCommand.builder(binaryPath, BlazeCommandName.INFO);
if (key != null) {
builder.addBlazeFlags(key);
}
BlazeCommand command = builder.addBlazeFlags(blazeFlags).build();
ByteArrayOutputStream stdout = new ByteArrayOutputStream();
int exitCode = ExternalTask.builder(workspaceRoot).addBlazeCommand(command).context(context).stdout(stdout).stderr(LineProcessingOutputStream.of(new PrintOutputLineProcessor(context))).build().run();
if (exitCode != 0) {
throw new BlazeInfoException(exitCode, stdout.toString());
}
return stdout;
}
Aggregations