Is it possible to add in the java command to the standardOutput stream on a JavaExec command in Gradle?
Ie
task importSitesDef(dependsOn: init, type: JavaExec) {
main = 'com.x'
classpath = configurations.runE
standardOutput = new FileOutputStream(standardLog, true)
}
Will log the output but I want to see java com.x -cp ... in the file too before the input.
This is due to using the same output stream/file for multiple tasks and its very hard to tell where the output from one task finished before another one starts.
I know this is an old question but all I did to get the Java command used was to get the output of the JavaExec commandLine method and join it's elements, like so:-
commandLine.collect().join(' ')
Then output it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With