From: Dominique D. <DDe...@lg...> - 2005-09-19 14:02:08
|
Maybe you should reconsider your choices, and not used <var> and <runtarget= > at all, no? Both are hacks, and <var> only exists because of a hole in th= e Ant code which is kept around to preserve BC only. <runtarget> is simply = an optimization of <antcall>, or can often be replaced by target dependenci= es is the same context if required to "pass back" properties/references. In= the remaining cases, <macrodef> comes to the rescue. I'm building dozens of projects amounting to millions of lines of code with= out it just fine. These 2 Ant-Contrib tasks are to be avoided at best. I strongly advise you architecture your builds the Ant way. It works for ma= ny many people, so it can probably work for you too. If you need a scripty = build system, consider SCons or A-A-P, which are both Python based and give= you the full Python power to script things. --DD > -----Original Message----- > From: ant...@li... [mailto:ant- > con...@li...] On Behalf Of > ant...@no... > Sent: Monday, September 19, 2005 2:01 AM > To: ant...@li... > Subject: RE: [Ant-contrib-developers] runtarget, still >=20 > Yes, sorry, typo. Doesn't make the problem go away though, as you may have > guessed. >=20 > -- > Antti >=20 > > -----Original Message----- > > From: ext Justin Mahoney [mailto:ju...@wi...] > > Sent: 16 September, 2005 18:33 > > To: Kivimaki Antti (Nokia-TP-MSW/Tampere) > > Cc: ant...@li... > > Subject: Re: [Ant-contrib-developers] runtarget, still > > > > > > Shouldn't othertarget be: > > > > <target name=3D"othertarget"> > > <echo>${myvar}</echo> > > </target> > > > > > > ant...@no... wrote: > > > > > Hi, > > > > > > I've been doing some debugging inside Ant, related to the > > problem that makes it practically impossible to use runtarget > > to call the same target twice. > > > > > > Basically the problem seems to exist because Ant re-uses > > all Task objects. When a target (that has already been > > executed within the same project's scope either because of a > > dependency or runtarget) is executed using runtarget, the > > Task objects are not reconfigured. E.g. an Echo task's output > > string containing variables will only be expanded the first > > time the target containing the task is executed. In Echo's > > case this means that a specific Echo-tag in a target can only > > display the same string over and over if the target is > > executed multiple times using runtarget. > > > > > > Hence the following does _not_ display a, b, but a, a. > > > > > > <target name=3D"firsttarget" /> > > > <var name=3D"myvar" value=3D"a" /> > > > <runtarget target=3D"othertarget" /> > > > <var name=3D"myvar" value=3D"b" /> > > > <runtarget target=3D"othertarget" /> > > > </target> > > > > > > <target name=3D"othertarget"> > > > <echo>${othertarget}</echo> > > > </target> > > > > > > I have not studied the implications to other tasks, but it > > seems like a global problem. > > > > > > > > > If, however, in the above example the echo-task is nested > > in a Sequential task (or e.g. if-then-block which seems to > > use Sequential underneath) it works ok. For some reason the > > setProxy method of RuntimeConfigurable gets called for all of > > Sequential's nested tasks, causing the proxyConfigured field > > to be reset and eventually the underlying Task object to be > > reconfigured in maybeConfigure-method every time the > > Sequential is executed. > > > > > > > > > Did I make any sense? Probably not. Still, based on this, > > could anybody please be able to help me on how to make > > runtarget work properly when calling a target more than once? > > To me it doesn't matter whether I have to patch Ant or > > Ant-contrib or both. > > > > > > > > > Thanks, > > > Antti Kivim=E4ki > > > > >=20 >=20 > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App Server. > Download it for free - -and be entered to win a 42" plasma tv or your very > own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php > _______________________________________________ > Ant-contrib-developers mailing list > Ant...@li... > https://lists.sourceforge.net/lists/listinfo/ant-contrib-developers ---------------------------------------------------------------------- This e-mail, including any attached files, may contain confidential and pri= vileged information for the sole use of the intended recipient. Any review= , use, distribution, or disclosure by others is strictly prohibited. If yo= u are not the intended recipient (or authorized to receive information for = the intended recipient), please contact the sender by reply e-mail and dele= te all copies of this message. |