如何执行已修改只在文件Ant任务 [英] How to execute ANT tasks on only files that have been modified

查看:151
本文介绍了如何执行已修改只在文件Ant任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个生成脚本,做一些事情(最小化的JavaScript,上传到Amazon S3等)。最小化的ANT任务只能对我已经修改,而忽略其余的JavaScript(我没有写这个脚本)。我愿做其中只有更新的内容在任务上传Amazon S3的任务类似的东西。如何做到这一点的任何线索将不胜AP preciated。

I have a build script that does a number of things (minimize javascript, upload to amazon s3 etc). The minimize ANT task only operates on the javascript that I have modified and ignores the rest (I didn't write this script). I would like to do something similar for the amazon s3 task where only the updated content is upload in the task. Any leads on how to do this would be greatly appreciated.

推荐答案

您可以选择与修改的日期标签的文件集。修改后的标签是出奇的强大,所以检查出来:蚂蚁选择器 - 改性

You can select a fileset with a modified date tag. The modified tag is insanely powerful, so check it out: Ant Selectors - Modified.

为了它告诉发生了什么变化,它可以保持在一个属性文件高速缓存,每个成功构建后更新,除非您使用delayupdate属性 - 所以也许测试它,你可以有:

In order for it to tell what has changed, it can keep a cache in a property file, which updates after each successful build, unless you use the delayupdate attribute - so perhaps to test it, you can have:

<param name="commitUpdate" value="false" />
[...]
<ftp ...>
    <fileset dir="src">
        <modified delayupdate="${commitUpdate}" />
    </fileset>
</ftp>

当然,你可以通过命令行参数或一些设置commitUpdate。

And of course you could set that commitUpdate via a command-line param or something.

这篇关于如何执行已修改只在文件Ant任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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