mirror of https://github.com/apache/lucene.git
LUCENE-9670: Workaround for gradle not liking the same stream for stdout and stderr sinks.
This commit is contained in:
parent
e8276e09a1
commit
053060b925
|
@ -506,12 +506,23 @@ class RenderJavadocTask extends DefaultTask {
|
|||
|
||||
def outputFile = project.file("${getTemporaryDir()}/javadoc-output.txt")
|
||||
def result
|
||||
|
||||
outputFile.withOutputStream { output ->
|
||||
result = project.exec {
|
||||
executable javadocCmd
|
||||
|
||||
standardOutput = output
|
||||
errorOutput = output
|
||||
// we want to capture both stdout and stderr to the same
|
||||
// stream but gradle attempts to close these separately
|
||||
// (it has two independent pumping threads) and it can happen
|
||||
// that one still tries to write something when the other closed
|
||||
// the underlying output stream.
|
||||
def wrapped = new java.io.FilterOutputStream(output) {
|
||||
public void close() {
|
||||
// no-op. we close this stream manually.
|
||||
}
|
||||
}
|
||||
standardOutput = wrapped
|
||||
errorOutput = wrapped
|
||||
|
||||
args += [ "@${optionsFile}" ]
|
||||
|
||||
|
@ -522,6 +533,8 @@ class RenderJavadocTask extends DefaultTask {
|
|||
|
||||
ignoreExitValue true
|
||||
}
|
||||
|
||||
logger.lifecycle("Exec returned: ${result}")
|
||||
}
|
||||
|
||||
if (result.getExitValue() != 0) {
|
||||
|
|
Loading…
Reference in New Issue