得到蚂蚁<变形>选择正常工作 [英] Getting the Ant <modified> selector to work properly

查看:194
本文介绍了得到蚂蚁<变形>选择正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ANT的目标,需要运行在一个给定文件的编译两次:一次调试,一旦进行生产。我只是想,如果源文件已更改为运行编译器,所以我成立了一个<变形> 选择。然而,因为我既需要调试和督促任务,对于一个给定修改的文件运行,我在更新属性设置为false在第一次运行。我沿着线的东西:

I have a target in ANT that needs to run a compiler on a given set of files twice: once for debug, once for production. I only want to run the compiler if the source file has changed, so I set up a <modified> selector. However, since I need both the debug and prod task to run for a given modified file, I set the update property to false on the first run. I have something along the lines of:

<!-- Do the debug build -->
<apply executable="compiler">
    <fileset dir="${js.src.dir}" includes="*.js">
        <!-- don't update the cache so the prod build below works -->
        <modified update="false" 
            seldirs="true"
            cache="propertyfile"
            algorithm="digest"
            comparator="equal">
          <param name="cache.cachefile" value="cache.properties"/>
          <param name="algorithm.algorithm" value="md5"/>
        </modified>
    </fileset>
    <args for debug build/>
</apply>
<!-- Do the production build -->
<apply executable="compiler">
    <fileset dir="${js.src.dir}" includes="*.js">
        <modified update="true" 
            seldirs="true"
            cache="propertyfile"
            algorithm="digest"
            comparator="equal">
          <param name="cache.cachefile" value="cache.properties"/>
          <param name="algorithm.algorithm" value="md5"/>
        </modified>
    </fileset>
    <args for prod build/>
</apply>

然而,这是行不通的。我的编译器第一次调用结束反正更新缓存,第二个呼叫会跳过。缺少什么我在这里?

However this is not working. My first call to the compiler ends up updating the cache anyway, and the second call gets skipped. What am I missing here?

更新:我解决此问题得到了通过使用&LT;靠&GT; 选择器代替,但仍好奇如何做到使用相同的&lt;变形&GT;

UPDATE: I got around the problem by using the <depend> selector instead, but still curious how to accomplish the same using <modified>

推荐答案

更​​新被打破,直到显然1.8.0:

update is broken until apparently 1.8.0:

https://issues.apache.org/bugzilla/show_bug.cgi? ID = 32597

只花了5年时间解决!

这篇关于得到蚂蚁&lt;变形&GT;选择正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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