You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Timothy Dawson <td...@is.com> on 2000/11/08 05:44:35 UTC

exec and launching separate tasks

I'd like to use the exec task but add an optional "wait" attribute which
would default to "true" (the current implementation), but, if "false", would
run the task in the background.  Alternately, the attribute could be "fork"
to indicate whether another process was created.

The reason for this is that some tasks you don't really want to wait around
for, they just run in the background. For example, I'd like to have a target
(call it "nightly") that shuts down the server, does an install build, then
restarts the server. I want the server start to occur in the background, as
a separate process, not keeping ant waiting around.

The format would look something like this (simplified, obviously, to assume
that stopServer.bat exists, etc.)

<target name="nightly">
    <exec dir="${install-dir} executable="stopServer.bat" 
          os="windows" wait="true" />
    <antcall target="install" />
    <exec dir="${install-dir} executable="startServer.bat" 
          os="windows" wait="false" />
</target>

I realize I could accomplish this with a custom task, but I'm curious if
there would be support for adding this to the standard build?  I think that
the implementation might end up being platform-specific, but from a usage
standpoint, it would apply to both Windows and Unix.

Tim

Re: exec and launching separate tasks

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "TD" == Timothy Dawson <td...@is.com> writes:

 TD> I'd like to use the exec task but add an optional "wait"
 TD> attribute which would default to "true" (the current
 TD> implementation), but, if "false", would run the task in the
 TD> background.

This has popped up several times but has always been deferred because
other things seemed more important (at least this is how I have seen
it, I can't remember any opposition against it).

The easiest way to push this forward is to send a patch to ant-dev 8-).

Alternatively you can make a formal feature request in the bug
tracking system, maybe then it won't drop out of the developer's
memory as fast as it would otherwise.

Stefan