5 Star 1 Fork 0

火苗儿/shangjieDFP

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
build.xml 7.92 KB
一键复制 编辑 原始数据 按行查看 历史
火苗儿 提交于 2016-10-24 09:31 . upload master
<?xml version="1.0" encoding="UTF-8"?>
<project name="taifu" basedir="." default="all">
<!-- create and cp configXml -->
<property environment="env" />
<property name="ant.dir" value="${env.ANT_HOME}" />
<property name="war.dir" value="web" />
<property name="main.version" value="0.2.1"/>
<property name="src.dir" value="java_src" />
<property name="test.dir" value="java_test" />
<property name="lib.dir" value="web/WEB-INF/lib" />
<property name="doc.dir" value="doc" />
<property name="build.dir" value="build" />
<property name="build.test.dir" value="test" />
<property name="build.test.dir.classpath" value="${build.test.dir}/classes" />
<property name="build.test.data.dir" location="${build.test.dir}/data" />
<property name="build.test.reports.dir" location="${build.test.dir}/reports" />
<property name="dist.dir" value="dist" />
<property name="weblib.dir" value="${war.dir}/WEB-INF/lib" />
<property name="webclass.dir" value="${war.dir}/WEB-INF/classes" />
<!-- development release -->
<property name="dev.war.dir" value="dev-release" />
<property name="dev.weblib.dir" value="${dev.war.dir}/WEB-INF/lib" />
<property name="dev.webclass.dir" value="${dev.war.dir}/WEB-INF/classes" />
<path id="junit.classpath" location="${ant.dir}/lib/servlet-api.jar" />
<path id="build-classpath">
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
</path>
<path id="build.test.classpath">
<path refid="build-classpath" />
<pathelement path="${dev.webclass.dir}" />
</path>
<path id="build.test.run.classpath">
<path refid="build.test.classpath" />
<path refid="junit.classpath" />
<pathelement path="${build.test.dir.classpath}" />
</path>
<target name="usage">
<property name="revision" value="${main.version}" />
<property name="name" value="ROOT${revision}" />
<echo message="" />
<echo message="太傅留学 build file" />
<echo message="------------------------------------------------------" />
<echo message="" />
<echo message="version: ${revision}" />
<echo message="Available targets are:" />
<echo message="" />
<echo message="clean --> Clean output dirs" />
<echo message="build --> Compile main Java sources and copy libraries" />
<echo message="test --> juint test" />
<echo message="warfile --> Build the web application archive" />
<echo message="all --> Clean, build, test, warfile" />
<echo message="" />
</target>
<target name="clean" description="Clean output dirs (build, docs, weblib, dist)">
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
<delete dir="${doc.dir}" />
<delete dir="${dev.war.dir}" />
<delete dir="${build.test.dir}" />
<mkdir dir="${build.test.dir.classpath}" />
<mkdir dir="${build.test.data.dir}" />
<mkdir dir="${build.test.reports.dir}" />
</target>
<target name="build" description="Compile main source tree java files into class files, generate jar files">
<mkdir dir="${dev.war.dir}" />
<!-- copy files to build developed version -->
<copy todir="${dev.war.dir}" overwrite="true">
<fileset dir="${war.dir}">
<include name="**/*" />
</fileset>
</copy>
<!-- fill in software version -->
<replace dir="${dev.war.dir}" encoding="UTF-8" value="${revision}">
<include name="**/*.jsp" />
<include name="**/*.js" />
<include name="**/*.tag" />
<replacetoken>@REVISION@</replacetoken>
</replace>
<mkdir dir="${build.dir}" />
<javac destdir="${build.dir}" source="1.6" target="1.6" debug="true" deprecation="false" optimize="false" failonerror="true" encoding="UTF-8" includeantruntime="on" >
<src path="${src.dir}" />
<classpath refid="build-classpath" />
</javac>
<!--copy instreet customized properties files -->
<copy todir="${dev.webclass.dir}/spring" encoding="UTF-8" overwrite="true">
<fileset dir="${src.dir}/spring">
<include name="*.xml" />
<exclude name="*.java" />
</fileset>
</copy>
<copy todir="${dev.webclass.dir}/cert" encoding="UTF-8" overwrite="true">
<fileset dir="${src.dir}/cert">
<include name="*.p12" />
<include name="*.pem" />
<exclude name="*.java" />
</fileset>
</copy>
<copy todir="${dev.webclass.dir}" encoding="UTF-8" overwrite="true">
<fileset dir="${src.dir}">
<include name="**/*.xml" />
<include name="**/*.properties" />
<include name="**/*.dic" />
<include name="**/*.json" />
</fileset>
<filterset>
<filter token="server" value="http://sp.sushijiahua.com" />
</filterset>
</copy>
<copy todir="${dev.webclass.dir}" encoding="UTF-8" overwrite="true">
<fileset dir="${build.dir}">
<include name="**/*.*" />
</fileset>
</copy>
<mkdir dir="${dev.weblib.dir}" />
<copy todir="${dev.weblib.dir}" overwrite="true">
<fileset dir="${lib.dir}">
<include name="*.jar" />
<exclude name="jasper.jar" />
<exclude name="jsp-api.jar" />
<exclude name="servlet-api.jar" />
</fileset>
</copy>
</target>
<target name="warfile" depends="build" description="Build the web application archive">
<antcall target="create.warfile" />
</target>
<!--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -->
<!-- 将${test.data.dir}目录下的所有以"TEST-"打头的xml文件,转化为HTML文件,并存放到${test.reports.dir}目录下-->
<target name="report_exchange_to_html" description="将产生的xml报告,转化成Html">
<junitreport todir="${build.test.data.dir}">
<fileset dir="${build.test.data.dir}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${build.test.reports.dir}" />
</junitreport>
</target>
<target name="test" depends="build" description="testing TestCase">
<javac destdir="${build.test.dir.classpath}" source="1.6" target="1.6" debug="true" deprecation="false" optimize="false" failonerror="true" encoding="UTF-8">
<src path="${test.dir}" />
<classpath refid="build.test.classpath" />
</javac>
<copy todir="${build.test.dir.classpath}" overwrite="true">
<fileset dir="${test.dir}">
<include name="**/*.xml" />
</fileset>
</copy>
<junit errorproperty="test.failed" printsummary="on" haltonfailure="false" failureproperty="test.failed" fork="true" maxmemory="256M" forkmode="perBatch">
<classpath refid="build.test.run.classpath" />
<sysproperty key="test.url" value="http://localhost:8080/" />
<sysproperty key="debug" value="true" />
<sysproperty key="data.dir" file="./data" />
<assertions enableSystemAssertions="true">
<enable />
</assertions>
<formatter type="brief" extension=".html" usefile="true" />
<!-- 缺省时,报告文件后缀名为.txt-->
<formatter type="xml" />
<!-- 缺省时,报告文件后缀名为.xml-->
<!-- <batchtest>标签,可以测试多个test-->
<batchtest todir="${build.test.data.dir}">
<fileset dir="${build.test.dir.classpath}">
<include name="**/*HudongWikiManagerTest.class" />
<include name="**/TaobaoManagerTest.class" />
<include name="**/AdsQueryManagerTest.class" />
<include name="**/sns/**.class" />
</fileset>
</batchtest>
</junit>
<!-- 将xml报告,转化为HTML-->
<antcall target="report_exchange_to_html" />
<!-- 当测试有error或failure时,就停止build-->
<fail if="test.failed">
Test is failed. Check ${build.test.reports.dir}
</fail>
<echo>测试成功!Check to ${build.test.reports.dir}</echo>
</target>
<!--xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-->
<target name="create.warfile" depends="build" description="Build the web application archive">
<mkdir dir="${dist.dir}" />
<war warfile="${dist.dir}/${name}.war" basedir="${dev.war.dir}" webxml="${dev.war.dir}/WEB-INF/web.xml">
<include name="**/*.*" />
<include name="WEB-INF/*.*" />
<exclude name="WEB-INF/web.xml" />
</war>
</target>
<!--
<target name="all" depends="clean,build,warfile,configXml" description="Clean,build,warfile,configXml" /> -->
<target name="all" depends="usage,clean,build,warfile" description="Clean,build,warfile" />
</project>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/littleflame/shangjieDFP.git
git@gitee.com:littleflame/shangjieDFP.git
littleflame
shangjieDFP
shangjieDFP
cowork

搜索帮助

0d507c66 1850385 C8b1a773 1850385