如何合并provers.exec?

问题描述 投票:0回答:1

i我将我的构建迁移到兼容外部进程的方法(是一个

providers.exec
)。

为了将stdin和stdout合并到一个流中,我使用了以下方法:

ByteArrayOutputStream().use { val execResult = exec { commandLine(*args) isIgnoreExitValue = true standardOutput = it // <---- errorOutput = it // <---- } return CommandExecutionResult(exitCode = execResult.exitValue, consoleOutput = it.toString()) }
不幸的是,这与
providers.exec

API无法使用。 相同的尝试重定向输出投掷“不能为执行输出提供商配置

标准流”:
ByteArrayOutputStream().use { outputStream -> val execResult = providers.exec { commandLine(*args) isIgnoreExitValue = true standardOutput = outputStream errorOutput = outputStream } return CommandExecutionResult(exitCode = execResult.result.get().exitValue, consoleOutput = outputStream.toString()) }

如何从
providers.exec

可以在github问题下方找到修复它的方法

gradle
1个回答
0
投票
github问题

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.