daemon support: option to leave forked-process running beyond build, non-stopAfter
Not sure this is a particularly Gradle-ish or build-sane thing to do, but I was looking in Gradle and in some other plugins for the ability to have Gradle launch a daemon task - a long-running forked child-process that outlives the current build (even the JVM that forks it if not running the Gradle Daemon).
I guess it's a choice between having a Gradle build that it expected to block-forever (could be backgrounded) waiting for an exit condition so it can clean-up the daemon, versus a build that has known side-effects (leaves processed running).
If backward compatibility were not a concern, ideally a stopAfter=null could mean this, but that currently represents stopOnBuildCompletion.
Could be achieved by adding a property like killOnExit (Default: true for downward compatibility) to com.github.psxpaul.task.AbstractExecFork and applying it to:
fun stop() {
if (process != null && process!!.isAlive && killOnExit)
process!!.destroyForcibly().waitFor(15, TimeUnit.SECONDS)
}