Ant 得到蚂蚁<;修改>;让选择器正常工作

Ant 得到蚂蚁<;修改>;让选择器正常工作,ant,Ant,我在ANT中有一个目标,需要在给定的文件集上运行编译器两次:一次用于调试,一次用于生产。我只想在源文件发生更改时运行编译器,因此我设置了一个选择器。但是,由于我需要为给定的修改文件运行debug和prod任务,因此在第一次运行时,我将update属性设置为false。我有一些大致的想法: <!-- Do the debug build --> <apply executable="compiler"> <fileset dir="${js.src.dir}"

我在ANT中有一个目标,需要在给定的文件集上运行编译器两次:一次用于调试,一次用于生产。我只想在源文件发生更改时运行编译器,因此我设置了一个
选择器。但是,由于我需要为给定的修改文件运行debug和prod任务,因此在第一次运行时,我将
update
属性设置为false。我有一些大致的想法:

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

然而,这是行不通的。我对编译器的第一次调用最终还是更新了缓存,第二次调用被跳过。我错过了什么


更新:我通过使用
选择器解决了这个问题,但仍然很好奇如何使用

更新在1.8.0之前被破坏:


只花了大约5年就修好了

最好是生成一个编译宏定义,然后传入不同的参数进行调试和prod,而不是复制。