Hi everyone,

I have a set of ant tasks which use the <exec> and <java> tasks to invoke several 
programs.  This is fine for a development environment, but for a production 
environment its NOT acceptable to run these programs forked from ant.

I've had good luck using ant -verbose to print command-line versions of whatever ant 
exec's, then copy and paste these into startup scripts.  

But...  I'd like to automate this using an ant task-  that way my "release" target can 
generate startup scripts that are equivalent to the setup of <classpath>, environment, 
command-line, etc... elements in my build.xml.

Can anyone suggest a strategy to accomplish this?  

I'm considering subclassing the ExecTask--  sortof like this:

        <classpath refid="class.path">
                <pathelement location="${deploy.dir}/foo.jar"/>
                <pathelement location="${deploy.dir}/bar.jar"/>
        </classpath>

        <target name="run-foo-server" depends="deploy">
                <java dir="${deploy.dir}/bin" classname="my.class">
                        <arg value="arg1"/>
                        <classpath refid="class.path"/>
                </java>
        </target>

        <target name="make-foo-server-script" depends="deploy">
                <java-script-generator dir="${deploy.dir}/bin" classname="my.class">
                        <arg value="arg1"/>
                        <classpath refid="class.path"/>
                </java>
        </target>


Where java-script-generator is a user-defined task that extends the ExecTask (or 
ExecuteJava), and writes the Execute object into an OS-specific shell script.


Is there something simpler to try? 

Cheers
josh

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to