On 22/02/2013, at 1:34 AM, Luke Daley wrote: > > On 20/02/2013, at 9:59 PM, Luke Daley <[email protected]> wrote: > >> >> On 20/02/2013, at 8:19 PM, Adam Murdoch <[email protected]> wrote: >> >>> >>> On 20/02/2013, at 10:37 PM, Luke Daley wrote: >>> >>>> http://forums.gradle.org/gradle/topics/bug_in_org_gradle_process_internal_streams_execoutputhandlerunner >>>> >>>> It will take me a bit of of research to confirm/deny this bug as I'm not >>>> exactly sure what the correct behaviour is. >>> >>> It's probably because the processes launched by the script have inherited >>> the script's stdout and stderr streams. Strictly speaking, it's the >>> script's problem, not ours, as the script hasn't launched the background >>> process cleanly. >>> >>> Not sure there's much we can do about this with the Exec task. It's >>> intended to launch a process that does something and exits, not to launch a >>> background process. So, we might add a Spawn task that does a better job >>> for launching background processes. >>> >>> The workaround is simply to use Process to start the script and throw away >>> the stdout and stderr streams. >> >> Makes sense, thanks. > > Seems we already cater for this kinda: > https://github.com/gradle/gradle/blob/master/subprojects/core/src/main/groovy/org/gradle/process/internal/ExecHandleRunner.java#L82 > > We just don't expose this at the ExecSpec level. Is there a good reason?
That stuff currently needs a specific handshake with the child process, to know when the child process has started. It also expects the child process to close its stdout and stderr streams cleanly. So, that `isDaemon()` check is really `isGradleDaemon()`. Nothing we couldn't sort out. -- Adam Murdoch Gradle Co-founder http://www.gradle.org VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting http://www.gradleware.com
