ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Dawson <>
Subject exec and launching separate tasks
Date Wed, 08 Nov 2000 04:44:35 GMT
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" />

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.


View raw message