Ant配置文件
来源:互联网 发布:李嘉诚逃离中国知乎 编辑:程序博客网 时间:2024/05/16 18:18
<?xml version="1.0" encoding="UTF-8"?><project name="OnlineExamSystem" default="deploy" basedir="."> <property environment="env"></property> <property name="src.dir" location="src" > </property> <property name="test.src.dir" location="test"></property> <property name="conf.dir" location="conf"></property> <property name="web.dir" location="WebContent"></property> <property name="lib.dir" location="${web.dir}/WEB-INF/lib"></property> <property name="build.dir" location="Build"></property> <property name="build.classes" location="${build.dir}/classes"></property> <property name="build.test.dir" location="${build.dir}/test"></property> <property name="build.test.classes" location="${build.test.dir}/classes"></property> <property name="build.test.report" location="${build.test.dir}/report"></property> <property name="build.doc.dir" location="${build.dir}/doc"></property> <property name="build.war.dir" location="${build.dir}/war"></property> <property name="test.lib.dir" location="lib"></property> <property name="cobertura.dir" location="${build.dir}/cobertura/"/> <property name="cobertura.html.dir" location="${cobertura.dir}/html"/> <property name="cobertura.class.dir" location="${cobertura.dir}/class"/> <path id="compile-classpath"> <fileset dir="${lib.dir}" includes="*.jar"> </fileset> <fileset dir="${test.lib.dir}" includes="*.jar"></fileset> <fileset dir="${env.ANT_HOME}/lib" includes="*.jar"> </fileset> <fileset dir="${env.ANT_HOME}/lib" includes="*.jar"/> </path> <path id="compile-test-classpath"> <path refid="compile-classpath"> </path> <pathelement location="${build.classes}"/> </path> <path id="run-test-classpath"> <path refid="compile-test-classpath"/> <pathelement location="${build.test.classes}"/> </path> <taskdef classpathref="compile-test-classpath" resource="tasks.properties"/> <target name="clean"> <delete dir="${Build.dir}"/> </target> <target name="init" depends="clean"> <mkdir dir="${build.dir}"/> <mkdir dir="${build.classes}"/> <mkdir dir="${build.test.dir}"/> <mkdir dir="${build.test.classes}"/> <mkdir dir="${build.test.report}"/> <mkdir dir="${build.doc.dir}"/> <mkdir dir="${build.war.dir}"/> <mkdir dir="${build.war.dir}/WEB-INF"/> <mkdir dir="${build.war.dir}/WEB-INF/classes"/> <mkdir dir="${cobertura.dir}"/> <mkdir dir="${cobertura.html.dir}"/> <mkdir dir="${cobertura.class.dir}"/> </target> <target name="compile" depends="init"> <javac destdir="${build.classes}" srcdir="${src.dir}" classpathref="compile-classpath" includeantruntime="true" failonerror="true" debug="true"> </javac> <copy todir="${build.classes}"> <fileset dir="${src.dir}" includes="**/*.*" excludes="**/*.java"> </fileset> </copy> <copy todir="${build.classes}"> <fileset dir="${conf.dir}"> </fileset> </copy> </target> <target name="compile-test" depends="compile"> <javac destdir="${build.test.classes}" srcdir="${test.src.dir}" includeantruntime="true" failonerror="true" classpathref="compile-test-classpath"> </javac> </target> <target name="run-test" depends="compile-test"> <delete file="cobertura.ser"/> <cobertura-instrument todir="${cobertura.class.dir}"> <fileset dir="${build.classes}"> <include name="**/*.class"/> </fileset> </cobertura-instrument> <junit fork="true" haltonfailure="false" failureproperty="junit.fail"> <classpath location="${cobertura.class.dir}"/> <classpath location="${build.classes}"/> <classpath location="${build.test.classes}"/> <classpath refid="compile-classpath"/> <formatter type="xml"/> <test name="${testcase}" todir="${reports.xml.dir}" if="testcase"/> <batchtest todir="${build.test.report}" unless="testcase"> <fileset dir="${test.src.dir}" includes="**/*Test.java" > </fileset> </batchtest> </junit> <junitreport> <fileset dir="${build.test.report}" includes="TEST-*.xml"> </fileset> <report format="frames" todir="${build.test.report}/html"/> </junitreport> <cobertura-report srcdir="${src.dir}" destdir="${cobertura.dir}" format="html"/> <delete file="cobertura.ser"/> <fail if="${junit.fail}" message="单元测试失败,具体情况请查询${build.test.report}"/> </target> <target name="doc" depends="run-test"> <javadoc sourcepath="${src.dir}" use="true" packagenames="com.*" charset="UTF-8" encoding="UTF-8" docencoding="UTF-8" destdir="${build.doc.dir}"> <classpath refid="compile-classpath"> </classpath> </javadoc> </target> <target name="unWar" depends="doc"> <copy todir="${build.war.dir}"> <fileset dir="${web.dir}"> </fileset> </copy> <copy todir="${build.war.dir}/WEB-INF/classes"> <fileset dir="${build.classes}"> </fileset> </copy> </target> <target name="war" depends="unWar"> <war destfile="${build.dir}/${ant.project.name}.war" webxml="${build.war.dir}/WEB-INF/web.xml"> <fileset dir="${build.war.dir}" /> </war> </target> <target name="deploy" depends="war"> <exec executable="${env.ANT_HOME}/bin/shutdown.bat"/> <delete file="${env.ANT_HOME}/webapps/${ant.project.name}.war"> </delete> <copy todir="${env.ANT_HOME}/webapps" file="${build.dir}/${ant.project.name}.war"/> <exec executable="${env.ANT_HOME}/bin/startup.bat"/> </target></project>
0 0
- Ant 配置文件
- ANT配置文件
- ant配置文件
- Ant配置文件
- ANT配置文件示例
- Ant+XDoclet生成配置文件
- Ant配置文件build.xml
- ant配置文件的编写
- ant的配置文件
- ant配置文件详解(转)
- Ant配置文件build.xml
- Ant配置文件详解
- Apahce Ant 配置文件
- ant配置文件的编写
- ant的几个配置文件
- 学习 ant 插件 编译配置文件
- Ant+xdoclet管理hibernate配置文件
- ant和Xdoclent生成配置文件
- Android之ImageButton使用
- 人生九悟
- java如何连接MySQL数据库?
- UI_UISearchController实现搜索功能
- NOIP2015游记
- Ant配置文件
- 三大框架
- 第一个人生web代码,结束了,人生web第一格言:打死也要百分比
- MPI函数学习
- SQL SERVER同步环境新增发布对象时不能生成(sp_MS+表名)同步存储过程
- 151126Tint Color的理解和APP简单的主题化
- 我的CSDN博客之旅开始
- 高并发Web架构
- python在centos6.5上的升级