Is there a way to have Ant create a runtime shell or batch runtime script instead of having to manually create the script myself.
It would be similar to the functionality of link text
Is there a way to have Ant create a runtime shell or batch runtime script instead of having to manually create the script myself.
It would be similar to the functionality of link text
Yes it can be done. Here's a simple example (your link is not working right now ... sourceforge error thrown). The basic idea is to write the file using the echo task, then run it using the exec task:
<property name="myls" value="myls.sh" />
<echo file="${myls}">
ls
</echo>
<exec executable="sh">
<arg value="${myls}"/>
</exec>
When run gives the following, as the working directory only contains the build file and the script:
Buildfile: build.xml
[exec] build.xml
[exec] myls.sh
This is of course unix-specific, but you could do similar equally well on other systems - for windows you'd change the executable to cmd
I believe. You can take this further and pass arguments to your new script too if needed. For example:
<property name="myls" value="myls.sh" />
<echo file="${myls}">
ls $@
</echo>
<exec executable="sh">
<arg value="${myls}"/>
<arg value="b*"/>
</exec>
When run now only sees the build file:
Buildfile: build.xml
[exec] build.xml