Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在ant中,如何在文件列表上应用目标(没有ant contrib)?_Ant - Fatal编程技术网

在ant中,如何在文件列表上应用目标(没有ant contrib)?

在ant中,如何在文件列表上应用目标(没有ant contrib)?,ant,Ant,基本上,我想模拟apply任务,但我不想向它传递可执行文件,而是要传递一个ant任务,并想出如下方法: <project> <target name="my-task"> <!--target definition--> <target/> <target name="my-task-on-files"> <apply task="my-task"> <sr

基本上,我想模拟
apply
任务,但我不想向它传递
可执行文件
,而是要传递一个ant任务,并想出如下方法:

<project>
   <target name="my-task">
      <!--target definition-->
   <target/>
   <target name="my-task-on-files">
        <apply task="my-task">
        <srcfile/>
        <targetfile/>
        <fileset dir="." includes="*.xml"/>
    </apply>
  </target>
</project>

问题是
apply
必须具有
task
属性,但只能是
可执行文件


我需要一个不需要ant contrib的解决方案

在ant中没有本机解决方案。这就是发明ant contrib来解决的问题:——

基本上,ANT的设计目的是通过编写自定义任务来扩展,以解决非标准构建问题

我个人认为,一旦构建需要复杂的逻辑,就应该嵌入一种成熟的编程语言。我选择的工具是,因为它与ANT紧密集成。此外,我使用它来管理构建的第三方依赖关系,因此自动将groovy添加到类路径并不困难