mirror of
https://github.com/enso-org/enso.git
synced 2024-12-27 04:12:56 +03:00
Capture the output from native-image build.
This commit is contained in:
parent
c5cc2dc448
commit
743e167aa4
@ -225,12 +225,23 @@ object NativeImage {
|
||||
val process =
|
||||
Process(cmd, None, "PATH" -> newPath)
|
||||
|
||||
if (process.! != 0) {
|
||||
log.error("Native Image build failed.")
|
||||
// All the output from native-image is redirected into a StringBuilder, and printed
|
||||
// at the end of the build. This mitigates the problem when there are multiple sbt
|
||||
// commands running in parallel and the output is intertwined.
|
||||
val sb = new StringBuilder
|
||||
val processLogger = ProcessLogger(str => {
|
||||
sb.append(str + System.lineSeparator())
|
||||
})
|
||||
log.info(
|
||||
s"Started building $artifactName native image. The output is captured."
|
||||
)
|
||||
val retCode = process.!(processLogger)
|
||||
if (retCode != 0) {
|
||||
log.error("Native Image build failed, with output: ")
|
||||
println(sb.toString())
|
||||
throw new RuntimeException("Native Image build failed")
|
||||
}
|
||||
|
||||
log.info("Native Image build successful.")
|
||||
log.info(s"$artifactName native image build successful.")
|
||||
}
|
||||
.dependsOn(Compile / compile)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user