mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1125330 - Expose |mach| output after failures invoking from Gradle. r=me,f=ally
This commit is contained in:
parent
af6730dabc
commit
baa0cc39ea
@ -33,5 +33,15 @@ subprojects {
|
||||
commandLine "${topsrcdir}/mach"
|
||||
args 'build'
|
||||
args 'mobile/android/base/gradle-targets'
|
||||
|
||||
// Only show the output if something went wrong.
|
||||
ignoreExitValue = true
|
||||
standardOutput = new ByteArrayOutputStream()
|
||||
errorOutput = standardOutput
|
||||
doLast {
|
||||
if (execResult.exitValue != 0) {
|
||||
throw new GradleException("Process '${commandLine}' finished with non-zero exit value ${execResult.exitValue}:\n\n${standardOutput.toString()}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,16 @@ task buildOmnijar(type:Exec) {
|
||||
args '-C'
|
||||
args 'mobile/android/base'
|
||||
args 'gradle-omnijar'
|
||||
|
||||
// Only show the output if something went wrong.
|
||||
ignoreExitValue = true
|
||||
standardOutput = new ByteArrayOutputStream()
|
||||
errorOutput = standardOutput
|
||||
doLast {
|
||||
if (execResult.exitValue != 0) {
|
||||
throw new GradleException("Process '${commandLine}' finished with non-zero exit value ${execResult.exitValue}:\n\n${standardOutput.toString()}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'idea'
|
||||
|
@ -8,20 +8,20 @@ if (!hasProperty('topsrcdir')) {
|
||||
logger.warn("topsrcdir is undefined: assuming source directory Gradle invocation with topsrcdir=${topsrcdir}.")
|
||||
}
|
||||
|
||||
def command = ["${topsrcdir}/mach", "environment", "--format", "json", "--verbose"]
|
||||
def proc = command.execute(null, new File(topsrcdir))
|
||||
def sout = new StringBuffer()
|
||||
def serr = new StringBuffer()
|
||||
proc.consumeProcessOutput(sout, serr)
|
||||
def commandLine = ["${topsrcdir}/mach", "environment", "--format", "json", "--verbose"]
|
||||
def proc = commandLine.execute(null, new File(topsrcdir))
|
||||
def standardOutput = new ByteArrayOutputStream()
|
||||
proc.consumeProcessOutput(standardOutput, standardOutput)
|
||||
proc.waitFor()
|
||||
|
||||
// Only show the output if something went wrong.
|
||||
if (proc.exitValue() != 0) {
|
||||
throw new GradleException("Could not extract mozconfig/build environment from |${topsrcdir}/mach environment|!");
|
||||
throw new GradleException("Process '${commandLine}' finished with non-zero exit value ${proc.exitValue()}:\n\n${standardOutput.toString()}")
|
||||
}
|
||||
|
||||
import groovy.json.JsonSlurper
|
||||
def slurper = new JsonSlurper()
|
||||
def json = slurper.parseText(sout.toString())
|
||||
def json = slurper.parseText(standardOutput.toString())
|
||||
|
||||
include ':app'
|
||||
include ':base'
|
||||
|
Loading…
Reference in New Issue
Block a user