mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1580280
- [gradle] Stop redirecting stderr into stdout when calling 'mach environment', r=nalexander
Print debugging a task that runs gradle has been really annoying as gradle reads the output of 'mach environment' and fails as soon as a debug line shows up. What's worse, is it redirects stderr into stdout so even printing to 'sys.stderr' fails. This fixes that so writing to stderr will at least work. Differential Revision: https://phabricator.services.mozilla.com/D47608 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
35d00cbafb
commit
3ccc9e7376
@ -15,12 +15,13 @@ if (System.properties['os.name'].toLowerCase().contains('windows')) {
|
||||
}
|
||||
def proc = commandLine.execute(null, new File(topsrcdir))
|
||||
def standardOutput = new ByteArrayOutputStream()
|
||||
proc.consumeProcessOutput(standardOutput, standardOutput)
|
||||
def standardError = new ByteArrayOutputStream()
|
||||
proc.consumeProcessOutput(standardOutput, standardError)
|
||||
proc.waitFor()
|
||||
|
||||
// Only show the output if something went wrong.
|
||||
if (proc.exitValue() != 0) {
|
||||
throw new GradleException("Process '${commandLine}' finished with non-zero exit value ${proc.exitValue()}:\n\n${standardOutput.toString()}")
|
||||
throw new GradleException("Process '${commandLine}' finished with non-zero exit value ${proc.exitValue()}:\n\nstdout:\n${standardOutput.toString()}\n\nstderr:\n${standardError.toString()}")
|
||||
}
|
||||
|
||||
import groovy.json.JsonSlurper
|
||||
|
Loading…
Reference in New Issue
Block a user