build.xml

<?xml version="1.0" ?>

<project name="Webdisign" default="build" basedir=".">

 <property name="base.dir" value="." />
 <property name="src.dir" value="src" />

 <property name="lib.dir" value="WebRoot/WEB-INF/lib" />
 <property name="build.dir" value="WebRoot/WEB-INF/classes" />
 <property name="h.dir" value="WebRoot/WEB-INF" />

 <path id="myclasspath">
  <fileset dir="${lib.dir}">
   <include name="**/*.jar" />
  </fileset>
  <pathelement location="${build.dir}" />
 </path>

 <target name="init">
  <echo>Init Complete !</echo>
  <echo>ant home = ${ant.home} </echo>
  <echo>java home = ${java.home} </echo>
  <echo>user home = ${user.home} </echo>
  <mkdir dir="${h.dir}" />
  <mkdir dir="${build.dir}" />
  <mkdir dir="${lib.dir}" />


 </target>

 <target name="build" depends="init,copyApplicationContext" description="compile the source files">
  <javac classpathref="myclasspath" srcdir="${src.dir}" destdir="${build.dir}" />
  <copy todir="${build.dir}">
   <fileset dir="${src.dir}">
    <exclude name="**/*.java" />
    <exclude name="applicationContext.xml" />
   </fileset>
  </copy>
 </target>
 <target name="copyApplicationContext" depends="init">
  <copy todir="${h.dir}">

   <fileset dir="${src.dir}">
    <include name="applicationContext.xml" />
   </fileset>

  </copy>
 </target>
 <target name="clean">
  <delete includeEmptyDirs="true">
   <fileset dir="${build.dir}" />
  </delete>
 </target>

 <target name="delDir">
  <delete includeemptydirs="true">
   <fileset dir="${build.dir}" includes="**/*" />
  </delete>
 </target>

</project>

你可能感兴趣的:(delete,Build,Path,include)