in ideaSupport/src/main/scala/org/jetbrains/sbtidea/tasks/RunPluginVerifierTask.scala [51:77]
override protected def buildJavaArgs: Seq[String] = Seq(
"-jar",
verifierJar.toAbsolutePath.toString
) ++ options.buildOptions
//noinspection ConvertExpressionToSAM : scala 2.10
override def run(): Int = {
val processBuilder = new JProcessBuilder()
val fullCommand = buildFullCommand
val process = processBuilder
.command(fullCommand)
.start()
PluginLogger.info(s"Started plugin verifier $verifierJar:\n${fullCommand.asScala.mkString(" ")}")
Using.resource(process.getInputStream) { stream =>
val reader = new BufferedReader(new InputStreamReader(stream))
reader
.lines()
.forEach(new Consumer[String] {
override def accept(line: String): Unit = {
println(line)
hasErrors = hasErrors || options.failureLevels.exists(lvl => line.startsWith(lvl.testValue))
}
})
}
process.waitFor()
if (hasErrors) -1 else 0
}