从SVN中取出最新的版本
??? <property name="src.dir" location="src"></property>
??? <property name="test.dir" location="test"></property>
??? <property name="lib.dir" location="lib"></property>
??? <property name="build.dir" location="build"></property>
??? <property name="build.classes" location="${build.dir}/classes"></property>
??? <property name="build.report" location="${build.dir}/report"></property>
???
??? <path id="compile-path">
??? ??? <fileset dir="${lib.dir}" includes="**/*.jar"></fileset>??
??? </path>
???
??? <path id="test-compile-path">
??? ??? <path refid="compile-path"></path>
??? ??? <pathelement location="${build.classes}"/>
??? </path>
???
??? <target name="clean">
??? ??? <delete dir="${src.dir}"></delete>
??? ??? <delete dir="${test.dir}"></delete>
??? ??? <delete dir="${build.dir}"></delete>
??? </target>
???
??? <target name="init" depends="clean">
??? ??? <mkdir dir="${build.dir}"/>
??? ??? <mkdir dir="${build.classes}"/>
??? ??? <mkdir dir="${build.report}"/>
??? </target>
???
??? <typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="compile-path" />
???
??? <target name="checkout" depends="init">
??? ??? <mkdir dir="${tmp.dir}"/>
??? ???
??? ??? <svn username="lili" password="lili">
??? ??? ??? <checkout url="http://10.10.72.203/svn/project" destPath="${tmp.dir}" revision="HEAD"/>???
??? ??? </svn>
??? ???
??? ??? <copy todir="${src.dir}">
??? ??? ??? <fileset dir="${tmp.dir}/src" includes="**/*.java" />
??? ??? </copy>
??? ???
??? ??? <copy todir="${test.dir}">
??? ??? ??? <fileset dir="${tmp.dir}/test" includes="**/*.java" />
??? ??? </copy>
??? ???
??? ??? <!--
??? ??? <copy todir="${lib.dir}">
??? ??? ??? <fileset dir="${tmp.dir}/lib" includes="**/*.jar" />
??? ??? </copy>
??? ??? -->
??? ???
??? ??? <delete dir="${tmp.dir}"/>
??? </target>
??? <target name="compile" depends="init,checkout">
??? ??? <javac srcdir="${src.dir}" destdir="${build.classes}" classpathref="compile-path"></javac>
???
??? ??? <copy todir="${build.classes}">
??? ??? ??? <fileset dir="${src.dir}" excludes="**/*.java"></fileset>
??? ??? </copy>
??? ??? ???
??? </target>
???
??? <target name="test-compile" depends="compile">
??? ??? <javac srcdir="${test.dir}" destdir="${build.classes}" classpathref="test-compile-path"></javac>
??? </target>
???
??? <target name="run-test" depends="test-compile">
??? ??? <junit>
??? ??? ??? <classpath refid="test-compile-path"></classpath>
??? ??? ??? <formatter type="xml" usefile="true"/>
??? ??? ???
??? ??? ??? <batchtest todir="${build.report}">
??? ??? ??? ??? <fileset dir="${build.classes}" includes="**/*Test.*"></fileset>
??? ??? ??? </batchtest>
??? ??? ???
??? ??? </junit>
??? ???
??? ??? <junitreport todir="${build.report}">
??? ??? ??? <fileset dir="${build.report}" includes="TEST-*.xml"></fileset>
??? ??? ??? <report format="frames" todir="${build.report}/html"/>
??? ??? </junitreport>
??? </target>
??? <target name="mail">
??? ??? <mail mailhost="smtp.163.com" mailport="25" user="test" password="test">
??? ??? ??? <from address="test@163.com"/>
??? ??? ??? <to address="563875233@qq.com"/>
??? ??? ??? <message>This email is auto generated by ant</message>
??? ??? ??? <fileset dir="${build.report}">
??? ??? ??? ??? <include name="**/*.*"/>
??? ??? ??? </fileset>
??? ??? </mail>
??? </target>
???
</project>