johnrengelman / gradle-processes

Gradle Processes Plugin - Create and manage forked processes
Apache License 2.0
40 stars 18 forks source link

Process PID / Long Lived Processes #3

Open johnrengelman opened 10 years ago

johnrengelman commented 10 years ago

This covers forking of processes that outlive the Gradle build process itself. Is it possible? Would termination of the build cause the child processes to terminate? How to work around that?

What about terminating the process in a subsequent Gradle build execution? For example:

task start << {
  project.procs.fork { }
}

task stop << {
  //somehow terminate the process
}

Currently the API only exposes a waitForFinish, how do we term the program? How do we pick up the right process in the subsequent build? Do we do pattern matching? Is there a way to get the PID (PIDs are not exposed through the Java Process API, how do we merge the concepts between *nix and Windows?)