ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guy Rouillier" <>
Subject Filesets for echo and available?
Date Wed, 18 Dec 2002 04:05:21 GMT
I'm a relative newcomer to Ant - only been writing build.xml files for about
8 months.  To avoid huge lists of unresolved symbols at compile time, I
provide checking for the presence of required jar files prior to kicking off
the compile step.  I've put a shortened version of the relevant section from
my build.xml at the end of this message.  The issue I have is that in order
to do this, I've had to list my jar files 3 different times: for the echo,
for the condition, and finally for the classpath.  My actual set of jars is
much longer, so this becomes a maintenance headache.  Is there any way I can
accomplish the same thing without repeating the set of files?  I can of
course use a fileset for the classpath, but from what I read in the Ant
manual, there is no way to use a fileset for either the echo task or the
condition task.  I appreciate all pointers.

   <target name="checkinputjars">
      <echo>Checking for required input jars</echo>
      <condition property="inputjarsavailable">
            <available file="${deploy_dir}/lib/xml.jar"/>
            <available file="${deploy_dir}/lib/jce1_2_1.jar"/>
            <available file="${deploy_dir}/lib/sunjce_provider.jar"/>

   <target name="inform_no_input_jars" depends="checkinputjars"
      <fail message="ERROR! Could not find the required input JAR files"/>

   <target name="build" depends="inform_no_props, inform_no_input_jars,
      <javac debug="on" destdir="${build}">
            <pathelement location="${deploy_dir}/lib/xml.jar"/>
            <pathelement location="${deploy_dir}/lib/jce1_2_1.jar"/>
            <pathelement location="${deploy_dir}/lib/sunjce_provider.jar"/>

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message