ant-user mailing list archives

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

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...)



<?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=""  value="${libsdir-b}/" />
   <target name="init">
      <delete dir="${destdir}" quiet="true" includeEmptyDirs="true" />
   <target name="prepare" depends="init">
      <mkdir dir="${destdir}" />
   <target name="setupMsgmon"   if="msgmon" depends="prepare">
      <property name="jar.file" value="libsall.jar" />
      <unzip src="${}" dest="${destdir}" />
   <target name="setupStandard" unless="msgmon" depends="prepare">
      <property name="jar.file" value="libs.jar" />
   <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 name="copyId" depends="prepare,unpackJars">
      <copy file="libs_id" todir="${destdir}" />
   <target name="createLibs" depends="unpackJars, copyId">
      <jar jarfile="${jar.file}" basedir="${destdir}" />
   <target name="delete" depends="createLibs">
      <delete dir="${destdir}" quiet="true" includeEmptyDirs="true" />

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

View raw message