Re: Self-referencing Antlib limitation
Isn't it possible to use the "ant:current" uri to solve this issue, as described in the link below? http://ant.apache.org/manual/Types/antlib.html From: Nicolas Lalevée To: Ant Developers List Sent: Sunday, September 16, 2012 7:21 AM Subject: Self-referencing Antlib limitation I was still playing with classloaders and namespaces and antlib import with the AntDSL, and I encountered an unexpected limitation. What I found: an antlib which is referencing itself in its definition cannot be loaded dynamically via an uri other than its antlib one. This is the case for antunit: [...] [...] And the following doesn't work: (actually, this precise line works, but trying to use any antunit macro will fail) I think that the issue is how Ant interpret the namespace declaration in the antlib definition. In Antunit: When Ant is parsing it, it considers it as an antlib to be resolved later, whereas it should detect that this is the canonical uri of the antlib it is parsing, or sort of "this", and should use the uri actual used rather than the antlib one. The behavior only affect cases where somebody is trying to load two different versions of the same antlib. This is some quite edge case, but do we agree this is an issue ? I have committed a test case to see it in action. See r1385269. To run it, rename first broken_testURI to testURI in src/tests/antunit/taskdefs/taskdef-antlib-test.xml. I had a quick look to how to fix it. As far I can tell, the best way to do it is to: * in Definer.loadAntlib(ClassLoader, URL), make the createAntlib aware of the "resource" it was loaded from, and try to build an antlib uri from that. * in Antlib.createAntlib(), let the projecthelper parse the file to an unknown element with the 'incorrect' uri. But then make a deep lookup in the tree of UnknownElements and change everything that needs to be changed. It seems not trivial. Let me know what you think. Nicolas - To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org For additional commands, e-mail: dev-h...@ant.apache.org
Re: Promotion: Bugzilla 53723 - [Patch] Local task: local by prefix, all local, New: global task
Hi, FWIW, I approve generally of this feature and was soon going to start working on something similar, only I had intended to support regex matching. I'm not quite sure when I will be able to get back to work on Ant, but I need the feature so rest assured it will get in there at some point. Matt On Sun, Sep 16, 2012 at 7:04 AM, Vimil Saju wrote: > I like this feature. I have been using the local task multiple times in my > targets to name properties, this enhancement will make my build scripts much > more cleaner. > > > > From: Ralf > To: dev@ant.apache.org > Sent: Sunday, September 16, 2012 1:59 AM > Subject: Promotion: Bugzilla 53723 - [Patch] Local task: local by prefix, all > local, New: global task > > Hello, > > about a month ago I added an enhancement request with patch to ant bugzilla. > As there were no feedback on bugzilla, I thought I start a little promotion. > > The patch adds some functionality to the local task: > > > > > > > > > > > > Additionally the new task "global" was added to be able to export a > property from a scope if all other properties are defined local. > > > > > > > > Most important for me (and hopfully others) are the addition to the > local task (local-by-prefiy and all-local). The global tasks seems > like a logical implication to me. > > Please have a look at the description for Bugzilla 53723 and the patch. > It would be great if this enhancement would be included into ant. > > Regards, > Ralf > > PS: https://issues.apache.org/bugzilla/show_bug.cgi?id=53723 > > - > To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org > For additional commands, e-mail: dev-h...@ant.apache.org - To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org For additional commands, e-mail: dev-h...@ant.apache.org
Self-referencing Antlib limitation
I was still playing with classloaders and namespaces and antlib import with the AntDSL, and I encountered an unexpected limitation. What I found: an antlib which is referencing itself in its definition cannot be loaded dynamically via an uri other than its antlib one. This is the case for antunit: [...] [...] And the following doesn't work: (actually, this precise line works, but trying to use any antunit macro will fail) I think that the issue is how Ant interpret the namespace declaration in the antlib definition. In Antunit: When Ant is parsing it, it considers it as an antlib to be resolved later, whereas it should detect that this is the canonical uri of the antlib it is parsing, or sort of "this", and should use the uri actual used rather than the antlib one. The behavior only affect cases where somebody is trying to load two different versions of the same antlib. This is some quite edge case, but do we agree this is an issue ? I have committed a test case to see it in action. See r1385269. To run it, rename first broken_testURI to testURI in src/tests/antunit/taskdefs/taskdef-antlib-test.xml. I had a quick look to how to fix it. As far I can tell, the best way to do it is to: * in Definer.loadAntlib(ClassLoader, URL), make the createAntlib aware of the "resource" it was loaded from, and try to build an antlib uri from that. * in Antlib.createAntlib(), let the projecthelper parse the file to an unknown element with the 'incorrect' uri. But then make a deep lookup in the tree of UnknownElements and change everything that needs to be changed. It seems not trivial. Let me know what you think. Nicolas - To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org For additional commands, e-mail: dev-h...@ant.apache.org
Re: Promotion: Bugzilla 53723 - [Patch] Local task: local by prefix, all local, New: global task
I like this feature. I have been using the local task multiple times in my targets to name properties, this enhancement will make my build scripts much more cleaner. From: Ralf To: dev@ant.apache.org Sent: Sunday, September 16, 2012 1:59 AM Subject: Promotion: Bugzilla 53723 - [Patch] Local task: local by prefix, all local, New: global task Hello, about a month ago I added an enhancement request with patch to ant bugzilla. As there were no feedback on bugzilla, I thought I start a little promotion. The patch adds some functionality to the local task: Additionally the new task "global" was added to be able to export a property from a scope if all other properties are defined local. Most important for me (and hopfully others) are the addition to the local task (local-by-prefiy and all-local). The global tasks seems like a logical implication to me. Please have a look at the description for Bugzilla 53723 and the patch. It would be great if this enhancement would be included into ant. Regards, Ralf PS: https://issues.apache.org/bugzilla/show_bug.cgi?id=53723 - To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org For additional commands, e-mail: dev-h...@ant.apache.org
Promotion: Bugzilla 53723 - [Patch] Local task: local by prefix, all local, New: global task
Hello, about a month ago I added an enhancement request with patch to ant bugzilla. As there were no feedback on bugzilla, I thought I start a little promotion. The patch adds some functionality to the local task: Additionally the new task "global" was added to be able to export a property from a scope if all other properties are defined local. Most important for me (and hopfully others) are the addition to the local task (local-by-prefiy and all-local). The global tasks seems like a logical implication to me. Please have a look at the description for Bugzilla 53723 and the patch. It would be great if this enhancement would be included into ant. Regards, Ralf PS: https://issues.apache.org/bugzilla/show_bug.cgi?id=53723 - To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org For additional commands, e-mail: dev-h...@ant.apache.org
Bug report for Ant [2012/09/16]
+---+ | Bugzilla Bug ID | | +-+ | | Status: UNC=Unconfirmed NEW=New ASS=Assigned| | | OPN=ReopenedVER=Verified(Skipped Closed/Resolved) | | | +-+ | | | Severity: BLK=Blocker CRI=Critical REG=Regression MAJ=Major | | | | MIN=Minor NOR=NormalENH=Enhancement TRV=Trivial | | | | +-+ | | | | Date Posted | | | | | +--+ | | | | | Description | | | | | | | | 5003|Opn|Blk|2001-11-21|exec task does not return after executed command f| | 6606|Opn|Enh|2002-02-21|META-BUG problems with delegating classloaders| | 7712|New|Enh|2002-04-03|Provide patternset support for VSSGET task? | | 8294|New|Enh|2002-04-19|: Allow and to app| | 8866|New|Enh|2002-05-07|Signal handling in java task | | 8895|New|Enh|2002-05-08|ant and/or antcall should support forking | | 8972|New|Enh|2002-05-10|allow property expansion in property v| | 8981|New|Enh|2002-05-10|Tar task command additional features | | 9294|New|Enh|2002-05-21|[PATCH] optional/j2ee/ServerDeploy OC4J Support | | 9784|New|Enh|2002-06-11|BuildNumber task: make more extendable... | | 9995|Ass|Enh|2002-06-19|MKS Source Integrity tasks| |10020|New|Enh|2002-06-19|'s dependency behaviour should be more con| |10231|New|Enh|2002-06-25|Need access to current file in SQLExec| |10283|New|Enh|2002-06-27|Add a destfile to the uptodate task | |10402|New|Enh|2002-07-02|adding the ability of html like whitespace preserv| |3|New|Enh|2002-07-24|keytool task | |11560|Opn|Enh|2002-08-08|Taskdef does not apply reverseLoader policy on sta| |12267|New|Enh|2002-09-03|Add ability to unzip into separate folders| |12292|New|Enh|2002-09-04|[PATCH] enable tag inside tar| |12334|New|Enh|2002-09-05|REQUEST: Ant task doesn't allow attachment of a bu| |12518|New|Enh|2002-09-11|Gunzip & BUnZip2 add filesets, patternsets, and ov| |12765|New|Enh|2002-09-18|"rmdir" and "deltree" patches for ftp task enhance| |12964|New|Enh|2002-09-24|ANTLR only takes one input file at a time | |13047|Inf|Enh|2002-09-26|Support for and on O| |13048|New|Enh|2002-09-26|Add an optional containsall attribute to LineConta| |13371|New|Enh|2002-10-07|[PATCH] Contributed new CvsExportDiff task| |13847|New|Nor|2002-10-22|pvcs task: wrong option (-r) specified for get (sh| |13934|New|Enh|2002-10-24|Translate task shouldn't load default locale prope| |13939|New|Enh|2002-10-24|Translate task should have better key matching cap| |14320|New|Enh|2002-11-06|copy fileset followsymlinks="false" does not copy | |14393|New|Enh|2002-11-08|Support use of jndi within ant| |14512|New|Enh|2002-11-13|Allow creating database connection similar to with does not spot bad symlin| |15149|New|Enh|2002-12-06|Replace task | |15244|New|Enh|2002-12-10|tar task should be able to store symbolic links as| |15430|New|Enh|2002-12-17|Enhancement to ReplaceRegExp.java | |15596|New|Enh|2002-12-21|Identity mapper in uptodate task. | |15729|Ass|Nor|2002-12-31|StarTeam rootLocalFolder should be java.io.File | |15747|New|Enh|2003-01-01|change tasks (e.g. Ant) to take urls as well as fi| |15853|New|Enh|2003-01-07|Allow to plug-in different XML Catalog resolver in| |15949|Opn|Enh|2003-01-10|please provide links to docs.xml and jakarta-site2| |16131|New|Enh|2003-01-15|not possible to suppress "BUILD SUCCESSFUL" messag| |16255|New|Enh|2003-01-20|XmlLogger without DOM tree| |16427|New|Enh|2003-01-26|Output return value of setLastModified/document be| |16469|New|Enh|2003-01-27|Apply task should allow parallel execution on diff| |16494|New|Enh|2003-01-28|[PATCH] accessibility of Ant documentation| |16562|New|Enh|2003-01-29|Can not accept characters from keyboard in a thre| |16860|New|Enh|2003-02-06|Silent or Debug a single target | |16896|New|Enh|2003-02-07|Support in ProjectHelper / ProjectHelperImpl to op| |17074|New|Enh|2003-02-14|Contribution for WLSTOP | |17181|New|Nor|2003-02-18|Build fails while trying to get VSS files by label| |17372|New|Enh|2003-02-25|Enhancement of replace Task | |17742|New|Maj|2003-03-06|PVCS task generates GET with promotion group incor|