ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <mgai...@hotmail.com>
Subject RE: Selector with an if condition.
Date Sat, 24 Nov 2007 20:43:29 GMT

<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: rgenter@silverlink.com> To: user@ant.apache.org>
> On 11/24/07 8:26 AM, "Rashmi Rubdi" <rashmi.sub@gmail.com> 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> rgenter@silverlink.com> www.silverlink.com>
> > ---------------------------------------------------------------------> To unsubscribe,
e-mail: user-unsubscribe@ant.apache.org> For additional commands, e-mail: user-help@ant.apache.org>

_________________________________________________________________
Connect and share in new ways with Windows Live.
http://www.windowslive.com/connect.html?ocid=TXT_TAGLM_Wave2_newways_112007
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message