Hi everyone. I'm currently writing a small gradle ...
# community-support
p
Hi everyone. I'm currently writing a small gradle plugin that helps with cross compilation of native code by invoking commands in dockcross images. So at it's core there is a simple
ProcessBuilder(command).inheritIO().start().waitFor()
which is supposed to run the command and forward the subprocess outputs to gradle. The inheritIO() call is supposed to redirect the process'es standard outputs to the gradle process, but I don't see any console output when I let it run e.g.
ping 1.1.1.1
. If I try the same in a standalone program it works just fine. In the gradle plugin, when I manually read the subprocess'es standard out and write it to System.out, then it also works. So it seems that whatever IO streams the subprocess is inheriting, they are not connected to System.out/System.err. Does anyone have any ideas on how to fix this?
c
Why not use Gradle’s exec task / ExecOps? It encapsulates all those details in a Gradle-friendly way.
p
are there examples somewhere on how to properly do that from a custom plugin?
nvm, I got it working with ExecOperations, thanks!
👍 1
👌 1