Ant 子蚂蚁目标而不是蚂蚁
我对subant有点问题,没有任何想法。有人能帮忙吗? 使用Ant替换其他字符串(即“Foo”和“1.2”的Productname和版本),我使用了以下内容:Ant 子蚂蚁目标而不是蚂蚁,ant,Ant,我对subant有点问题,没有任何想法。有人能帮忙吗? 使用Ant替换其他字符串(即“Foo”和“1.2”的Productname和版本),我使用了以下内容: <copy todir="${Foo_Home}\cm_builds\Deployment\Database\Production.win\"> <fileset dir="${Foo_Home}\Deployment\Database\Production.win\"
<copy todir="${Foo_Home}\cm_builds\Deployment\Database\Production.win\">
<fileset dir="${Foo_Home}\Deployment\Database\Production.win\"
includes="**/*.sql,**/*.cmd"/>
<filterset>
<filter token="PRODUCTNAME" value="Foo"/>
<filter token="VERSION" value="1.2"/>
</filterset>
</copy>
这是使用subant的正确方法吗?(假设我们有几个这样的目标)
如需帮助=)
更新:
我怀疑我用错了subant。也许没有必要让subant运行与ant相同的任务?也许我应该让subant在一个必需的目录中运行ant,并且不为ant更改任何内容?为什么这不适合您?我不明白您试图做什么,或者您所说的“subant不支持复制和替换令牌等”是什么意思。
subant
任务用于在多个目录中调用Ant构建。例如,假设您有一个属性${top}
,该属性指向一个目录,其中包含名为one
、two
和three
的子目录。然后您可以使用subant
任务在每个子目录中调用Ant,如下所示:
<subant target="build" genericantfile="build.xml">
<dirset dir="${Foo_Home}\cm_builds\Deployment\Database\Production.win\"
includes ="**/*.sql">
</subant>
<subant genericantfile="${top}/build.xml" target="build">
<!-- include all subdirectories in ${top} -->
<dirset dir="${top}"/>
</subant>
最后,您使用的
dirset
是不正确的。A是一组目录,而不是文件,因此上面的目录集
将包括以.sql
结尾的所有目录,我怀疑这不是您想要的。您是否忘记包含该示例?
$ cd /work/top
$ cd one
$ ant -f ../build.xml build
$ cd ../two
$ ant -f ../build.xml build
$ cd ../three
$ ant -f ../build.xml build