mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Bug 1125330 - Expose |mach| output after failures invoking from Gradle. r=me,f=ally
--HG-- extra : rebase_source : 8d801f739f77640a587231404e22506f52342438
This commit is contained in:
parent
7b9cf79f10
commit
177f286d2b
@ -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