ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rashmi Rubdi" <>
Subject Selector with an if condition.
Date Sat, 24 Nov 2007 16:26:15 GMT
Hello Everyone,

I'm using the modified selector to execute a task only if a .xml file
was changed, the modified selector works as expected.

However, I'm trying to get the selector to be in effect only if the
"if" , condition is met. The if condition is there to disable the
selector incase the classes output directory doesn't exist.

The selector seems to take effect regardless of what's in the "if" condition.

Here's a small snippet of the ant build file.

        <available file="output/classes" property="output_dir_exists"
type="dir" value="true"/>

         <selector id="xml_file_modified" if="${output_dir_exists}">
            <modified update="true"
                <param name="cache.cachefile"     value=""/>
                <param name="algorithm.algorithm" value="MD5"/>

     <javac .........>
        <fileset dir="src">
            <selector refid="xml_file_modified"/>

I tried many other things like using the "unless" attribute instead of
"if" attribute.

I also checked the Ant manual.

The version of Ant is 1.7 and JDK 1.6.

Any help is appreciated.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message