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 20:56:17 GMT
One way to do this is with <antcall>.  I have been
known to use ant-contrib's <foreach> to iterate
through a set of subproject directory names, for
example, to make antcalls to a generic target,
specifying the subproject to build.

Am I making sense?

-Matt

--- "Klein, Scott @ TW" <scott.klein@L-3com.com>
wrote:
> Sorry, I thought I had explained that. I am trying
> to make multiple calls to
> a 'generic' target (see example below), but have the
> execution of said
> target be based on a property. This means that a
> property must be able to be
> "unset". Note that since Ant doesn't support if/else
> I assume that the only
> way to do this is with properties.
> 
> 
> Here is an example:
> 
> 	<target name="copyFile" if="copy.file.exists">
> 		<copy file="${copy.from.filename}"
> tofile="${copy.to.filename}" overwrite="true" />
> 	</target>
> 
> 	<target name="moveStuffAround"
> depends="moreMoving">
> 		<uptodate property="copy.from.filename"
> value="${FROM_DIR}\${USER_FILE}" />
> 		<uptodate property="copy.to.filename"
> value="${TO_DIR}\${USER_FILE}" />
> 		<condition property="copy.file.exists">
> 			<available file="${copy.from.filename}" />
> 		</condition>
> 		<antcall target="copyFile" inheiritAll="true" />
> 	</target>
> 
> 	<target name="moreMoving">
> 		<uptodate property="copy.from.filename"
> value="aFile.file"
> />
> 		<uptodate property="copy.to.filename"
> value="anotherFile.file" />
> 		<condition property="copy.file.exists">
> 			<available file="${copy.from.filename}" />
> 		</condition>
> 		<antcall target="copyFile" inheiritAll="true" />
> 
> 	</target>
> 
> so the problem that arises is that once the
> 'copy.file.exists' property is
> set the call to copyFile will _forever after_ be
> allowed. 
> 
> I know Ant can do what I want to do, the question is
> how efficiently? 
> 
> -----Original Message-----
> From: Dominique Devienne [mailto:DDevienne@lgc.com]
> Sent: Wednesday, November 13, 2002 12:01 PM
> To: 'Ant Users List'
> Subject: RE: conditions and property's
> 
> 
> You should not depend on any logic which requires
> unsetting a property...
> That's just how Ant works and was designed. I'm
> pretty sure Ant can do what
> you want it to do, provided you shift your thinking
> around... Ant is not a
> scripting language, and whenever one tries to bend
> it that way, it quickly
> becomes painful!
> 
> Maybe describe what you want to do as opposed to how
> you were trying to do
> it, and someone's bound to find a solution. --DD
> 
> -----Original Message-----
> From: Matt Benson [mailto:gudnabrsam@yahoo.com] 
> Sent: Wednesday, November 13, 2002 1:52 PM
> To: Ant Users List; Hari Kodungallur
> Subject: Re: conditions and property's
> 
> As I understand it, you could unset a property
> programmatically, but not via normal use of the
> property task in an Ant buildfile.
> 
> -Matt
> 
> --
> To unsubscribe, e-mail:  
> <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:ant-user-help@jakarta.apache.org>
> 
> --
> 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