The Exec task always forks a new JVM, but then it waits for it to finish. Currently there is no way to return immediately. Vote here: http://issues.gradle.org/browse/GRADLE-1254. Meanwhile you could use Groovy's String.execute() method, Java's ProcessBuilder, or the exec Ant task.
-- Peter Niederwieser Developer, Gradle http://www.gradle.org Trainer & Consultant, Gradleware http://www.gradleware.com Creator, Spock Framework http://spockframework.org richardm wrote: > > I've got an Exec task to startup JBoss. JBoss starts OK, but my build > script just sits there executing the startJBoss task and never returns. > How can I run an external script like this but fork or spawn the process > so control returns to my build script? > > task startJboss(type:Exec) { > executable = "$rootDir/../uwm/build/tools/jboss/bin/start-run.bat" > //args "spawn=true" > environment 'NOPAUSE': 'true', 'WORKSPACE': "$rootDir/../" > } > > The Ant equivalent used to be as follows. The exec task had a 'spawn' > attribute, but I couldn't see anything similiar in the Gradle Exec task. > > > spawn="true"> > > > > > > The start-run.bat script I'm calling does this: > start "JBoss dev" cmd /c %WORKSPACE%\jboss\jboss-4.0.2-dev\bin\run.bat > -- View this message in context: http://gradle.1045684.n5.nabble.com/Exec-to-run-external-script-how-can-you-spawn-it-tp4286046p4286070.html Sent from the gradle-user mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
