日期:2014-05-19 浏览次数:20670 次
<!-- import properties (app settings, classpath, jar file locations) --> <import file="properties.xml"/> <target name="init" description="defines custom tasks"> <!-- Taskdefs --> <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${ant-contrib.jar}"/> <!-- Ensure that Ant 1.6.2+ is being used --> <available classname="org.apache.tools.ant.DynamicAttribute" property="ant-1.6.2"/> <fail unless="ant-1.6.2" message="AppFuse requires Ant 1.6.2 for faster unit testing"/> <!-- Conditionally set property for tomcat --> <condition property="server.use.tomcat"> <equals arg1="${server.type}" arg2="tomcat"/> </condition> <condition property="server.use.jboss"> <equals arg1="${server.type}" arg2="jboss"/> </condition> </target> <!-- Check timestamp on files --> <target name="prepare" depends="init" description="create target directories"> <tstamp/> <tstamp><format property="copyright.year" pattern="yyyy"/></tstamp> <echo message="Preparing target directory '${webapp.target}'"/> <mkdir dir="${webapp.target}"/> <mkdir dir="${webapp.dist}"/> <mkdir dir="${web.classes.dir}"/> <mkdir dir="${build.dir}/resources"/> <mkdir dir="${build.dir}/dao/gen"/> <mkdir dir="${build.dir}/web/gen"/> <!-- Make sure hibernatedoclet is necessary --> <uptodate property="hibernatedoclet.unnecessary"> <srcfiles dir="src/dao" includes="**/*.java"/> <srcfiles dir="${build.dir}/dao/gen" includes="**/*.java"/> <mapper type="glob" from="*.java" to="${build.dir}/dao/classes/*.class"/> </uptodate> <!-- Make sure webdoclet is necessary --> <uptodate property="webdoclet.uptodate"> <srcfiles dir="src/web" includes="**/*.java"/> <srcfiles dir="${build.dir}/web/gen" includes="**/*.java"/> <mapper type="glob" from="*.java" to="${build.dir}/web/classes/*.class"/> </uptodate> <condition property="webdoclet.unnecessary"> <and> <equals arg1="${webdoclet.uptodate}" arg2="true"/>