I can't think of anything besides maybe saving the properties to a file and reading them back in again. But maybe there is a better/simpler solution to your problem. Maybe you could explain what you're really trying to achieve ;-)
As for the "base" buildfile problem. This topic has been discussed quite a lot on the mailing list. Some other tools based on Ant, like Maven or Centipede, seem to support something like this. I have developed a kind of templating mechanism for my own purposes, which lets me write templates which are "instantiated" by merging them with customizations, which basically just "override" and add stuff to the template. I also implemented my own AVTs (attribute value templates, which you might know from XSLT) letting me write XPath expressions like /project/@name or //target[@name = 'compile']/javac. The final buildfile generated is reduced to using standard Ant mechanisms and tasks. So depending on what you need you could always roll your own templating mechanism (using XSLT or whatever), use XML entity include (http://jakarta.apache.org/ant/faq.html#xml-entity-include), use external tools like Anthill, Maven, or Centipede, etc. -- knut > -----Original Message----- > From: Christian Holmqvist, IT, Posten > [mailto:[EMAIL PROTECTED]] > Sent: Dienstag, 20. August 2002 14:13 > To: 'Ant Users List' > Subject: Multiple build files problem, property passing > > > Hi! > > I'm trying to figure out how to create a "base" build.xml file. > > This is my example > --- build.xml ----- > <?xml version="1.0"?> > <project name="test" default="init" basedir="."> > <target name="init"> > <property name="prop" value="build.xml"/> > <ant antfile="hmm.xml" dir="${basedir}" target="init"/> > <echo message="${new_prop}"/> > </target> > </project> > ----- > > ----- hmm.xml --- > <?xml version="1.0"?> > <project name="hmm" default="init" basedir="."> > <target name="init"> > <property name="prop" value="hmm.xml"/> > <echo message="${prop}"/> > <property name="new_prop" value="tjohoo"/> > </target> > </project> > ------ > > The thing is that the prop property echos correctyly but the > new_prop does > not. Is there a way to "return" propertyes from a <ant> task? > > Or is there a bether way to do this? > > Cheers Christian > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
