ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Rettig <>
Subject Re: Importing and caching build files from a URL
Date Tue, 29 Nov 2005 17:41:51 GMT
URL url = ... construct a URL

Now how do I get the parent? You can parse the path manually, but a URL can
be a jar resource, HTTP address, file location, newsgroup, partial url, etc.

Rather than parsing the path, it's easier and more explicit to simply
declare the root.
Also, this is more powerful since you can do relative imports from the root.
Solving two problems at once. Now the build writer decides how build files
are resolved. They can be relative to the orginal build file as described
above or relative to another root.

<urlimport urlroot="" file="root-build.xml
<urlimport urlroot="" file="builds/root-build.xml"/>

So... root-build.xml can be written to resolve files relative to itself:

   <import file="compile.xml"/>

... or relative to a root.

   <import file="builds/compile.xml"/>

This concept works for directories, jars, etc.


On 11/29/05, Dominique Devienne <> wrote:
> > A URL has no concept of a 'parent'.
> I beg to disagree. If it didn't, the web wouldn't work ;-)
> Here's the proof, in this URL contructor: URL(URL context, String spec).
> --DD
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message