build.xml

<?xml version="1.0" ?>
<project name="structured" default="archive">
 
   <target name="init">
      <mkdir dir="build/classes" />
      <mkdir dir="dist" />
   </target>
 
   <target name="compile" depends="init" description="描述--初始化">
      <javac srcdir="src" destdir="build/classes" />
   </target>

   <target name="archive" depends="compile">
      <jar destfile="dist/project.jar" basedir="build/classes" />
   </target>

   <target name="clean" depends="init">
      <delete dir="build" />
      <delete dir="dist" />
   </target>

   <target name="execute" depends="compile">
      <java classname="net.taobaoge.ant.lesson1.Main" classpath="build/classes" >
        <arg value="a" />
        <arg value="b" />
        <arg file="." />
      </java> 
</project>

你可能感兴趣的:(ant)