<?xml version="1.0" encoding="UTF-8"?>
<project>
<property name="src.dir" location="src"></property>
<property name="build.dir" location="build"></property>
<property name="build.classes" location="${build.dir}/classes"></property>
<property name="build.doc" location="${build.dir}/doc/api"></property>
<property name="zip.dir" location="${build.dir}/zip"></property>
<property name="version" value="SNAPSHOT_0.1"></property>
<property name="project.name" value="user_${version}"></property>
<property name="zip.name" value="user_${version}.zip"></property>
<target name="clean">
<echo>进行项目的清理工作</echo>
<delete dir="${build.dir}"></delete>
</target>
<target name="init">
<echo>进行项目的初始化</echo>
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.classes}"/>
<mkdir dir="${build.doc}"/>
</target>
<target name="doc" depends="init">
<javadoc sourcepath="${src.dir}" private="true" windowtitle="我的JAVA DOC"
use="true"
packagenames="cn.*" destdir="${build.doc}"
charset="UTF-8" docencoding="UTF-8" encoding="UTF-8"
>
<classpath path="${build.classes}"></classpath>
</javadoc>
</target>
<target name="zip" depends="doc">
<zip destfile="${zip.dir}/${zip.name}" duplicate="preserve">
<zipfileset dir="${build.doc}"
includes="**/*.*"
prefix="${project.name}/doc/api"></zipfileset>
<zipfileset
dir="${src.dir}"
includes="**/*.*"
prefix="${project.name}/src"></zipfileset>
</zip>
</target>
<target name="ftp" depends="zip">
<ftp userid="kh" password="123" server="localhost"
action="put" remotedir="user">
<fileset dir="${zip.dir}" includes="*.zip"></fileset>
</ftp>
</target>
注意引入commons-net-3.1.jar到ANT环境
<project>
<property name="src.dir" location="src"></property>
<property name="build.dir" location="build"></property>
<property name="build.classes" location="${build.dir}/classes"></property>
<property name="build.doc" location="${build.dir}/doc/api"></property>
<property name="zip.dir" location="${build.dir}/zip"></property>
<property name="version" value="SNAPSHOT_0.1"></property>
<property name="project.name" value="user_${version}"></property>
<property name="zip.name" value="user_${version}.zip"></property>
<target name="clean">
<echo>进行项目的清理工作</echo>
<delete dir="${build.dir}"></delete>
</target>
<target name="init">
<echo>进行项目的初始化</echo>
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.classes}"/>
<mkdir dir="${build.doc}"/>
</target>
<target name="doc" depends="init">
<javadoc sourcepath="${src.dir}" private="true" windowtitle="我的JAVA DOC"
use="true"
packagenames="cn.*" destdir="${build.doc}"
charset="UTF-8" docencoding="UTF-8" encoding="UTF-8"
>
<classpath path="${build.classes}"></classpath>
</javadoc>
</target>
<target name="zip" depends="doc">
<zip destfile="${zip.dir}/${zip.name}" duplicate="preserve">
<zipfileset dir="${build.doc}"
includes="**/*.*"
prefix="${project.name}/doc/api"></zipfileset>
<zipfileset
dir="${src.dir}"
includes="**/*.*"
prefix="${project.name}/src"></zipfileset>
</zip>
</target>
<target name="ftp" depends="zip">
<ftp userid="kh" password="123" server="localhost"
action="put" remotedir="user">
<fileset dir="${zip.dir}" includes="*.zip"></fileset>
</ftp>
</target>
注意引入commons-net-3.1.jar到ANT环境
</project>