build.xml 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="L2J_Server" default="dist" basedir=".">
  3. <description>
  4. This script will build the L2J Server.
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3, or (at your option)
  8. any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  16. 02111-1307, USA.
  17. http://www.gnu.org/copyleft/gpl.html
  18. </description>
  19. <property name="src" location="java" />
  20. <property name="lib" location="lib" />
  21. <property name="build" location="build" />
  22. <property name="build.classes" location="${build}/classes" />
  23. <property name="build.dist" location="${build}/dist" />
  24. <property name="build.dist.login" location="${build.dist}/login" />
  25. <property name="build.dist.game" location="${build.dist}/gameserver" />
  26. <property name="build.dist.libs" location="${build.dist}/libs" />
  27. <property name="build.dist.languages" location="${build.dist}/languages" />
  28. <property name="build.dist.images" location="${build.dist}/images" />
  29. <property name="build.dist.doc" location="${build.dist}/doc" />
  30. <path id="classpath">
  31. <fileset dir="${lib}">
  32. <include name="c3p0-0.9.1.2.jar" />
  33. <include name="jython.jar" />
  34. <include name="jython-engine.jar" />
  35. <include name="javolution-5.5.1.jar" />
  36. <include name="mmocore.jar" />
  37. <include name="trove-2.1.0.jar" />
  38. <include name="netcon.jar" />
  39. </fileset>
  40. </path>
  41. <target name="verifyRequirements" description="Checks if the necessary requirements for building L2J are fulfilled">
  42. <available classname="javax.script.ScriptContext" property="JDK6.present" />
  43. <fail unless="JDK6.present" message="JDK 6 or greater is required." />
  44. </target>
  45. <target name="init" depends="clean, verifyRequirements" description="Create the output directories.">
  46. <mkdir dir="${build}" />
  47. <mkdir dir="${build.classes}" />
  48. <mkdir dir="${build.dist}" />
  49. <mkdir dir="${build.dist.login}" />
  50. <mkdir dir="${build.dist.game}" />
  51. </target>
  52. <target name="compile" depends="version" description="Compile the source.">
  53. <javac destdir="${build.classes}" optimize="on" debug="on" source="1.6" target="1.6" nowarn="off">
  54. <src path="${src}" />
  55. <classpath refid="classpath" />
  56. </javac>
  57. </target>
  58. <target name="jar" depends="compile" description="Create the jar file">
  59. <jar destfile="${build}/l2jserver.jar">
  60. <fileset dir="${build.classes}" >
  61. <exclude name="**/loginserver/**"/>
  62. <exclude name="**/accountmanager/**"/>
  63. <exclude name="**/gsregistering/**"/>
  64. </fileset>
  65. </jar>
  66. <jar destfile="${build}/l2jlogin.jar">
  67. <fileset dir="${build.classes}" >
  68. <exclude name="**/gameserver/**"/>
  69. </fileset>
  70. </jar>
  71. <copy todir="${build.dist.login}">
  72. <fileset dir="${build}">
  73. <include name="l2jlogin.jar" />
  74. </fileset>
  75. </copy>
  76. <copy todir="${build.dist.game}">
  77. <fileset dir="${build}">
  78. <include name="l2jserver.jar" />
  79. </fileset>
  80. </copy>
  81. </target>
  82. <target name="dist" depends="jar">
  83. <copy todir="${build.dist.login}">
  84. <fileset dir="${src}">
  85. <include name="log.cfg" />
  86. <include name="banned_ip.cfg" />
  87. <include name="console.cfg" />
  88. </fileset>
  89. </copy>
  90. <copy todir="${build.dist.game}">
  91. <fileset dir="${src}">
  92. <include name="log.cfg" />
  93. <include name="console.cfg" />
  94. </fileset>
  95. </copy>
  96. <copy todir="${build.dist.libs}">
  97. <fileset dir="${src}/../lib">
  98. <include name="*.jar" />
  99. </fileset>
  100. </copy>
  101. <copy todir="${build.dist.languages}">
  102. <fileset dir="${src}/../languages" />
  103. </copy>
  104. <copy todir="${build.dist.images}">
  105. <fileset dir="${src}/../images" />
  106. </copy>
  107. <copy todir="${build.dist.doc}">
  108. <fileset dir="${basedir}">
  109. <include name="changes.txt" />
  110. <include name="LICENSE.txt" />
  111. <include name="README.txt" />
  112. </fileset>
  113. </copy>
  114. <copy todir="${build.dist.doc}">
  115. <fileset dir="${src}/../lib">
  116. <include name="*LICENSE*" />
  117. </fileset>
  118. </copy>
  119. <copy todir="${build.dist.login}">
  120. <fileset dir="dist">
  121. <include name="startAccountManager.*" />
  122. <include name="startSQLAccountManager.*" />
  123. <include name="LoginServer_loop.sh" />
  124. <include name="startLoginServer.*" />
  125. <include name="RegisterGameServer.*" />
  126. <include name="GSRegister.exe" />
  127. <include name="L2JConfig.exe" />
  128. <include name="L2JConfig.sh" />
  129. </fileset>
  130. </copy>
  131. <copy todir="${build.dist.game}">
  132. <fileset dir="dist">
  133. <include name="GameServer_loop.sh" />
  134. <include name="startGameServer.*" />
  135. <include name="L2JConfig.exe" />
  136. <include name="L2JConfig.sh" />
  137. <include name="hibernate.cfg.xml" />
  138. </fileset>
  139. </copy>
  140. <fixcrlf srcdir="${build.dist.game}" eol="lf" eof="remove" includes="**/*.sh" />
  141. <fixcrlf srcdir="${build.dist.login}" eol="lf" eof="remove" includes="**/*.sh" />
  142. <fixcrlf srcdir="${build.dist.game}" eol="crlf" eof="remove" includes="**/*.bat" />
  143. <fixcrlf srcdir="${build.dist.login}" eol="crlf" eof="remove" includes="**/*.bat" />
  144. <mkdir dir="${build.dist.game}/log" />
  145. <mkdir dir="${build.dist.login}/log" />
  146. <mkdir dir="${build.dist.game}/config" />
  147. <mkdir dir="${build.dist.login}/config" />
  148. <copy todir="${build.dist.game}/config">
  149. <fileset dir="java/config">
  150. <include name="*.properties" />
  151. <include name="chatfilter.txt" />
  152. <exclude name="loginserver.properties" />
  153. </fileset>
  154. </copy>
  155. <copy todir="${build.dist.login}/config">
  156. <fileset dir="java/config">
  157. <include name="loginserver.properties" />
  158. <include name="mmo.properties" />
  159. <include name="telnet.properties" />
  160. </fileset>
  161. </copy>
  162. <mkdir dir="${build.dist.game}/data" />
  163. <copy todir="${build.dist.game}/data">
  164. <fileset dir="data">
  165. <include name="*.csv" />
  166. <include name="*.txt" />
  167. </fileset>
  168. </copy>
  169. <mkdir dir="${build.dist.game}/data/geodata" />
  170. <copy todir="${build.dist.game}/data/geodata">
  171. <fileset dir="data/geodata">
  172. <include name="*.txt" />
  173. <include name="*.l2j" />
  174. </fileset>
  175. </copy>
  176. <mkdir dir="${build.dist.game}/data/pathnode" />
  177. <copy todir="${build.dist.game}/data/pathnode">
  178. <fileset dir="data/pathnode">
  179. <include name="*.txt" />
  180. <include name="*.pn" />
  181. </fileset>
  182. </copy>
  183. <zip destfile="${build}/L2J_Server.zip" basedir="${build.dist}" />
  184. </target>
  185. <target name="version" depends="init" description="Create l2j-version.properties file">
  186. <tstamp>
  187. <format property="build.tstamp" pattern="yyyyMMdd_HHmm" />
  188. </tstamp>
  189. <exec dir="." executable="svnversion" outputproperty="l2j.revision" failifexecutionfails="false">
  190. <arg line="-n ." />
  191. </exec>
  192. <concat destfile="${build.dist.game}/config/l2j-version.properties">
  193. version=${l2j.revision}
  194. builddate=${build.tstamp}
  195. detailed info:
  196. </concat>
  197. <concat destfile="${build.dist.game}/config/l2j-version.properties" append="true">
  198. <filelist dir="${src}/../.svn/" files="entries" />
  199. <filterchain>
  200. <prefixlines prefix=" " />
  201. <headfilter lines="8" skip="4" />
  202. <tokenfilter>
  203. <ignoreblank />
  204. </tokenfilter>
  205. </filterchain>
  206. </concat>
  207. </target>
  208. <target name="clean" description="Remove the output directories">
  209. <delete dir="${build}" />
  210. </target>
  211. </project>