How to redirect the output of a ProcessBuilder to the gradle console?

I have a ProcessBuilder in my custom plugin and want to see the output of the gradle console. I have try inheritIO() which mostly work in my other applications. But I see nothing. Can you give me any hint please?

1 Like

I have found a workaround. I replace the Java class java.lang.ProcessBuilder with the gradle class org.gradle.process.internal.DefaultExecAction

    DefaultExecAction action = new DefaultExecAction( fileResolver );
    action.setCommandLine( command );
    action.execute();

The disadvantage is that this is an internal class.

You can do:

someExecTask {
  standardOutput = System.out
}