ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
Subject Re: import file from jar (or classpath)
Date Mon, 14 Jan 2008 13:14:47 GMT
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

-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message