ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonathan doklovic>
Subject Re: import file from jar (or classpath)
Date Mon, 14 Jan 2008 14:27:28 GMT
[this should probably move to the dev list?]

After writing the patch for the import task, I also noticed that DefBase
includes most of the methods needed to load a classpath resource,
however, it extends AntlibDefinition. I think it would be a useful
refactoring to create a ResourceBase that other classes including
AntLibDefinition can subclass when the task needs to load a classpath

- Jonathan

On Mon, 2008-01-14 at 13:14 +0000, Steve Loughran wrote:
> jonathan doklovic wrote:
> > Hi,
> > 
> > I know there's not currently a way to do this, but I think it would be
> > very helpful to be able to use the import task to import a file from a
> > jar.
> > 
> > This way, when I have a handful of projects, all with common targets, I
> > can put the common.xml build file in a jar and have each project depend
> > on that jar.
> > 
> > Combined with something like ivy, I think this would be a pretty good
> > way to share common targets among multiple projects that may not have
> > anything to do with each other.
> > 
> > Any thoughts?
> > 
> > Any way to do this now?
> > 
> this has been discussed for a while, and its something I'd like to do 
> for Ant1.8...I've started making some of the changes in uncommitted 
> code, primarily working on the base interfaces.
> The goal would be to let you import any suitable resource, be it 
> something on a classpath, remote URL, etc.
> Before we can do that, bear in mind that when you import a file, it has 
> a location, that can be used for relative locations. If I import a bit 
> of xml from org,example.somewhere, that file should have the right to 
> import ../something/else.xml. Same for URL-based imports. The code you 
> import should not have to know how you found it, to pull in relative files.
> What I'm planning for this is a new interface for some resources to 
> support, a RelativeResourceFactory. Resources that implement it can 
> create new relative resources by taking in the current location and a 
> relative path. We'd retrofit this to file, URL and classpath resources, 
> all of which could then be a resource source.
> -steve

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message