ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Rettig <mike.ret...@gmail.com>
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.

http://archive.ncsa.uiuc.edu/SDG/Software/Mosaic/Demo/url-primer.html

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="http://mybuildserver.com/builds/" file="root-build.xml
"/>
<urlimport urlroot="http://mybuildserver.com" file="builds/root-build.xml"/>

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

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

... or relative to a root.

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

This concept works for directories, jars, etc.

Mike


On 11/29/05, Dominique Devienne <ddevienne@gmail.com> 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: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>

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