ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Lalor <bla...@deltafaucet.com>
Subject how to convert path to fileset
Date Mon, 29 Mar 2004 12:48:14 GMT
Good morning, all.  I'm a relative Ant newbie and struggling a bit with 
the notion of paths and filesets.   I'd really like to be able to 
define a list of files that can be treated as either a path or a 
fileset so that I can limit the number of places I have to repeat 
things in my build descriptors.  Take, for example, trying to manage 
the entire set of libraries required for a project using Struts:

   <property 
name="struts.home"	location="${user.home}/java/jakarta-struts-1.1" />

   <property name="commons-beanutils.jar" 
value="${struts.home}/lib/commons-beanutils.jar"/>
   <property name="commons-collections.jar" 
value="${struts.home}/lib/commons-collections.jar"/>
   <property name="commons-digester.jar" 
value="${struts.home}/lib/commons-digester.jar"/>
   <property name="commons-fileupload.jar" 
value="${struts.home}/lib/commons-fileupload.jar"/>
   <property name="commons-lang.jar" 
value="${struts.home}/lib/commons-lang.jar"/>
   <property name="commons-logging.jar" 
value="${struts.home}/lib/commons-logging.jar"/>
   <property name="commons-validator.jar" 
value="${struts.home}/lib/commons-validator.jar"/>
   <property name="jakarta-oro.jar" 
value="${struts.home}/lib/jakarta-oro.jar"/>
   <property name="struts.jar" value="${struts.home}/lib/struts.jar"/>

I need to add all of these to my compile path and my test, but I also 
need to bundle them with my .war.  So I start by putting 'em all into a 
struts.path:
   <!-- build up a path structure for easy reuse elsewhere -->
   <path id="struts.jars">
	<pathelement location="${commons-beanutils.jar}" />
	<pathelement location="${commons-collections.jar}" />
	<pathelement location="${commons-digester.jar}" />
	<pathelement location="${commons-fileupload.jar}" />
	<pathelement location="${commons-lang.jar}" />
	<pathelement location="${commons-logging.jar}" />
	<pathelement location="${commons-validator.jar}" />
	<pathelement location="${jakarta-oro.jar}" />
	<pathelement location="${struts.jar}" />
   </path>

Now within my compile.classpath I can reference refid="struts.jars".  
But since I need to copy them to WEB-INF/lib, I would really like to 
just say
	<copy todir="${build.dir}/WEB-INF/lib">
		<some-reference-to refid="${struts.jars}" />
	</copy>

There doesn't seem to be a built-in way to do this, or an easy way to 
accomplish the transformation from path to fileset.

Has anyone already solved this problem?

Thanks,
B

-- 
Brian Lalor
Web Portal Analyst
Delta Faucet Co.
blalor@deltafaucet.com
(v) 317-573-3461


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


Mime
View raw message