在蚂蚁,如何将文件列表上应用的目标(没有蚂蚁的contrib)? [英] In ant, how to apply a target on a list of files (without ant-contrib)?

查看:106
本文介绍了在蚂蚁,如何将文件列表上应用的目标(没有蚂蚁的contrib)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上,我想模仿适用任务,但不是传递给它的执行,我想通过一个Ant任务,并拿出类似:

Basically, I would like to mimic apply task but instead of passing to it anexecutable, I would like to pass an ant task and come up with something like:

<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>

问题是,适用任务属性,但仅执行

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

I need a solution that doesn't require ant-contrib.

推荐答案

在ANT没有本地的解决方案。这是这类问题的蚂蚁的contrib 的发明解决了:-(

No native solution in ANT. This is the sort of problem ant-contrib was invented to solve :-(

基本上,ANT旨在通过编写自定义任务,以解决非标延伸的构建问题....

Basically, ANT was designed to be extended by writing custom tasks to solve non-standard build problems....

我个人认为,一旦你的构建需要复杂的逻辑,它的时间来嵌入一个完全成熟的编程语言。我的首选工具是常规,由于它与ANT紧密集成。此外,我使用常春藤来管理我的构建的第三方依赖关系,因此自动添加常规到classpath中没有困难。

Personally, I think once your build needs complex logic, it's time to embed a full blown programming language. My tool of choice is groovy, due to it's tight integration with ANT. Furthermore, I use ivy to manage my build's 3rd party dependencies, so automatically adding groovy to the classpath is no hardship.

这篇关于在蚂蚁,如何将文件列表上应用的目标(没有蚂蚁的contrib)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆