另一个好的ant文件收藏
来源:互联网 发布:游戏网站源码代理 编辑:程序博客网 时间:2024/04/29 18:32
<?xml version="1.0" encoding="UTF-8" ?>
<project name="AntTest" default="deploy" basedir=".">
<property name="tomcat_home" value="d:/tomcat6" />
<property name="jdk_home" value="d:/jdk6" />
<property name="webapp.name" value="anttest" />
<property name="build_dir" value="build/classes" />
<property name="webapp.class.dir" value="${basedir}/WebContent/WEB-INF/classes" />
<property name="tomcat_lib" value="${tomcat_home}/lib" />
<property name="webapp_home" value="${tomcat_home}/webapps" />
<property name="jdk_lib" value="${jdk_home}/lib" />
<property name="jdk_bin" value="${jdk_home}/bin" />
<property name="jdk_jre_lib" value="${jdk_home}/jre/lib" />
<target name="clean">
<echo>
Cleaning the pre-built files or directories.
</echo>
<delete dir="${build_dir}" />
<delete dir="${webapp_home}/${webapp.name}.war" />
<delete dir="${webapp.class.dir}" />
<delete file="${basedir}/${webapp.name}.war" />
<delete file="${basedir}/${webapp.name}.jar"/>
<delete dir="${webapp_home}/${webapp.name}" />
</target>
<target name="init_directory">
<mkdir dir="${build_dir}" />
<mkdir dir="${webapp.class.dir}" />
</target>
<target name="init_classpath">
<path id="build.path">
<pathelement location="${jdk_lib}" />
<pathelement location="${jdk_jre_lib}" />
<pathelement location="${ant.library.dir}/junit-4.1.jar"/>
<fileset dir="${tomcat_lib}">
<include name="**/*.jar" />
</fileset>
</path>
</target>
<target name="compile" depends="clean, init_directory, init_classpath">
<echo message="Compile servlet!" />
<javac destdir="${build_dir}" fork="yes" executable="${jdk_bin}/javac" debug="on">
<src path="${basedir}/src" />
<classpath refid="build.path" />
</javac>
</target>
<target name="build_jar" depends="compile">
<jar destfile="${basedir}/${webapp.name}.jar">
<fileset dir="${build_dir}" includes="**/*.class" />
</jar>
</target>
<target name="war" depends="compile">
<copy todir="${webapp.class.dir}">
<fileset dir="${build_dir}" includes="**/*.class" />
</copy>
<war destfile="${basedir}/${webapp.name}.war" update="true" webxml="${basedir}/WebContent/WEB-INF/web.xml">
<classes dir="${webapp.class.dir}" />
<zipfileset dir="${basedir}/WebContent">
<exclude name="**/*.Thumb" />
</zipfileset>
</war>
</target>
<target name="runtests" depends="compile" description="Run JUnit Test for Project">
<java fork="yes" classname="junit.textui.TestRunner" taskname="junit" failonerror="true">
<arg value="test.servlet.UserUtilTest" />
<classpath>
<pathelement location="${build_dir}" />
<pathelement path="${java.class.path}" />
</classpath>
</java>
</target>
<target name="runtests1" depends="init_classpath" description="Run Junit tests">
<junit printsummary="yes">
<classpath>
<pathelement location="${build_dir}"/>
</classpath>
<formatter type="plain"/>
<batchtest fork="no" todir="c:/">
<fileset dir="${basedir}/src">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="deploy" depends="war">
<copy file="${basedir}/${webapp.name}.war" tofile="${webapp_home}/${webapp.name}.war" />
</target>
<target name="start_tomcat">
<exec executable="${tomcat_home}/bin/startup.bat" />
</target>
<target name="stop_tomcat">
<exec executable="${tomcat_home}/bin/shutdown.bat" />
</target>
</project>
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/jackyrongvip/archive/2008/12/30/4607454.aspx
- 另一个好的ant文件收藏
- 一个好的ant文件收藏
- 收藏好的文章
- 好的收藏
- 收藏~~~好的网站
- 好的网站收藏
- 好的博客收藏
- 好的博客地址收藏
- 好的blog收藏
- 收藏的好文章
- 收藏的好博客地址
- 我的好收藏
- 好的网站收藏
- 好的文章收藏
- 收藏的好文章
- 收藏好的博客地址
- 好的网站收藏
- 收藏的好东西
- STL之顺序容器
- Unexpected end of file while looking for precompiled header directive 解决方法
- 委托和事件的区别
- c++cmd
- Facebook的API的一些说明
- 另一个好的ant文件收藏
- Delphi中BitBlt函数实现屏幕对象抓图
- LINK : fatal error LNK1104: cannot open file "mfc42ud.lib"
- 动态T-SQL语句常見問題與解決方案
- Delphi中一简单图像比较例
- 面向对象程序设计:继承成员访问控制机制
- Delphi将JPG分割到三个TImage里面的例子
- 使用InternetOpenUrl挂起的一个解决方案
- Delphi实现图象灰度处理的3种方法