ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francisco Tolmasky <tolma...@gmail.com>
Subject Easier Way To Check and Install jars
Date Tue, 08 Jan 2008 05:24:45 GMT
I wrote up a "short" install target in my ant file to make sure I have  
everything necessary to run script tasks, but it seems overly verbose  
for such a simple task:

     <target name = "Copy-Jar" unless = "${JarName}.jar-exists" >
         <echo message = "Installing ${JarName}.jar" />
         <copy tofile = "/usr/share/ant/lib/${JarName}.jar" file =  
"Tools/Ant/${JarName}.jar" />
     </target>

     <target name = "Install-Jar" >
         <available property = "${JarName}.jar-exists" file = "/usr/ 
share/ant/lib/${JarName}.jar" type = "file" />
         <antcall target = "Copy-Jar" />
     </target>

     <target name = "install">
         <antcall target = "Install-Jar" >
             <param name = "JarName" value = "bsf" />
         </antcall>
         <antcall target = "Install-Jar" >
             <param name = "JarName" value = "commons-logging-1.1" />
         </antcall>
         <antcall target = "Install-Jar" >
             <param name = "JarName" value = "js" />
         </antcall>
         <antcall target = "Install-Jar" >
             <param name = "JarName" value = "ant-apache-bsf-1.7.0" />
         </antcall>
     </target>

I'm still somewhat new to ant, so I feel like I may be doing things  
the hard way, is there any easier way to do this, namely one that  
involves combining Install-Jar and Copy-Jar tasks?

Thanks!

Francisco

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


Mime
View raw message