用于处理多个文件的Ant任务 [英] Ant task that processes multiple files

查看:124
本文介绍了用于处理多个文件的Ant任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在蚂蚁我想在一个文件集执行Java任务。我使用Java任务运行它运行一个JS美化犀牛。后来的工作没有任何问题,但它似乎有点别扭使用犀牛+ JS来实际上可以有一个工作的JS美化/压头。但我发现所有的工作JS美化都是用JavaScript编写的。

in Ant I want to execute a Java task on a fileset. I use the Java task to run rhino which runs a JS beautifier. The later works without any problems, except that it might seem little bit awkward to use rhino+js to acutally have a working JS beautifier/indenter. But all working JS beautifiers I have found are all written in JavaScript.

我也想上的文件运行jsmin为好,但作为分发任务的一部分。所以,同样的问题将再次出现,例如在多个文件上运行的Java任务。在Java / JS实现jsmin是preferred,因为它的工作原理在运行蚂蚁的所有平台。

I also want to run jsmin on the files as well, but as part of the distribution task. So the same problem will appear again, e.g running a java task on multiple files. The java/JS implementation of jsmin is preferred since it works on all platforms that run ant.

我找不到蚂蚁一般的foreach任务处理集或相似的结构。我用Google搜索蚂蚁发现了一个附加软件包,提供了的foreach,但因为它不是标准的蚂蚁核心任务部分,我的感觉是我'在错误的轨道上。

I cannot find a generic "foreach" task in ant that processes a fileset or similar structure. I have googled ant found an add-on package that provides "foreach" but since its not part of the standard ant core tasks I get the feeling that I'am on the wrong track.

Exec任务可以遍历一个文件集,但我想运行在JVM内部,或者至少在一个分叉JVM犀牛。但作为最后的手段,当然可以从外部exec的java中,梅比认为是preferred方式。

The exec task can iterate over a fileset, but I want to run rhino inside the JVM or at least on a forked JVM. But as a last resort it is of course possible to exec java externally, maybee that is the preferred way.

推荐答案

答案是蚂蚁的contrib

的foreach 任务

这篇关于用于处理多个文件的Ant任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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