加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.xml 5.98 KB
一键复制 编辑 原始数据 按行查看 历史
miguel 提交于 2007-03-04 21:13 . On the middle of writting the system test
<?xml version='1.0'?>
<project name="marauroa" default="dist" basedir=".">
<property file="build.ant.properties"/>
<property name="jarname" value="marauroa-${version}.jar"/>
<!-- Clears the instalation -->
<target name="clean">
<delete dir="${build}"/>
<delete dir="${docs}"/>
<delete dir="${build-archive}"/>
<delete dir="${dist}"/>
</target>
<!-- Create the initial folders for the build -->
<target name="init">
<mkdir dir="${build-archive}" />
<mkdir dir="${build}" />
<mkdir dir="${dist}" />
<mkdir dir="${docs}" />
</target>
<!-- Copy important files to the build folder. -->
<target name="installation" depends="init">
<copy todir="${buildroot}/marauroa/server/" file="${src}/marauroa/server/marauroa_init.sql"/>
<copy todir="${buildroot}/marauroa/server/" file="${src}/marauroa/server/marauroa_drop.sql"/>
<copy todir="${buildroot}/marauroa/server" file="${src}/marauroa/server/log4j.properties"/>
</target>
<!-- Compiles the project -->
<target name="compile" depends="installation">
<!-- Exclude python support if jython.jar is not present -->
<condition property="exclude.python" value="**/python/*.*">
<not>
<available file="${jython_jar}"/>
</not>
</condition>
<!-- Exclude junit support if junit is not present -->
<condition property="exclude.junit" value="**/test/*.*">
<not>
<available file="${junit_jar}"/>
</not>
</condition>
<!-- Update version number. -->
<replaceregexp file="${src}/marauroa/server/marauroad.java"
match="final private static String VERSION=&quot;.*&quot;;"
replace="final private static String VERSION=&quot;${version}&quot;;"
byline="true"/>
<!-- Compile it -->
<javac srcdir="${src}" destdir="${buildroot}" debug="true" debuglevel="source,lines" includes="**/marauroa/**" excludes="${exclude.python};${exclude.junit}">
<classpath>
<pathelement path="${log4j_jar}"/>
<pathelement path="${junit_jar}"/>
<pathelement path="${connectorJ_jar}"/>
<pathelement path="${jnlp_jar}"/>
<pathelement path="${jython_jar}"/>
</classpath>
</javac>
</target>
<!-- Generate Java docs -->
<target name="docs" depends="compile">
<javadoc packagenames="marauroa.*"
defaultexcludes="yes"
destdir="${docs}"
author="true"
version="true"
use="true"
windowtitle="Marauroa API Documentation Version: ${version}">
<classpath>
<pathelement path="${log4j_jar}"/>
<pathelement path="${junit_jar}"/>
<pathelement path="${connectorJ_jar}"/>
<pathelement path="${jnlp_jar}"/>
<pathelement path="${jython_jar}"/>
</classpath>
<fileset dir="${src}">
<include name="**/*.java"/>
</fileset>
</javadoc>
</target>
<!-- Create jar file for Marauroa -->
<target name="jar" depends="compile">
<jar jarfile="${build-archive}/${jarname}" basedir="${buildroot}/">
<manifest>
<attribute name="Main-Class" value="games.stendhal.client.update.Starter"/>
</manifest>
</jar>
<copy tofile="${build-archive}/marauroa.jar" file="${build-archive}/${jarname}"/>
<!-- A link would be better but... -->
<copy todir="${build-archive}" file="${src}/marauroa/server.ini"/>
</target>
<!-- Prepare the tarball for releases -->
<target name="dist_binary" depends="jar">
<replaceregexp file="${extras}/marauroad.bat"
match="set LOCALCLASSPATH=.*"
replace="set LOCALCLASSPATH=.;marauroa-${version}.jar;${jython_jar};${connectorJ_jar};${log4j_jar}"
byline="true"/>
<mkdir dir="marauroa-${version}"/>
<mkdir dir="marauroa-${version}/libs"/>
<copy todir="marauroa-${version}" file="${extras}/marauroad.bat"/>
<copy todir="marauroa-${version}/libs" file="${build-archive}/${jarname}"/>
<copy todir="marauroa-${version}/libs" file="${connectorJ_jar}"/>
<copy todir="marauroa-${version}/libs" file="${jython_jar}"/>
<copy todir="marauroa-${version}/libs" file="${log4j_jar}"/>
<copy todir="marauroa-${version}" file="AUTHORS"/>
<copy todir="marauroa-${version}" file="BUGS"/>
<copy todir="marauroa-${version}" file="COPYING"/>
<copy todir="marauroa-${version}" file="LICENSE"/>
<copy todir="marauroa-${version}" file="README"/>
<zip destfile="${dist}/marauroa-${version}.zip" basedir="marauroa-${version}"/>
<delete dir="marauroa-${version}"/>
</target>
<target name="dist_docs" depends="docs">
<mkdir dir="marauroa-${version}"/>
<copy todir="marauroa-${version}/${docs}">
<fileset dir="${docs}"/>
</copy>
<copy todir="marauroa-${version}" file="AUTHORS"/>
<copy todir="marauroa-${version}" file="BUGS"/>
<copy todir="marauroa-${version}" file="COPYING"/>
<copy todir="marauroa-${version}" file="LICENSE"/>
<copy todir="marauroa-${version}" file="README"/>
<zip destfile="${dist}/marauroa-${version}-docs.zip" basedir="marauroa-${version}"/>
<delete dir="marauroa-${version}"/>
</target>
<target name="dist_source" depends="docs">
<mkdir dir="marauroa-${version}"/>
<copy todir="marauroa-${version}/src">
<fileset dir="src"/>
</copy>
<copy todir="marauroa-${version}/extras">
<fileset dir="extras"/>
</copy>
<copy todir="marauroa-${version}/libs">
<fileset dir="libs"/>
</copy>
<copy todir="marauroa-${version}" file="build.xml"/>
<copy todir="marauroa-${version}" file="build.ant.properties"/>
<copy todir="marauroa-${version}" file="AUTHORS"/>
<copy todir="marauroa-${version}" file="BUGS"/>
<copy todir="marauroa-${version}" file="COPYING"/>
<copy todir="marauroa-${version}" file="HISTORY"/>
<copy todir="marauroa-${version}" file="LICENSE"/>
<copy todir="marauroa-${version}" file="README"/>
<tar destfile="${dist}/marauroa-${version}-src.tar.gz" compression="gzip">
<tarfileset dir="marauroa-${version}" prefix="marauroa-${version}">
<exclude name="**/CVS/**"/>
</tarfileset>
</tar>
<delete dir="marauroa-${version}"/>
</target>
<!-- builds the whole project for releasing -->
<target name="dist" depends="clean, dist_binary, dist_docs, dist_source"/>
</project>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化