openrsc-core/server/build.xml
2025-09-15 02:07:04 +00:00

146 lines
7.6 KiB
XML

<project default="compile_core" basedir=".">
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="lib" location="lib"/>
<property name="jar" location="core.jar"/>
<property name="javac.source" value="1.8"/>
<property name="javac.target" value="1.8"/>
<target name="clean">
<delete dir="${build}" />
<delete file="${jar}" />
</target>
<target name="compile_plugins">
<delete file="plugins.jar"/>
<delete dir="buildplugins"/>
<mkdir dir="buildplugins"/>
<javac srcdir="plugins" destdir="buildplugins" debug="on" includeantruntime="false" target="${javac.target}"
source="${javac.source}" encoding="UTF-8">
<classpath>
<pathelement location="core.jar"/>
<pathelement path="${java.class.path}/"/>
<pathelement location="${lib}/log4j-api-2.17.0.jar"/>
<pathelement location="${lib}/log4j-core-2.17.0.jar"/>
<pathelement location="${lib}/disruptor-3.3.5.jar"/>
<pathelement location="${lib}/commons-lang-2.6.jar"/>
</classpath>
<compilerarg line="-Xlint:deprecation"/>
</javac>
<jar basedir="buildplugins" destfile="plugins.jar"/>
<delete dir="buildplugins"/>
</target>
<target name="compile_core">
<delete file="${jar}"/>
<delete dir="${build}"/>
<mkdir dir="${build}"/>
<javac srcdir="${src}" destdir="${build}" debug="on" includeantruntime="false" target="${javac.target}"
source="${javac.source}" encoding="UTF-8">
<classpath>
<pathelement location="${lib}/commons-lang3-3.12.0.jar"/>
<pathelement location="${lib}/commons-codec-1.14.jar"/>
<pathelement location="${lib}/commons-compress-1.18.jar"/>
<pathelement location="${lib}/netty-all-4.1.33.Final.jar"/>
<!--
<pathelement location="${lib}/netty-common-4.1.107.Final.jar"/>
<pathelement location="${lib}/netty-transport-4.1.107.Final.jar"/>
<pathelement location="${lib}/netty-transport-native-unix-common-4.1.107.Final.jar"/>
<pathelement location="${lib}/netty-buffer-4.1.107.Final.jar"/>
<pathelement location="${lib}/netty-codec-4.1.107.Final.jar"/>
<pathelement location="${lib}/netty-codec-http-4.1.107.Final.jar"/>
<pathelement location="${lib}/netty-handler-4.1.107.Final.jar"/>
-->
<pathelement location="${lib}/log4j-api-2.17.0.jar"/>
<pathelement location="${lib}/log4j-core-2.17.0.jar"/>
<pathelement location="${lib}/log4j-iostreams-2.17.0.jar"/>
<pathelement location="${lib}/xpp3-1.1.4c.jar"/>
<pathelement location="${lib}/xstream-1.4.18.jar"/>
<pathelement location="${lib}/mysql-connector-j-9.4.0.jar"/>
<pathelement location="${lib}/sqlite-jdbc-3.34.0.jar"/>
<pathelement location="${lib}/commons-lang-2.6.jar"/>
<pathelement location="${lib}/guava-30.1.1-jre.jar"/>
<pathelement location="${lib}/JDA-4.0.0_55-withDependencies.jar"/>
<pathelement location="${lib}/emoji-java-5.1.1.jar"/>
<pathelement location="${lib}/json-20190722.jar"/>
<pathelement location="${lib}/gitlab4j-api-4.12.17.jar"/>
<pathelement location="${lib}/slf4j-nop-2.0.0-alpha5.jar"/>
<pathelement location="${lib}/disruptor-3.3.11.jar"/>
<pathelement location="${lib}/guice-5.0.2-jar-with-dependencies.jar"/>
</classpath>
<compilerarg line="-Xlint:deprecation"/>
</javac>
<jar basedir="${build}" destfile="${jar}">
<zipgroupfileset dir="${lib}" includes="*.jar"/>
<manifest>
<attribute name="Main-Class" value="com.openrsc.server.Server"/>
</manifest>
</jar>
<delete dir="${build}"/>
</target>
<property name="confFile" value="default" />
<property name="coloredLogging" value="false" />
<target name="runserverzgc">
<!-- java 17+ recommended for mature ZGC implementation -->
<echo message="Using JVM 17+ launch arguments"/>
<java classname="com.openrsc.server.Server" fork="true">
<!-- usage: `ant runserver -DconfFile=preservation` to run server with config file preservation.conf -->
<arg value="${confFile}.conf"/>
<jvmarg line="-Xms800M -Xmx2048M -Xdiag -XX:+UseZGC -XX:NewSize=128m -DcoloredLogging=${coloredLogging}"/>
<classpath>
<pathelement location="${lib}/disruptor-3.3.0.jar"/>
<pathelement location="${lib}/log4j-api-2.17.0.jar"/>
<pathelement location="${lib}/log4j-core-2.17.0.jar"/>
<pathelement location="${lib}/log4j-iostreams-2.17.0.jar"/>
<pathelement location="${lib}/xpp3_min-1.1.4c.jar"/>
<pathelement location="${lib}/xpp3-1.1.4c.jar"/>
<pathelement location="${lib}/xstream-1.4.9.jar"/>
<pathelement location="${lib}/mysql-connector-j-9.4.0.jar"/>
<pathelement location="${lib}/disruptor-3.3.5.jar"/>
<pathelement location="${lib}/commons-lang-2.6.jar"/>
<pathelement location="${lib}/*"/>
<pathelement location="${lib}/commons-codec-1.14.jar"/>
<pathelement path="${jar}/"/>
</classpath>
</java>
</target>
<target name="runserver">
<!-- java 8 compatible jvm args. Add more heap if you can. -->
<echo message="Using JVM arguments for Java 8 minimum."/>
<echo message="Upgrade to Java 17 or later for better garbage collection."/>
<echo message="Launch with 'ant runserverzgc' if you are already on Java 17 or newer."/>
<java classname="com.openrsc.server.Server" fork="true">
<!-- usage: `ant runserver -DconfFile=preservation` to run server with config file preservation.conf -->
<arg value="${confFile}.conf"/>
<jvmarg line="-XX:+IgnoreUnrecognizedVMOptions -Xdiag -XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:+UseBiasedLocking -XX:NewSize=64m -DcoloredLogging=${coloredLogging}"/>
<classpath>
<pathelement location="${lib}/disruptor-3.3.0.jar"/>
<pathelement location="${lib}/log4j-api-2.17.0.jar"/>
<pathelement location="${lib}/log4j-core-2.17.0.jar"/>
<pathelement location="${lib}/log4j-iostreams-2.17.0.jar"/>
<pathelement location="${lib}/xpp3_min-1.1.4c.jar"/>
<pathelement location="${lib}/xpp3-1.1.4c.jar"/>
<pathelement location="${lib}/xstream-1.4.9.jar"/>
<pathelement location="${lib}/mysql-connector-j-9.4.0.jar"/>
<pathelement location="${lib}/disruptor-3.3.5.jar"/>
<pathelement location="${lib}/commons-lang-2.6.jar"/>
<pathelement location="${lib}/*"/>
<pathelement location="${lib}/commons-codec-1.14.jar"/>
<pathelement path="${jar}/"/>
</classpath>
</java>
</target>
<target name="compile-and-run">
<antcall target="compile_core"/>
<antcall target="compile_plugins"/>
<antcall target="runserver"/>
</target>
<target name="compile">
<antcall target="compile_core"/>
<antcall target="compile_plugins"/>
</target>
</project>