Delete with file set : File Folder « Ant « Java

Delete with file set

<?xml version="1.0"?>

<project name="yourname" basedir=".." default="all">

  <property name="dist" location="dist/"/> 
  <property name="lib" location="lib/"/> 
  <property name="src" location="src/"/> 

  <path id="class.path">
    <pathelement path="${src}"/> 
    <fileset dir="${lib}">
      <include name="**/*.jar"/>
      <include name="**/*.zip"/>
    <fileset dir="/dev">
      <include name="**/*.jar"/>
      <include name="**/*.zip"/>
  <target name="clean">
      <fileset dir="${src}" includes="**/*.class"/>
    <delete dir="${dist}"/>
  <target name="zip" depends="clean">
    <mkdir dir="${dist}"/>
    <zip destfile="${dist}\actionServlet-${DSTAMP}${TSTAMP}.zip">
      <zipfileset dir=".">
        <exclude name="${dist}"/>

  <target name="compile">
      <src path="${src}" />
      <classpath refid="class.path"/> 
      <include name = "*/**" />

  <target name="jar" depends="compile">
    <mkdir dir="${dist}"/>

      excludes="**/*.java, *.mdb"

  <target name="all" depends="jar"/>



Related examples in the same category

1.Ant copy file
2.Ant copy folder
3.Ant task copy file
4.Ant task delete tree
5.Ant task make dir
6.Create folder
7.Delete folder
8.File Checksum
9.File file with fixcrlf
10.File set includes
11.copy todir, fileset, include, exclude