ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hardy <adam....@cyberspaceroad.com>
Subject Re: non-Filelist list of jars
Date Thu, 02 Oct 2003 09:44:18 GMT
OK I shall check out Maven as well, but for now I have got it to work 
with <foreach/> like so:

   <target name="deploy" depends="compile">
     ... etc
     <foreach list="${external.jars}" delimiter=":"
            target="jarcopy" param="jarfile">
        <param name="jartodir"
          value="${deploy.home}/${app.name}/WEB-INF/lib"/>
     </foreach>
   </target>

   <target name="jarcopy" depends="">
     <copy todir="${jartodir}" file="${jarfile}" />
   </target>

Now I am being demanding I suppose, but this spits out per jar file:

buildFile==/home/adam/src/projects/linklibrary/build.xml
jarcopy:
      [copy] Copying 1 file to 
/usr/java/jakarta-tomcat-5.0.12/webapps/linklib/WEB-INF/lib

So, firstly, can I suppress the output and add up the count of copies 
somehow? Failing that, can I at least suppress the naming of the build 
file?

Thanks for helping me get so far!

Adam


On 10/02/2003 10:43 AM Jan.Materne@rzf.fin-nrw.de wrote:
>>I'm looking for a way to deal with a list of properties which specify 
>>jars that I want to (a) include on a classpath and (b) copy 
>>to a deploy 
>>directory.
>>
>>I've got two build.properties files that I import:
>>
>>(1) puts the full pathname of jars into properties:
>>xercesImpl.jar=D:/xerces-2_3_0/xercesImpl.jar
>>xmlParserAPIs.jar=D:/xerces-2_3_0/xmlParserAPIs.jar
>>jaxb-api.jar=F:/java/jwsdp-1.2/jaxb/lib/jaxb-api.jar
>>
>>(2) creates a property which is a list of some of those jars:
>>external.jars=${commons-digester.jar},${commons-validator.jar}
>>,${jaxb-api.jar}
>>
>>When I've loaded 1 & 2, my ${external.jars} becomes a comma-seperated 
>>list of jars with full pathnames.
>>
>>Now I want to use ${external.jars} as input for my compile 
>>task, since 
>>the jars I specify there all have to be on the classpath, and I also 
>>want my deploy task to copy the jars listed in 
>>${external.jars} to the 
>>deploy directory.
> 
> 
> 
> <path id="path">
>     <pathelement path="${external.jars}"/>
> </path>
> <javac classpathref="path"/>
> 
> 
>>You'll notice that in (1) the jars could be anywhere, i.e. 
>>not relative 
>>to one point on a harddrive, which rules out filelists and filesets.
>>
>>Can I iterate over my ${external.jars} in some way? Is there another 
>>approach I could take?
> 
> 
> 
> AntContrib: <foreach list="${external.jars}"/>
> foreach supports comma separated lists.
> 
> 
> 
>>The reason why I am doing this is essentially to allow different 
>>projects and different developers to pick and choose the jars 
>>they need 
>>from a pre-prepared list (my first build.properties file 
>>above), without 
>>having to modify the build.xml tasks.
> 
> 
> Aehmmm <deeply-thinking/> there was a discussion earlier about getting
> libraries ... Maven has support for autodownload, and something on that
> topic was discussed.
> 
> 
> 
> Jan
> 

-- 
ant 1.6alpha + java 1.4.2 on Linux 2.4.20 RH9


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


Mime
View raw message