Hi, This is what I would have expected right from the beginning, why was the current behavior ever introduced? I always thought it was non-intuitive that properties in tasks that are never executed still get set.
Marcel > -----Original Message----- > From: Stefan Bodewig [mailto:[EMAIL PROTECTED] > Sent: vrijdag 8 september 2000 12:43 > To: [EMAIL PROTECTED] > Subject: Proposed way to make ${} happen at runtime > > > Hi, > > the appended patch will move ${} expansion (and the execution of all > tasks, including <property>) to runtime instead of parser time. > > As there are so many ways this could be implemented I wanted to make > sure I'm not totally of the hook and have introduced silly design > flaws. Therefore I wanted to get you comments before I commit > anything. > > The patched version has been working for me (bootstrapped Ant and > built Tomcat as well as my private projects successfully). > > <project name="test" default="echo"> > <target name="echo1"> > <echo message="${echo1}" /> > </target> > <property name="echo1" value="set globally" /> > > <target name="echo2" depends="setup2"> > <echo message="${echo2}" /> > </target> > > <target name="setup2"> > <property name="echo2" value="set after first use" /> > </target> > > <target name="setup3a"> > <property name="echo3" value="set in unused target" /> > </target> > > <target name="setup3"> > <property name="echo3" value="set before first use" /> > </target> > > <target name="echo3" depends="setup3"> > <echo message="${echo3}" /> > </target> > > <target name="echo" depends="echo1,echo2,echo3" /> > </project> > > will now generate > > echo1: > set globally > setup2: > echo2: > set after first use > setup3: > echo3: > set before first use > echo: > > instead of > > echo1: > ${echo1} > setup2: > echo2: > ${echo2} > setup3: > echo3: > set in unused target > echo: > > Comments please (including how stupid I am if this should be true). > > Stefan > >
