ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "O'Hara, Patrick" <>
Subject An issue with delete
Date Thu, 21 Jun 2001 16:30:16 GMT
I have the following build.xml

<project name="Backup" default="zipit" basedir=".">
  <target name="init">
    <property name="source.dir" value="."/>
    <property name="target.dir" value="${source.dir}/backup"/>
    <mkdir dir="${target.dir}"/>
    <filter token="backupdate" value="${DSTAMP}"/>
    <filter token="backuptime" value="${TSTAMP}"/>
    <property name="" value="${DSTAMP}${TSTAMP}.zip"/>

  <target name="del-old" depends="init">
    <echo message="Deleting old backup file"/>
    <delete verbose="true">
      <fileset dir="${target.dir}" includes="*.bak"/>
    <!-- Moving the last zip file to a bak file -->
    <move todir="${target.dir}">
      <fileset dir="${target.dir}">
          <include name="**/*.zip"/>
      <mapper type="regexp" from="^(.*)\.zip$$" to="\"/>

  <target name="zipit" depends="init, del-old">
    <zip zipfile="${target.dir}/${}"
    <echo message="Backup complete"/>

The first time through there is nothing in the backup directory (it was just
created).  The del-old task deletes the directory.  I think this may be a
bug with the fileset as the directory backup does not match the includes.

Patrick O'Hara
Workscape, Inc
N17 W24222 Riverwood Pl
Waukesha, WI 53188-1162
262-408-3840 Fax
 <<O'Hara, Patrick.vcf>> 

View raw message