加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.xml 8.37 KB
一键复制 编辑 原始数据 按行查看 历史
xuesong123 提交于 2017-06-30 22:08 . 1. bug fix
<?xml version="1.0"?>
<!-- Build file for application -->
<project name="webcat" default="buildwar" basedir=".">
<!-- set global properties for this build -->
<target name="init">
<tstamp/>
<property name="appName" value="webcat"/>
<property name="packageName" value="webcat"/>
<property name="version" value="1.0.0.1"/>
<!-- src directories -->
<property name="src.java" value="${basedir}/src"/>
<property name="src.lib" value="${basedir}/lib"/>
<property name="src.doc" value="${basedir}/doc"/>
<property name="src.webapp" value="${basedir}/webapp"/>
<!-- build directories -->
<property name="build.base" value="${basedir}/build"/>
<property name="build.classes" value="${build.base}/classes"/>
<property name="build.doc" value="${build.base}/docs"/>
<property name="build.doc.javadoc" value="${build.doc}/javadoc"/>
<property name="build.release" value="${basedir}/release"/>
<!-- jarFileName -->
<property name="jarFileName" value="${appName}-${version}.jar"/>
<!-- compile parameters -->
<property name="debug" value="on"/>
<property name="optimize" value="off"/>
<property name="deprecation" value="on"/>
<property name="packages" value="*"/>
<pathconvert property="client.lib" pathsep=" ">
<mapper>
<chainedmapper>
<flattenmapper/>
<globmapper from="*" to="lib/*"/>
</chainedmapper>
</mapper>
<fileset dir="webapp/WEB-INF/lib">
<include name="*.jar"/>
</fileset>
</pathconvert>
</target>
<target name="prepare" depends="init">
<!-- Create the time stamp -->
<tstamp>
<format property="timeStamp" pattern="yyyyMMdd-HHmm" locale="zh_cn"/>
</tstamp>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build.base}"/>
</target>
<!-- =================================================================== -->
<!-- Build Jar -->
<!-- =================================================================== -->
<target name="compile" depends="prepare">
<delete dir="${build.classes}"/>
<mkdir dir="${build.classes}"/>
<javac
destdir="${build.classes}"
includes="*/**"
fork="true"
memorymaximumsize="128M"
debug="${debug}"
deprecation="${deprecation}"
optimize="${optimize}"
encoding="UTF-8"
listfiles="no"
verbose="no">
<compilerarg line="-Xlint:unchecked"/>
<src path="${src.java}/main/java"/>
<src path="${src.java}/main/agent"/>
<src path="${src.java}/main/generate"/>
<src path="${src.java}/main/startup"/>
<classpath>
<fileset dir="${src.lib}">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
</fileset>
<fileset dir="${basedir}/webapp/WEB-INF/lib">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
<exclude name="**/webcat-${version}.jar"/>
</fileset>
</classpath>
</javac>
<copy todir="${build.classes}" includeEmptyDirs="no">
<fileset dir="${src.java}/main/resource"/>
</copy>
</target>
<!-- =================================================================== -->
<!-- Compiles the source directory and creates a .jar file -->
<!-- =================================================================== -->
<target name="buildjar" depends="compile">
<delete file="${build.base}/${appName}-${version}.jar"/>
<jar destfile="${build.base}/${appName}-${version}.jar">
<fileset dir="${build.classes}">
<include name="**/com/skin/webcat/"/>
<include name="**/com/skin/generate/"/>
</fileset>
<manifest>
<!-- attribute name="Main-Class" value="com.skin.generate.gui.Main"/ -->
<!-- attribute name="Class-Path" value="${client.lib}"/ -->
<attribute name="Built-By" value="xuesong.net"/>
</manifest>
</jar>
<jar destfile="${build.base}/bootstrap.jar">
<fileset dir="${build.classes}">
<include name="**/com/skin/startup/"/>
</fileset>
<manifest>
<attribute name="Main-Class" value="com.skin.startup.Bootstrap"/>
<attribute name="Built-By" value="xuesong.net"/>
</manifest>
</jar>
<echo>Jar: ${build.base}/bootstrap.jar</echo>
<echo>Jar: ${build.base}/${appName}-${version}.jar</echo>
<!-- build gui -->
<copy file="${build.base}/bootstrap.jar" todir="${basedir}/gui/bin"/>
<copy file="${build.base}/${appName}-${version}.jar" todir="${basedir}/gui/lib"/>
<copy todir="${basedir}/gui/classes/META-INF" includeEmptyDirs="no">
<fileset dir="${src.java}/main/resource/META-INF">
<include name="/META-INF/conf/database.xml"/>
</fileset>
</copy>
<copy todir="${basedir}/gui/config" includeEmptyDirs="no">
<fileset dir="${basedir}/webapp/config"/>
</copy>
</target>
<!-- =================================================================== -->
<!-- Compiles the source directory and creates a .war file -->
<!-- =================================================================== -->
<target name="buildwar" depends="buildjar">
<delete file="${build.base}/${appName}.war"/>
<delete dir="${src.webapp}/WEB-INF/ayada"/>
<war destfile="${build.base}/${appName}.war"
webxml="${src.webapp}/WEB-INF/web.xml"
basedir="${src.webapp}">
<exclude name="autoLogin.jsp"/>
<exclude name="webmaster.jsp"/>
<exclude name="split.html"/>
<exclude name="test.html"/>
<exclude name="**/*.bak"/>
<exclude name="**/*.psd"/>
<exclude name="installer/**"/>
<exclude name="gen/**"/>
<exclude name="META-INF/**"/>
<exclude name="resource/rainbow/**"/>
<exclude name="resource/sh/**"/>
<exclude name="resource/calendar/**"/>
<exclude name="gen/**"/>
<exclude name="proxy/**"/>
<exclude name="upload/**"/>
<exclude name="WEB-INF/backup/**"/>
<exclude name="WEB-INF/ayada/**"/>
<exclude name="WEB-INF/classes/**"/>
<classes dir="${build.classes}"/>
</war>
<delete file="${build.release}/${appName}-${version}.jar"/>
<delete file="${build.release}/${appName}.war"/>
<copy file="${build.base}/bootstrap.jar" todir="${build.release}"/>
<copy file="${build.base}/${appName}-${version}.jar" todir="${build.release}"/>
<copy file="${build.base}/${appName}.war" todir="${build.release}"/>
<echo>War: ${build.release}/${appName}.war</echo>
</target>
<!-- =================================================================== -->
<!-- Creates the API documentation -->
<!-- =================================================================== -->
<target name="javadoc" depends="prepare">
<mkdir dir="${build.doc.javadoc}"/>
<javadoc packagenames="${packages}"
sourcepath="${src.java}"
destdir="${build.doc.javadoc}"
author="true"
version="true"
windowtitle="${appName} API"
doctitle="${appName} API Documentation"
bottom="Copyright &#169; 2001 skin. All Rights Reserved.">
<classpath>
<fileset dir="${src.lib}">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javadoc>
</target>
</project>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化