ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mylene Reiners <mylene.rein...@cmg.com>
Subject Refine buildfile?
Date Mon, 07 Oct 2002 08:16:22 GMT
Hi,

I am trying to get a grip on using Ant.
I have written a buildfile to:
  - check the given parameter (none or msgmon)
  - unzip all jar files in a given directory to the classes directory
  - jar them in a libs(all).jar

I came with a solution (included at the bottom of this mail).
Could anyone tell me if I forgot something, or how to fine-tune this?
(it works, except for the last delete...)

TIA

Mylène

<?xml version="1.0"?>
<project name="Create_libs.jar" default="createLibs" basedir=".">

   <!-- destination directories -->
   <property name="destdir"     value="classes" />
   <property name="libsdir"     value="libs-a" />
   <property name="libsdir-b"   value="libs-b" />
   
   <property name="jar.awanim"
value="${libsdir}/awanim-2002-10-03-1323.jar" />
   <property name="jar.regexp"  value="${libsdir}/gnu-regexp-1.1.4.jar" />
   <property name="jar.iaik"    value="${libsdir}/iaik_jce.jar" />
   <property name="jar.jta"     value="${libsdir}/jta.jar" />
   <property name="jar.sonicC"  value="${libsdir}/sonic_Client.jar" />
   <property name="jar.sonicX"  value="${libsdir}/sonic_XA.jar" />
   <property name="jar.xalan"   value="${libsdir}/xalan.jar" />
   <property name="jar.xerxes"  value="${libsdir}/xercesImpl.jar" />
   <property name="jar.xml"     value="${libsdir}/xml-apis.jar" />
   <property name="zip.oracle"  value="${libsdir-b}/classes12.zip" />
   
   <target name="init">
      <delete dir="${destdir}" quiet="true" includeEmptyDirs="true" />
   </target>
   
   <target name="prepare" depends="init">
      <mkdir dir="${destdir}" />
   </target>
   
   <target name="setupMsgmon"   if="msgmon" depends="prepare">
      <property name="jar.file" value="libsall.jar" />
      <unzip src="${zip.oracle}" dest="${destdir}" />
   </target>
         
   <target name="setupStandard" unless="msgmon" depends="prepare">
      <property name="jar.file" value="libs.jar" />
   </target>
   
   <target name="unpackJars" depends="prepare,setupMsgmon,setupStandard">
      <unzip src="${jar.regexp}" dest="${destdir}" />
      <unzip src="${jar.iaik}"   dest="${destdir}" />
      <unzip src="${jar.jta}"    dest="${destdir}" />
      <unzip src="${jar.sonicC}" dest="${destdir}" />
      <unzip src="${jar.sonicX}" dest="${destdir}" />
      <unzip src="${jar.xalan}"  dest="${destdir}" />
      <unzip src="${jar.xerxes}" dest="${destdir}" />
      <unzip src="${jar.xml}"    dest="${destdir}" />
      <unzip src="${jar.awanim}" dest="${destdir}" />
   </target>
   
   <target name="copyId" depends="prepare,unpackJars">
      <copy file="libs_id" todir="${destdir}" />
   </target>
   
   <target name="createLibs" depends="unpackJars, copyId">
      <jar jarfile="${jar.file}" basedir="${destdir}" />
      <echo>
         Ready.
      </echo>
   </target>
   
   <target name="delete" depends="createLibs">
      <delete dir="${destdir}" quiet="true" includeEmptyDirs="true" />
   </target>
   
</project>

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


Mime
View raw message