ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Klein, Scott @ TW" <scott.kl...@L-3com.com>
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>

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


Mime
View raw message