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.

Bug 199927 - Impossible to recognize build.xml as text/x-ant+xml
Summary: Impossible to recognize build.xml as text/x-ant+xml
Status: RESOLVED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 7.0
Hardware: PC Linux
: P3 normal (vote)
Assignee: Jesse Glick
URL:
Keywords: API
Depends on: 18910 142760
Blocks: 141355
  Show dependency tree
 
Reported: 2011-07-06 20:39 UTC by Jesse Glick
Modified: 2012-01-13 21:52 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2011-07-06 20:39:27 UTC
As discussed in bug #43871, it would be nice for any build.xml to be recognized as an Ant script, even if empty (so that XML sniffing cannot yet work).

Your obvious thought would be to extend ant-mime-resolver.xml to do this. But the DTD only allows matching on file extension, not full name. Bug #18910 discusses the arbitrariness of the declarative resolver syntax, though I think it does not specifically mention this limitation.

Even if you define a MIMEResolver (registered with @ServiceProvider) which makes this check, it is never called; due to the fix of bug #141355, the declarative resolver for *.xml is called first and claims it.

Used to be partially worked around by making AntProjectDataLoader treat all build.xml as an AntProjectDataObject, so it gets the right node (even though other features keyed off MIME type like the Navigator would not work), but I am dropping APDL in favor of DataLoaderPool.factory.
Comment 1 Quality Engineering 2011-07-07 14:02:56 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/9a4336f43c38
User: Jesse Glick <jglick@netbeans.org>
Log: Using standard DataLoaderPool.factory rather than a programmatic DataLoader.
(Minor functional regression #199927: cannot recognize empty build.xml.)
Comment 2 Jaroslav Tulach 2011-07-29 12:10:21 UTC
Sounds like an enhancement for additional DTD format. Feel free to donate patch.
Comment 3 Jesse Glick 2012-01-12 00:39:42 UTC
Actually it seems this case is possible now.
Comment 4 Jesse Glick 2012-01-12 00:40:20 UTC
core-main #e33b14dc3ef0
Comment 5 Quality Engineering 2012-01-13 21:52:14 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/e33b14dc3ef0
User: Jesse Glick <jglick@netbeans.org>
Log: #199927: Impossible to recognize build.xml as text/x-ant+xml