Gradle JavaExec StandardOutput to enable Java command
Is it possible to add java command to standardOutput stream in JavaExec command in Gradle?
Those
task importSitesDef(dependsOn: init, type: JavaExec) {
main = 'com.x'
classpath = configurations.runE
standardOutput = new FileOutputStream(standardLog, true)
}
Will write the output, but I want to see java com.x -cp ... in the file also before entering.
This involves using the same output stream / file for multiple tasks, and it is very difficult to determine where the output from one task ends before starting another.
+3
source to share