<available file="output/classes" property="output_dir_exists" type="dir" 
value="true"/>
<!-- execute selector code but first test the value of the property -->
 <selector if="output_dir_exists">
 <!-- do something here --> 
</selector>Martin--______________________________________________Disclaimer and 
confidentiality noteEverything in this e-mail and any attachments relates to 
the official business of Sender. This transmission is of a confidential nature 
and Sender does not endorse distribution to any party other than intended 
recipient. Sender does not necessarily endorse content contained within this 
transmission.> Date: Sat, 24 Nov 2007 09:45:50 -0800> Subject: Re: Selector 
with an if condition.> From: [EMAIL PROTECTED]> To: [email protected]> > 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]> 
_________________________________________________________________
Connect and share in new ways with Windows Live.
http://www.windowslive.com/connect.html?ocid=TXT_TAGLM_Wave2_newways_112007

Reply via email to