ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <stev...@iseran.com>
Subject Re: [PATCH] Path creation with elements specifed in an external file
Date Sat, 09 Feb 2002 18:19:17 GMT

----- Original Message -----
From: "Jason van Zyl" <jvanzyl@apache.org>
To: <ant-dev@jakarta.apache.org>
Sent: Saturday, February 09, 2002 10:29 PM
Subject: [PATCH] Path creation with elements specifed in an external file


> Hi,
>
> I have a little patch that allows one to create a set of paths
> from a dependency file that lists the JAR files required by a project.
>
> This is in part to:
>
> -> Have a single build.xml for many projects so I want to keep
> definitions outside the build.xml file. My motivation is the maintenance
> of all the turbine related projects. I would like to have a single
> build.xml file and just change properties files where appropriate for
> each project. So I would like to ...
>
> -> Localize JAR dependencies to a single location. Right now this is a
> simple text file that I generate from the Gump project descriptors but
> eventually I would like to use the project descriptors in a more direct
> way.
>
> The dep lists that are currently employed are also being used to
> automatically download any jars required for the build. The file
> looks something like this:
>
> http://24.157.133.102/patches/deps.list
>
> So this list has two purposes: the downloading of jars and being use for
> constructing the classpath with JARs located in a local JAR repository
> (the way I have it rigged for now anyway). So I would really like to
> keep this info in one place.
>
> This is what I currently have in the turbine3 build.xml file:
>
>    <!-- Create a classpath from the deps.list file using
>         the ${lib.repo} as the base directory -->
>
>    <path
>      id="classpath"
>      dir="${lib.repo}"
>      pathlist="deps.list"
>    />
>
>
> I don't know if this patch is the best way to do this, if there is an
> easier or better way I'm all ears. I'm in the process of trying to get a
>   JAR repository working for the turbine projects and unify all the
> build files so any suggestions would be much appreciated.

I dont know if it is better or not, but the recent <loadfile> task to load a
file into a property can generate a list you can assign to a path; you just
need to set the flag to flatten all lines and remember to still put a ":" or
";" between elements .(*)

I think if we were (and it is a big were) to have special loading of paths
(or indeed any complex data source), it should use XML files.

-steve



(*) Actually, given that makeOneLine was put in to make building such one
line strings from a file easier, and because it has only been in CVS a few
days, maybe you should actually specify the line replacement character
instead.. lineEndingSubstitute="" gives current behavior,
lineEndingSubstitute=";" would do path line merging, ....







--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message