You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by AU...@DtA.de on 2001/06/26 10:35:42 UTC

SUGGEST: Make refid attributes URL-aware

Request for comment
suggestion:
===========
Enable "refid" attributes to reference objects in other files/locations, so
that you can keep a constant set of frequently used paths, filesets etc. in
a central place and reference them from a build file.

example:
========

In file "build.xml":
<classpath>
	<fileset
refid="file://localhost/${ant.home}/libraries.xml#struts.library"/>
	...
</classpath>

or better:
<classpath>
	<fileset ref="file://localhost/${ant.home}/libraries.xml"
refid="struts.library"/>
	...
</classpath>


In file "libraries.xml" there should be then:
<fileset id="struts.library" dir="${env.STRUTS_HOME}/lib">
	<include name="struts.jar"/>
</fileset>

purpose/benefit:
================
I keep a definition of frequently used libraries in a parent-project-wide or
central xml file. At the moment, I have to use the (IMHO ugly)
entity-redefinition feature of the XML parser to include this file. The
suggested construct offers a cleaner, XSchema-friendly, and much more
flexible solution. There are certainly many more applications for this
extension, esp. if HTTP/FTP-URLs are allowed.

Regards,
Mirko


Re: SUGGEST: Make refid attributes URL-aware

Posted by Peter Donald <do...@apache.org>.
On Tue, 26 Jun 2001 18:35, AUVT3@DtA.de wrote:
> Request for comment
> suggestion:
> ===========
> Enable "refid" attributes to reference objects in other files/locations, so
> that you can keep a constant set of frequently used paths, filesets etc. in
> a central place and reference them from a build file.
>
> example:
> ========
>
> In file "build.xml":
> <classpath>
> 	<fileset
> refid="file://localhost/${ant.home}/libraries.xml#struts.library"/>
> 	...
> </classpath>
>
> or better:
> <classpath>
> 	<fileset ref="file://localhost/${ant.home}/libraries.xml"
> refid="struts.library"/>
> 	...
> </classpath>
>
>
> In file "libraries.xml" there should be then:
> <fileset id="struts.library" dir="${env.STRUTS_HOME}/lib">
> 	<include name="struts.jar"/>
> </fileset>
>
> purpose/benefit:
> ================
> I keep a definition of frequently used libraries in a parent-project-wide
> or central xml file. At the moment, I have to use the (IMHO ugly)
> entity-redefinition feature of the XML parser to include this file. The
> suggested construct offers a cleaner, XSchema-friendly, and much more
> flexible solution. There are certainly many more applications for this
> extension, esp. if HTTP/FTP-URLs are allowed.

Something similar has been suggested before except it used a different 
syntax. Namely

<project ...>
  <projectref name="foo" location="...uri or project file..."/>

  ...
    <fileset refid="foo:struts.library" />
  ...

</project>


As yet no one has championed this type of feature or not ;)

Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*