ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Klein, Scott @ TW" <>
Subject conditions and property's
Date Wed, 13 Nov 2002 17:53:43 GMT
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 name="foo" if="bar">
		.. do some stuff ..
		?? unset the property bar ??

	<target name="foobar">
		<condition name="bar">
			.. whatever ..
		<antcall target="checkErrorForFoo">
		<antcall target="foo">

		<condition name="bar">
			.. whatever ..
		<antcall target="checkErrorForFoo">
		<antcall target="foo">

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.


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

View raw message