tags:

views:

322

answers:

3
A: 

Why doesn't the replace task work for you?

jheddings
A: 

I suspect i use subant in a wrong way. Maybe there is no need to try to make subant run the same task as ant does? Maybe i should make subant run ant in a required directory and don't change anything for ant?

A: 

First of all, if you indent all of your code samples by 4 spaces they will be placed in an escaped code block and will be much easier to read. For example:

<project name="foo" default="foo">
    <target name="foo">
    <!-- etc. -->
</project>

You can click the orange question mark at the upper-right of the edit box for more editing help.

Second, I don't understand what it is that you are trying to do, or what you mean by "copy and replacetoken etc are not supported by subant". The subant task is used to invoke an ant build in multiple directories. For example, suppose you have a proeprty ${top} that points to a directory that contains subdirectories named one, two, and three. Then you could use a subant task to invoke ant in each of those subdirectories like this:

<subant genericantfile="${top}/build.xml" target="build">
    <!-- include all subdirectories in ${top} -->
    <dirset dir="${top}"/>
</subant>

This would be roughly equivalent to the following commands at a command prompt (assuming that the directory top is located in /work/top):

$ cd /work/top
$ cd one
$ ant -f ../build.xml build
$ cd ../two
$ ant -f ../build.xml build
$ cd ../three
$ ant -f ../build.xml build

Finally, your usage of dirset is incorrect. A dirset is a group of directories, not files, so your dirset above will include all directories that end with .sql, which I suspect is not what you want.

Jason Day