MoparClassic/GameServer/build.xml

115 lines
3.3 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="UTF-8"?>
<project name="MoparClassic" default="build" xmlns:ivy="antlib:org.apache.ivy.ant" basedir=".">
<property name="src" location="src" />
<property name="bin" location="bin" />
<property name="lib_managed" location="lib_managed" />
<property name="lib" location="lib" />
<property name="doc" location="doc" />
<property name="jar" value="moparclassic.jar" />
<property name="main-class" value="org.moparscape.msc.gs.Server" />
<property name="scala-version" value="2.9.1" />
<property name="ivy.lib.dir" value="lib_managed" />
<fileset id="libraries" dir="${lib}">
<include name="*.jar" />
</fileset>
<fileset id="libraries_managed" dir="${lib_managed}">
<include name="*.jar" />
</fileset>
<fileset id="production-classes" dir="${bin}">
<include name="**/*.class" />
</fileset>
<path id="binary-path">
<pathelement path="${bin}" />
</path>
<path id="library-managed-path">
<fileset refid="libraries_managed" />
</path>
<pathconvert property="manifest-classpath" pathsep=" ">
<path refid="library-managed-path" />
<mapper>
<chainedmapper>
<flattenmapper />
<globmapper from="*.jar" to="${lib_managed}/*.jar" />
</chainedmapper>
</mapper>
</pathconvert>
<path id="library-path">
<fileset refid="libraries" />
<fileset refid="libraries_managed" />
</path>
<path id="master-path">
<path refid="binary-path" />
<path refid="library-path" />
</path>
<manifestclasspath property="jar-classpath" jarfile="${jar}">
<classpath refid="library-managed-path" />
</manifestclasspath>
<target name="init">
<mkdir dir="${bin}" />
<mkdir dir="${doc}" />
<mkdir dir="${lib}" />
<mkdir dir="${lib_managed}" />
</target>
<target name="resolve" depends="init">
<ivy:retrieve sync="true" />
</target>
<target name="build" depends="resolve">
<taskdef resource="scala/tools/ant/antlib.xml" classpathref="library-path">
<classpath>
<pathelement location="${lib}/scala-compiler-${scala-version}.jar" />
<pathelement location="${lib}/scala-library-${scala-version}.jar" />
</classpath>
</taskdef>
<scalac destdir="${bin}" classpathref="library-path">
<src path="${src}" />
</scalac>
<javac destdir="${bin}" includeantruntime="false">
<src path="${src}" />
<classpath refid="library-path" />
</javac>
</target>
<target name="clean">
<delete dir="${bin}" />
<delete dir="${doc}" />
<delete file="${jar}" />
</target>
2011-12-01 17:43:44 -05:00
<target name="run">
<java classpathref="master-path" fork="true" classname="${main-class}" />
</target>
<target name="doc" depends="build">
<scaladoc srcdir="${src}" destdir="${doc}" deprecation="yes" unchecked="yes" doctitle="MoparClassic Documentation" classpathref="master-path">
<include name="**/*.scala" />
</scaladoc>
</target>
<target name="run-jar">
<java fork="true" jar="${jar}" />
</target>
<target name="jar" depends="build">
<jar destfile="${jar}">
<zipgroupfileset refid="libraries" />
<fileset refid="production-classes" />
<manifest>
<attribute name="Main-Class" value="${main-class}" />
<attribute name="Class-Path" value=". ${jar-classpath}" />
</manifest>
</jar>
</target>
</project>