ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Weller <dgwel...@yahoo.com>
Subject RE: another request for help....
Date Tue, 08 Aug 2000 20:59:43 GMT
Well, what you suggest is exactly what I want to do, but properties are
immutable (See results of your suggestion below).  Property != variable (I
learned this the hard way :-).  The XML files are parsed to completion before
they are invoked in any way, thus it really isn't possible to have a "variable"
in the traditional sense.

Any ideas on how we can have "variables" in Ant buildfiles?  Otherwise, I'm
gonna hafta go running back to gnumake for a while :-(


 
> So your global build file would be like :
> 
> 
> <property name="first" value="1">
> <ant buildfile="unit.xml">
> 
> <property name="first" value="2">
> <ant buildfile="unit.xml">
> 
> 
> Hope you got what I'm getting at.
> 
Yeah, here's an example buildfile snippet:

  <target name="common_subject">
	<property name="first" value="foo"/>
	<property name="second" value="bar"/>
	<ant antfile="build_nothing.xml"/>

	  <property name="first" value="baz"/>
	  <property name="second" value="buz"/>
	  <ant antfile="build_nothing.xml"/>

	  <property name="first" value="this"/>
	  <property name="second" value="that"/>
	  <ant antfile="build_nothing.xml"/>
  </target> 

And this is the result (had to turn "verbose" on to see it):
 +Target: common_subject
   +Task: property
Setting project property: first -> foo
   +Task: property
Setting project property: second -> bar
   +Task: ant
   +Task: property
 [property] Override ignored for first
   +Task: property
 [property] Override ignored for second
   +Task: ant
   +Task: property
 [property] Override ignored for first
   +Task: property
 [property] Override ignored for second
   +Task: ant


__________________________________________________
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/

Mime
View raw message