Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 99943 invoked from network); 10 May 2004 09:30:21 -0000 Received: from unknown (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 10 May 2004 09:30:21 -0000 Received: (qmail 95775 invoked by uid 500); 10 May 2004 09:30:29 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 95497 invoked by uid 500); 10 May 2004 09:30:27 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 95482 invoked by uid 98); 10 May 2004 09:30:26 -0000 Received: from jalberto@cellectivity.com by hermes.apache.org by uid 82 with qmail-scanner-1.20 (clamuko: 0.70. Clear:RC:0(212.18.242.163):. Processed in 0.323766 secs); 10 May 2004 09:30:26 -0000 X-Qmail-Scanner-Mail-From: jalberto@cellectivity.com via hermes.apache.org X-Qmail-Scanner: 1.20 (Clear:RC:0(212.18.242.163):. Processed in 0.323766 secs) Received: from unknown (HELO leeds.cellectivity.com) (212.18.242.163) by hermes.apache.org with SMTP; 10 May 2004 09:30:26 -0000 X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: antlibs and classloaders #2 Date: Mon, 10 May 2004 10:29:54 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: antlibs and classloaders #2 Thread-Index: AcQ0YgsRsEMEewu9SOSdOj/Yc22yOgCDeq3A From: "Jose Alberto Fernandez" To: "Ant Developers List" X-Spam-Rating: hermes.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N > From: Mariano Benitez [mailto:mariano@fuegolabs.com]=20 >=20 > but ... If I call "typedef" for the same file, with the same=20 > task, same=20 > uri, etc, why it redefine the tasks if they are already defined? >=20 > BTW, it could help an "unless" attribute for typedef, not to=20 > do it again :) > uri=3D"antlib:fuego.internal.test.ant" =20 > loaderRef=3D"fuego.internal.test"=20 > classpathref=3D"fuego.internal.test.antlibs.path" unless=3D"defined"/> > >=20 I would advocate for a new condition: " | name=3D"[:]"} /> Which is true for "uri" if there are things already defined in that uri; and for "name" if there is a definition already associated with that name (in te particular NS). This should include all kinds of definitions typedefs, macros, selectors, mappers, etc. We should add a "role" also once that issue is sorted out. Jose Alberto > MAriano >=20 > Peter Reilly wrote: >=20 > > Hi Mariano, > > I assume you are calling the "typedef" commands multiple times. > > - hence the different antloaders. But you only need to typedef the=20 > > types/tasks once. > > > > You should wrap the taskdefs in a macrodef or a target, > > and call them once in the master build file before doing > > any subant, or ant calls. > > > > Peter > > > > Mariano Benitez wrote: > > > >> I am at the edge of a mental crisis, I need help.... > >> > >> > >> Can someone explain how antlib paths and tasks works, I have this > >> situation that I cannot understand. > >> > >> > >> I defined this: > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> >> uri=3D"antlib:fuego.internal.test.ant" =20 > >> loaderRef=3D"fuego.internal.test" > >> classpathref=3D"fuego.internal.test.antlibs.path"/> > >> >> uri=3D"antlib:fuego.tools.ant.enterprise"=20 > >> loaderRef=3D"fuego.internal.test"=20 > >> classpathref=3D"fuego.internal.test.antlibs.path"/> > >> >> uri=3D"antlib:fuego.tools.ant.express" =20 > >> loaderRef=3D"fuego.internal.test"=20 > >> classpathref=3D"fuego.internal.test.antlibs.path"/> > >> >> uri=3D"antlib:fuego.tools.ant.j2ee" =20 > >> loaderRef=3D"fuego.internal.test"=20 > >> classpathref=3D"fuego.internal.test.antlibs.path"/> > >> > >> > >> another Jar "fuegocore.jar" is in the classpath manifest of those > >> jars, inside the fuegocore jar there is a clas "Loader". > >> > >> When I am executing one of the tasks in the antlib I do this. > >> > >> Inside an Utils.class static method: > >> task.log("[LOADERS] Loader Class [" +=20 > Loader.class.hashCode() > >> + "/" + Loader.class.getClassLoader() + "]"); > >> task.log("[LOADERS] Utils Class [" +=20 > Utils.class.hashCode() + > >> "/" + Utils.class.getClassLoader() + "]"); > >> > >> and this is the result I get when I run this multiple times in the > >> same ant run. > >> > >> [t:testsetup] [LOADERS] Loader Class > >> [6597453/java.net.URLClassLoader@affc70] > >> [t:testsetup] [LOADERS] Utils Class=20 > >> [19551658/org.apache.tools.ant.loader.AntClassLoader2@153f67e] > >> > >> [t:testsetup] [LOADERS] Loader Class > >> [6597453/java.net.URLClassLoader@affc70] > >> [t:testsetup] [LOADERS] Utils Class=20 > >> [10520143/org.apache.tools.ant.loader.AntClassLoader2@9a9b65] > >> > >> [t:testsetup] [LOADERS] Loader Class > >> [6597453/java.net.URLClassLoader@affc70] > >> [t:testsetup] [LOADERS] Utils Class=20 > >> [28623319/org.apache.tools.ant.loader.AntClassLoader2@da90c] > >> > >> > >> > >> the thing is: WHY THE LOADER CLASS IS ALWAYS THE SAME=20 > WHILE THE UTILS > >> CLASS IS ALWAYS IN DIFFERENT ANT CLASSLOADERS!!! > >> > >> Also, If I put a static {} block in the Loader class it is invoked > >> many times, not only one as it should, being the same=20 > class the one=20 > >> being returned. > >> > >> Please help, I cannot understand what is causing this and the > >> side-effect is that I get OutOfMemory errors when I run=20 > nightly batch=20 > >> tests. > >> > >> > >> Everything is appreciated. > >> > >> MAriano > >> > >>=20 > --------------------------------------------------------------------- > >> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org > >> For additional commands, e-mail: dev-help@ant.apache.org > >> > >> > >> > > > > > >=20 > --------------------------------------------------------------------- > > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org > > For additional commands, e-mail: dev-help@ant.apache.org > > >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org > For additional commands, e-mail: dev-help@ant.apache.org >=20 >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org