This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Change registration mechanism for in-VM taskdefs | ||
---|---|---|---|
Product: | projects | Reporter: | Jesse Glick <jglick> |
Component: | Ant | Assignee: | Jesse Glick <jglick> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | apireviews |
Priority: | P2 | Keywords: | API, API_REVIEW_FAST |
Version: | 3.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | TASK | Exception Reporter: | |
Bug Depends on: | 38330 | ||
Bug Blocks: | 20211, 35756, 36702 | ||
Attachments: | Current patch (lightly edited to exclude irrelevant temporary changes, and also including a patch to autoupdate; #38330 patch not included) |
Description
Jesse Glick
2003-12-23 23:26:22 UTC
Branched: cvs rtag -b -r BLD200312231900 ant_nblib_38306 ant debuggerjpda apisupport *** Issue 36778 has been marked as a duplicate of this issue. *** Might be necessary to modify #7 and #8 so that under Ant 1.5.x, the defs are added to the project with no namespace qualification, but under Ant 1.6.x they are added *both* with and without namespace qualification. Reasons for the change: 1. There does not appear to be any way to ask a Project, once parsed, whether it was using antlib:org.apache.tools.ant on <project> or not. You could do this check separately using AntProjectCookie, though that would be a bit of a performance hit in case the project would not otherwise have been parsed. 2. It is probably pretty common to have a wrapper script which calls the real implementation. The real implementation might be namespace-qualified; who knows if the wrapper script is or not. 3. Not really intuitive that making a usually no-op change (adding the namespace qualification to <project>) would affect these taskdefs. Branching also core and openide to support issue #38330 - same tag name and base tag. Seems to be working OK. Code completion does not grok the namespaced tags yet, but that is a separate issue (much lower priority). Specifically these things work: 1. Running w/ no namespaces under Ant 1.5. 2. Running w/ no namespaces under Ant 1.6. 3. Running w/ namespaces under Ant 1.6. 4. Error signaled under Ant 1.6 w/ namespaces if the task name is wrong, or the namespace is wrong, or the namespace prefix is nonexistent. 5. Warning signaled under Ant 1.6 w/ namespaces by Ant module when attempting to load custom defs with an unknown element in antlib.xml. 6. Error signaled under Ant 1.6 w/ namespaces by Ant itself when antlib.xml contains an unknown element. 7. Under all 3 scenarios, if the module defining the task is disabled, the build fails with a proper message from Ant that the task was not defined. 8. From commandline, running namespaced build script with Ant 1.6 with CLASSPATH containing openide.jar and org-netbeans-modules-ant-browsetask.jar, the definition succeeds with the implicit antlib and NbBrowse gets as far as a NPE (URLDisplayer.default == null), i.e. as far as can be expected given that it cannot run successfully outside the NB JVM. Performance is still not great for Ant 1.6 - cca. 100msec per build to load custom defs from three modules. Will add caching to try to improve this. Under Ant 1.5, overhead is still negligible (1msec). Added caching of class loaders for ant/nblib/*.jar (easy), and removed SPL comments from antlib.xml's to speed parsing. Seems to have reduced overhead (under Ant 1.6) somewhat, to perhaps 40msec per build for three provider modules (times are quite variable however). OptimizeIt says that most of that overhead is parsing antlib.xml, and that most of the parsing time is actually spent getting parser objects; this should be unnecessary, so I filed http://issues.apache.org/bugzilla/show_bug.cgi?id=25767 Created attachment 12677 [details]
Current patch (lightly edited to exclude irrelevant temporary changes, and also including a patch to autoupdate; #38330 patch not included)
Submitting for API review. Incompatible, but only within the 3.6 dev cycle, and only for modules using this part of the Ant module API - as far as I know, just three, all experimental, all maintained by myself - and the changes required to support the new registration mechanism are trivial (packaging only, not code). I have added an arch desc for the Ant module in the trunk, for your reference. Should be visible in next daily Javadoc build. The trunk arch desc reflects changes made in this issue in a couple of places. Provisionally marking this section of the API as devel stability; should be supported, but there is little data to tell if the API is adequate for all users, since I seem to be the only one. Planned for commit to trunk during the day (US time) on Wednesday. committed 1.64 ant/manifest.mf committed 1.7 ant/api/doc/changes/apichanges.xml committed 1.4 ant/api/doc/org/apache/tools/ant/module/api/package.html committed 1.7 ant/browsetask/build.xml committed 1.4 ant/browsetask/manifest.mf removed 1.2 ant/browsetask/src/META-INF/taskdefs.properties committed 1.2 ant/browsetask/src/org/netbeans/modules/ant/browsetask/antlib.xml committed 1.7 ant/src-bridge/org/apache/tools/ant/module/bridge/impl/BridgeImpl.java committed 1.2 ant/src-bridge/org/apache/tools/ant/module/bridge/impl/NbAntlib.java committed 1.19 ant/src/org/apache/tools/ant/module/api/IntrospectedInfo.java committed 1.8 ant/src/org/apache/tools/ant/module/bridge/AntBridge.java committed 1.4 ant/src/org/apache/tools/ant/module/bridge/AuxClassLoader.java committed 1.3 ant/src/org/apache/tools/ant/module/bridge/BridgeInterface.java committed 1.3 ant/src/org/apache/tools/ant/module/bridge/DummyBridgeImpl.java committed 1.4 ant/src/org/apache/tools/ant/module/resources/mime-resolver.xml committed 1.19 apisupport/ant/build.xml committed 1.13 apisupport/ant/manifest.mf removed 1.2 apisupport/ant/src/META-INF/taskdefs.properties committed 1.2 apisupport/ant/src/org/netbeans/modules/apisupport/ant/antlib.xml committed 1.26 autoupdate/src/org/netbeans/modules/autoupdate/SignVerifier.java committed 1.6 debuggerjpda/ant/build.xml committed 1.2 debuggerjpda/ant/manifest.mf removed 1.2 debuggerjpda/ant/src/META-INF/taskdefs.properties committed 1.2 debuggerjpda/ant/src/org/netbeans/modules/debugger/jpda/ant/antlib.xml committed 1.35 performance/threaddemo/build.xml |