Summary: | [PROPOSAL, PATCH] External public entity and new system entity IDs. | ||
---|---|---|---|
Product: | Ant | Reporter: | Kevin Greiner <kevin.greiner> |
Component: | Core | Assignee: | Ant Notifications List <notifications> |
Status: | NEW --- | ||
Severity: | enhancement | Keywords: | PatchAvailable |
Priority: | P3 | ||
Version: | 1.7.0 | ||
Target Milestone: | --- | ||
Hardware: | Other | ||
OS: | other | ||
Attachments: | Install using 'patch -p 0 -i patch.txt' in ant directory |
Description
Kevin Greiner
2004-11-10 06:08:59 UTC
Created attachment 13368 [details]
Install using 'patch -p 0 -i patch.txt' in ant directory
Why donĀ“t you use <import>? I didn't use the import task for the following reasons: 1) It uses a file path rather than a URL to identify the contents. Right now, I'm actually packaging and distributing my shared files as a jar. That makes it easy to think of the shared code as a single unit (which is how it was tested). 2) Entities give me complete control over where they are inserted into my build file. As I understand it from various emails, the contents of an import task is appended to the input stream even though the import task may appear at the beginning of the stream. patching import to handle URI paths might be interesting, especially for that in-JAR use. It would complicate the model of knowing where things are; entity imports are less complex there as they are at the place of their inclusion. note that <taskdef> does work in jars, and that now lets you import declarations of -tasks and types -macros and presets -scripts and anything else of a type that is allowed (extends AntlibDefinition) -steve Right, I spent a good deal of time considering whether antlib provided an alternative implementation. I finally decided that they are orthoginal. The main point being that this patch simply provides streams to a wider range of URLs. I use it to define external entities. Other people may use those URLs with any task that accepts a URL. I also thought that it would be interesting to modify import to accept a URL. It's essentially a free-be as all that is needed is to add an new attribute to the task and then open the URL provided by that attribute. Another interesting idea is that if you embed Ant into another product, then that product could provide an EntityResolver that resolves a set of public entity Ids. If your ant task uses one of these Ids as a URL, you'd get a stream that connects to the encapsulating product rather than a physical file. Kevin |