ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: conditions and property's
Date Wed, 13 Nov 2002 19:51:58 GMT
As I understand it, you could unset a property
programmatically, but not via normal use of the
property task in an Ant buildfile.

-Matt

--- Hari  Kodungallur <hkodungallur@rediffmail.com>
wrote:
> actually, it will be very helpful for me also to
> know whether we 
> can unset a property.
> 
> scott, however, you can use the <if> task provided
> by ant-contrib 
> (its on sourceforge
> http://sourceforge.net/projects/ant-contrib) 
> as a work around. thats what i am doing now
> 
> say the value of the property "this.target.built"
> can be either 
> "true" or "false"
> 
> then you can do something like
> 
> <if>
>      <equals arg1="${this.target.built}"
> arg2="true"/>
>      <then>
>          ...
>      </then>
>      <else>
>          ...
>      </else>
> </if>
> 
> -hk
> 
> 
> 
> 
> On Wed, 13 Nov 2002 Klein, Scott @ TW wrote :
> >OK. So I have determined that Ant is currenty not
> capable of 
> >doing the
> >following within a single task (if I'm wrong,
> please correct 
> >me):
> > 	if condition exists, do stuff
> > 	else stop executing script
> >
> >however, in order to make my targets re-useable for
> a variety of 
> >purposes I
> >require my properties to be UNset after they are
> checked:
> > 	<target name="checkErrorForFoo" unless="bar">
> > 		<fail />
> > 	</target>
> >
> > 	<target name="foo" if="bar">
> > 		.. do some stuff ..
> > 		?? unset the property bar ??
> > 	</target>
> >
> > 	<target name="foobar">
> > 		<condition name="bar">
> > 			.. whatever ..
> > 		</condition>
> > 		<antcall target="checkErrorForFoo">
> > 		<antcall target="foo">
> >
> > 		<condition name="bar">
> > 			.. whatever ..
> > 		</condition>
> > 		<antcall target="checkErrorForFoo">
> > 		<antcall target="foo">
> > 	</target>
> >
> >So I only want target "foo" to execute under
> certain conditions, 
> >however
> >once the property is set there is no way to unset
> it. Say I want 
> >foo to be
> >copyFile then I need to have copyFileForTarget1 
> >copyFileForTarget2 - plus
> >all of the properties and error checks (which is
> another 
> >story).
> >
> >I've read that something much easier is being
> promised in Ant2, 
> >but
> >shouldn't simple logic be supported already? It
> just seems 
> >strange to me
> >that it is not.
> >
> >Anyway, if there is a simple solution to this that
> I've missed I 
> >would love
> >to hear about it.
> >
> >
> >thanks
> >scott
> >
> >--
> >To unsubscribe, e-mail:   
> ><mailto:ant-user-unsubscribe@jakarta.apache.org>
> >For additional commands, e-mail: 
> ><mailto:ant-user-help@jakarta.apache.org>
> >
> 
>
__________________________________________________________
> Give your Company an email address like
> ravi @ ravi-exports.com.  Sign up for Rediffmail Pro
> today!
> Know more. http://www.rediffmailpro.com/signup/
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:ant-user-help@jakarta.apache.org>
> 


__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message