On 11/24/07 8:26 AM, "Rashmi Rubdi" <[EMAIL PROTECTED]> wrote:

> 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}">

I haven't checked the manual to see if <selector> even takes the "if"
attribute, but for those elements that do take the "if" attribute, the value
should be the name of the property, not its value:

           <selector id="xml_file_modified" if="output_dir_exists">

>             <modified update="true"
>                       seldirs="false"
>                       cache="propertyfile"
>                       algorithm="digest"
>                       comparator="equal">
>                 <param name="cache.cachefile"     value="cache.properties"/>
>                 <param name="algorithm.algorithm" value="MD5"/>
>             </modified>
>           </selector>
> 
>      <javac .........>
>         <fileset dir="src">
>             <selector refid="xml_file_modified"/>
>             <includes
>         </fileset>
>       </javac>
> 
> 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.

-- 
Rick Genter
Principal Software Engineer
Silverlink Communications
[EMAIL PROTECTED]
www.silverlink.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to