build.xml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. <pathelement location="${lib}/netty-3.4.6.final.jar"/>
  43. <pathelement location="${lib}/log4j-api-2.17.0.jar"/>
  44. <pathelement location="${lib}/log4j-core-2.17.0.jar"/>
  45. <pathelement location="${lib}/log4j-iostreams-2.17.0.jar"/>
  46. <pathelement location="${lib}/xpp3-1.1.4c.jar"/>
  47. <pathelement location="${lib}/xstream-1.4.18.jar"/>
  48. <pathelement location="${lib}/mysql-connector-java-8.0.19.jar"/>
  49. <pathelement location="${lib}/sqlite-jdbc-3.34.0.jar"/>
  50. <pathelement location="${lib}/commons-lang-2.6.jar"/>
  51. <pathelement location="${lib}/guava-30.1.1-jre.jar"/>
  52. <pathelement location="${lib}/JDA-4.0.0_55-withDependencies.jar"/>
  53. <pathelement location="${lib}/emoji-java-5.1.1.jar"/>
  54. <pathelement location="${lib}/json-20190722.jar"/>
  55. <pathelement location="${lib}/gitlab4j-api-4.12.17.jar"/>
  56. <pathelement location="${lib}/slf4j-nop-2.0.0-alpha5.jar"/>
  57. <pathelement location="${lib}/disruptor-3.3.11.jar"/>
  58. <pathelement location="${lib}/guice-5.0.2-jar-with-dependencies.jar"/>
  59. </classpath>
  60. <compilerarg line="-Xlint:deprecation"/>
  61. </javac>
  62. <jar basedir="${build}" destfile="${jar}">
  63. <zipgroupfileset dir="${lib}" includes="*.jar"/>
  64. <manifest>
  65. <attribute name="Main-Class" value="com.openrsc.server.Server"/>
  66. </manifest>
  67. </jar>
  68. <delete dir="${build}"/>
  69. </target>
  70. <property name="confFile" value="default" />
  71. <property name="coloredLogging" value="false" />
  72. <target name="runserverzgc">
  73. <!-- java 17+ recommended for mature ZGC implementation -->
  74. <echo message="Using JVM 17+ launch arguments"/>
  75. <java classname="com.openrsc.server.Server" fork="true">
  76. <!-- usage: `ant runserver -DconfFile=preservation` to run server with config file preservation.conf -->
  77. <arg value="${confFile}.conf"/>
  78. <jvmarg line="-Xms800M -Xmx2048M -Xdiag -XX:+UseZGC -XX:NewSize=128m -DcoloredLogging=${coloredLogging}"/>
  79. <classpath>
  80. <pathelement location="${lib}/netty-all-4.1.8.Final.jar"/>
  81. <pathelement location="${lib}/disruptor-3.3.0.jar"/>
  82. <pathelement location="${lib}/log4j-api-2.17.0.jar"/>
  83. <pathelement location="${lib}/log4j-core-2.17.0.jar"/>
  84. <pathelement location="${lib}/log4j-iostreams-2.17.0.jar"/>
  85. <pathelement location="${lib}/xpp3_min-1.1.4c.jar"/>
  86. <pathelement location="${lib}/xpp3-1.1.4c.jar"/>
  87. <pathelement location="${lib}/xstream-1.4.9.jar"/>
  88. <pathelement location="${lib}/mysql-connector-java-8.0.19.jar"/>
  89. <pathelement location="${lib}/disruptor-3.3.5.jar"/>
  90. <pathelement location="${lib}/commons-lang-2.6.jar"/>
  91. <pathelement location="${lib}/*"/>
  92. <pathelement location="${lib}/commons-codec-1.14.jar"/>
  93. <pathelement path="${jar}/"/>
  94. </classpath>
  95. </java>
  96. </target>
  97. <target name="runserver">
  98. <!-- java 8 compatible jvm args. Add more heap if you can. -->
  99. <echo message="Using JVM arguments for Java 8 minimum."/>
  100. <echo message="Upgrade to Java 17 or later for better garbage collection."/>
  101. <java classname="com.openrsc.server.Server" fork="true">
  102. <!-- usage: `ant runserver -DconfFile=preservation` to run server with config file preservation.conf -->
  103. <arg value="${confFile}.conf"/>
  104. <jvmarg line="-Xdiag -XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:+UseBiasedLocking -XX:NewSize=64m -DcoloredLogging=${coloredLogging}"/>
  105. <classpath>
  106. <pathelement location="${lib}/netty-all-4.1.8.Final.jar"/>
  107. <pathelement location="${lib}/disruptor-3.3.0.jar"/>
  108. <pathelement location="${lib}/log4j-api-2.17.0.jar"/>
  109. <pathelement location="${lib}/log4j-core-2.17.0.jar"/>
  110. <pathelement location="${lib}/log4j-iostreams-2.17.0.jar"/>
  111. <pathelement location="${lib}/xpp3_min-1.1.4c.jar"/>
  112. <pathelement location="${lib}/xpp3-1.1.4c.jar"/>
  113. <pathelement location="${lib}/xstream-1.4.9.jar"/>
  114. <pathelement location="${lib}/mysql-connector-java-8.0.19.jar"/>
  115. <pathelement location="${lib}/disruptor-3.3.5.jar"/>
  116. <pathelement location="${lib}/commons-lang-2.6.jar"/>
  117. <pathelement location="${lib}/*"/>
  118. <pathelement location="${lib}/commons-codec-1.14.jar"/>
  119. <pathelement path="${jar}/"/>
  120. </classpath>
  121. </java>
  122. </target>
  123. <target name="compile-and-run">
  124. <antcall target="compile_core"/>
  125. <antcall target="compile_plugins"/>
  126. <antcall target="runserver"/>
  127. </target>
  128. <target name="compile">
  129. <antcall target="compile_core"/>
  130. <antcall target="compile_plugins"/>
  131. </target>
  132. </project>