build.xml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <project default="compile_core" basedir=".">
  2. <property name="src" location="src"/>
  3. <property name="build" location="build"/>
  4. <property name="lib" location="lib"/>
  5. <property name="jar" location="core.jar"/>
  6. <property name="javac.source" value="1.8"/>
  7. <property name="javac.target" value="1.8"/>
  8. <target name="clean">
  9. <delete dir="${build}" />
  10. <delete file="${jar}" />
  11. </target>
  12. <target name="compile_plugins">
  13. <delete file="plugins.jar"/>
  14. <delete dir="buildplugins"/>
  15. <mkdir dir="buildplugins"/>
  16. <javac srcdir="plugins" destdir="buildplugins" debug="on" includeantruntime="false" target="${javac.target}"
  17. source="${javac.source}" encoding="UTF-8">
  18. <classpath>
  19. <pathelement location="core.jar"/>
  20. <pathelement path="${java.class.path}/"/>
  21. <pathelement location="${lib}/log4j-api-2.17.0.jar"/>
  22. <pathelement location="${lib}/log4j-core-2.17.0.jar"/>
  23. <pathelement location="${lib}/disruptor-3.3.5.jar"/>
  24. <pathelement location="${lib}/commons-lang-2.6.jar"/>
  25. </classpath>
  26. <compilerarg line="-Xlint:deprecation"/>
  27. </javac>
  28. <jar basedir="buildplugins" destfile="plugins.jar"/>
  29. <delete dir="buildplugins"/>
  30. </target>
  31. <target name="compile_core">
  32. <delete file="${jar}"/>
  33. <delete dir="${build}"/>
  34. <mkdir dir="${build}"/>
  35. <javac srcdir="${src}" destdir="${build}" debug="on" includeantruntime="false" target="${javac.target}"
  36. source="${javac.source}" encoding="UTF-8">
  37. <classpath>
  38. <pathelement location="${lib}/commons-lang3-3.12.0.jar"/>
  39. <pathelement location="${lib}/commons-codec-1.14.jar"/>
  40. <pathelement location="${lib}/commons-compress-1.18.jar"/>
  41. <pathelement location="${lib}/netty-all-4.1.33.Final.jar"/>
  42. <!--
  43. <pathelement location="${lib}/netty-common-4.1.107.Final.jar"/>
  44. <pathelement location="${lib}/netty-transport-4.1.107.Final.jar"/>
  45. <pathelement location="${lib}/netty-transport-native-unix-common-4.1.107.Final.jar"/>
  46. <pathelement location="${lib}/netty-buffer-4.1.107.Final.jar"/>
  47. <pathelement location="${lib}/netty-codec-4.1.107.Final.jar"/>
  48. <pathelement location="${lib}/netty-codec-http-4.1.107.Final.jar"/>
  49. <pathelement location="${lib}/netty-handler-4.1.107.Final.jar"/>
  50. -->
  51. <pathelement location="${lib}/log4j-api-2.17.0.jar"/>
  52. <pathelement location="${lib}/log4j-core-2.17.0.jar"/>
  53. <pathelement location="${lib}/log4j-iostreams-2.17.0.jar"/>
  54. <pathelement location="${lib}/xpp3-1.1.4c.jar"/>
  55. <pathelement location="${lib}/xstream-1.4.18.jar"/>
  56. <pathelement location="${lib}/mysql-connector-java-8.0.19.jar"/>
  57. <pathelement location="${lib}/sqlite-jdbc-3.34.0.jar"/>
  58. <pathelement location="${lib}/commons-lang-2.6.jar"/>
  59. <pathelement location="${lib}/guava-30.1.1-jre.jar"/>
  60. <pathelement location="${lib}/JDA-4.0.0_55-withDependencies.jar"/>
  61. <pathelement location="${lib}/emoji-java-5.1.1.jar"/>
  62. <pathelement location="${lib}/json-20190722.jar"/>
  63. <pathelement location="${lib}/gitlab4j-api-4.12.17.jar"/>
  64. <pathelement location="${lib}/slf4j-nop-2.0.0-alpha5.jar"/>
  65. <pathelement location="${lib}/disruptor-3.3.11.jar"/>
  66. <pathelement location="${lib}/guice-5.0.2-jar-with-dependencies.jar"/>
  67. </classpath>
  68. <compilerarg line="-Xlint:deprecation"/>
  69. </javac>
  70. <jar basedir="${build}" destfile="${jar}">
  71. <zipgroupfileset dir="${lib}" includes="*.jar"/>
  72. <manifest>
  73. <attribute name="Main-Class" value="com.openrsc.server.Server"/>
  74. </manifest>
  75. </jar>
  76. <delete dir="${build}"/>
  77. </target>
  78. <property name="confFile" value="default" />
  79. <property name="coloredLogging" value="false" />
  80. <target name="runserverzgc">
  81. <!-- java 17+ recommended for mature ZGC implementation -->
  82. <echo message="Using JVM 17+ launch arguments"/>
  83. <java classname="com.openrsc.server.Server" fork="true">
  84. <!-- usage: `ant runserver -DconfFile=preservation` to run server with config file preservation.conf -->
  85. <arg value="${confFile}.conf"/>
  86. <jvmarg line="-Xms800M -Xmx2048M -Xdiag -XX:+UseZGC -XX:NewSize=128m -DcoloredLogging=${coloredLogging}"/>
  87. <classpath>
  88. <pathelement location="${lib}/disruptor-3.3.0.jar"/>
  89. <pathelement location="${lib}/log4j-api-2.17.0.jar"/>
  90. <pathelement location="${lib}/log4j-core-2.17.0.jar"/>
  91. <pathelement location="${lib}/log4j-iostreams-2.17.0.jar"/>
  92. <pathelement location="${lib}/xpp3_min-1.1.4c.jar"/>
  93. <pathelement location="${lib}/xpp3-1.1.4c.jar"/>
  94. <pathelement location="${lib}/xstream-1.4.9.jar"/>
  95. <pathelement location="${lib}/mysql-connector-java-8.0.19.jar"/>
  96. <pathelement location="${lib}/disruptor-3.3.5.jar"/>
  97. <pathelement location="${lib}/commons-lang-2.6.jar"/>
  98. <pathelement location="${lib}/*"/>
  99. <pathelement location="${lib}/commons-codec-1.14.jar"/>
  100. <pathelement path="${jar}/"/>
  101. </classpath>
  102. </java>
  103. </target>
  104. <target name="runserver">
  105. <!-- java 8 compatible jvm args. Add more heap if you can. -->
  106. <echo message="Using JVM arguments for Java 8 minimum."/>
  107. <echo message="Upgrade to Java 17 or later for better garbage collection."/>
  108. <java classname="com.openrsc.server.Server" fork="true">
  109. <!-- usage: `ant runserver -DconfFile=preservation` to run server with config file preservation.conf -->
  110. <arg value="${confFile}.conf"/>
  111. <jvmarg line="-Xdiag -XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:+UseBiasedLocking -XX:NewSize=64m -DcoloredLogging=${coloredLogging}"/>
  112. <classpath>
  113. <pathelement location="${lib}/disruptor-3.3.0.jar"/>
  114. <pathelement location="${lib}/log4j-api-2.17.0.jar"/>
  115. <pathelement location="${lib}/log4j-core-2.17.0.jar"/>
  116. <pathelement location="${lib}/log4j-iostreams-2.17.0.jar"/>
  117. <pathelement location="${lib}/xpp3_min-1.1.4c.jar"/>
  118. <pathelement location="${lib}/xpp3-1.1.4c.jar"/>
  119. <pathelement location="${lib}/xstream-1.4.9.jar"/>
  120. <pathelement location="${lib}/mysql-connector-java-8.0.19.jar"/>
  121. <pathelement location="${lib}/disruptor-3.3.5.jar"/>
  122. <pathelement location="${lib}/commons-lang-2.6.jar"/>
  123. <pathelement location="${lib}/*"/>
  124. <pathelement location="${lib}/commons-codec-1.14.jar"/>
  125. <pathelement path="${jar}/"/>
  126. </classpath>
  127. </java>
  128. </target>
  129. <target name="compile-and-run">
  130. <antcall target="compile_core"/>
  131. <antcall target="compile_plugins"/>
  132. <antcall target="runserver"/>
  133. </target>
  134. <target name="compile">
  135. <antcall target="compile_core"/>
  136. <antcall target="compile_plugins"/>
  137. </target>
  138. </project>