ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Levy-Lambert <anto...@gmx.de>
Subject Re: Proper way to translate list of jars from properties file into classpath
Date Tue, 19 Oct 2010 13:19:11 GMT
  On 10/14/2010 5:09 PM, KARR, DAVID (ATTSI) wrote:
>> -----Original Message-----
>> From: KARR, DAVID (ATTSI)
>> Sent: Wednesday, October 13, 2010 1:05 PM
>> To: Ant Users List
>> Subject: Proper way to translate list of jars from properties file
> into
>> classpath
>>
>> I have a property defined in my properties file that specifies a list
>> of
>> jar files associated with a particular framework.  I'll need to
>> reference all of those jars any time I reference one of them, so I put
>> them in a single property.
>>
>> It currently looks like this:
>>
>> cxf-patches	= ${lib}/cxf-xjc-boolean-2.3.0.jar,\
>> 		  ${lib}/cxf-xjc-bug671-2.3.0.jar,\
>> 		  ${lib}/cxf-xjc-dv-2.3.0.jar,\
>> 		  ${lib}/cxf-xjc-ts-2.3.0.jar
>>
>> Where I've defined "lib" in my build.xml before this file is
>
> because I'm sure I'm doing something basically wrong here.
> At this point, I've gotten to the point where I can define two
> properties for each "grouped" resource, a "dir" and a "list" (where each
> list entry just has a file name, not a path).  I then define the
> "filelist" in the "path" element, specifying both properties.  That
> works.  I wish I could specify a single list property and reference that
> directly, and have Ant figure it out.
What you do normally in ant linguo is :

<fileset id="cxf-patches.fs" dir="${lib}">
<include name="cxf-xjc-boolean-2.3.0.jar"/>
<include name="cxf-xjc-bug671-2.3.0.jar"/>
<include name="cxf-xjc-dv-2.3.0.jar"/>
<include name="cxf-xjc-ts-2.3.0.jar"/>
</fileset>

you can then reference this construct like that

<path id="cxf-patches.cp">
<fileset refid="cxf-patches.fs"/>
</path>

A path can be used by any ant task which accepts paths, like <javac/>. 
The <pathconvert/> task can convert the path to a property using any 
separator you like.

Regards,

Antoine



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


Mime
View raw message