build.xml 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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. <path id="classpath">
  30. <fileset dir="${lib}">
  31. <include name="c3p0-0.9.1.2.jar"/>
  32. <include name="jython.jar"/>
  33. <include name="jython-engine.jar"/>
  34. <include name="javolution-5.3.1.jar"/>
  35. <include name="mmocore.jar"/>
  36. <include name="trove-2.1.0.jar"/>
  37. </fileset>
  38. </path>
  39. <target name="verifyRequirements"
  40. description="Checks if the necessary requirements for building L2J are fulfilled">
  41. <available classname="javax.script.ScriptContext" property="JDK6.present"/>
  42. <fail unless="JDK6.present" message="JDK 6 or greater is required.">
  43. </fail>
  44. </target>
  45. <target name="init"
  46. depends="clean, verifyRequirements"
  47. description="Create the output directories.">
  48. <mkdir dir="${build}"/>
  49. <mkdir dir="${build.classes}"/>
  50. <mkdir dir="${build.dist}" />
  51. <mkdir dir="${build.dist.login}" />
  52. <mkdir dir="${build.dist.game}" />
  53. </target>
  54. <target name="compile"
  55. depends="version"
  56. description="Compile the source.">
  57. <javac destdir="${build.classes}"
  58. optimize="on"
  59. debug="on"
  60. source="1.6"
  61. target="1.6"
  62. nowarn="off">
  63. <src path="${src}"/>
  64. <classpath refid="classpath"/>
  65. </javac>
  66. </target>
  67. <target name="jar"
  68. depends="compile"
  69. description="Create the jar file">
  70. <jar destfile="${build}/l2jserver.jar">
  71. <fileset dir="${build.classes}"/>
  72. </jar>
  73. <copy todir="${build.dist.login}">
  74. <fileset dir="${build}">
  75. <include name="l2jserver.jar"/>
  76. </fileset>
  77. </copy>
  78. <copy todir="${build.dist.game}">
  79. <fileset dir="${build}">
  80. <include name="l2jserver.jar"/>
  81. </fileset>
  82. </copy>
  83. </target>
  84. <target name="dist" depends="jar">
  85. <copy todir="${build.dist.login}">
  86. <fileset dir="${src}">
  87. <include name="log.cfg"/>
  88. <include name="banned_ip.cfg"/>
  89. <include name="console.cfg"/>
  90. </fileset>
  91. </copy>
  92. <copy todir="${build.dist.game}">
  93. <fileset dir="${src}">
  94. <include name="log.cfg"/>
  95. <include name="console.cfg"/>
  96. </fileset>
  97. </copy>
  98. <copy todir="${build.dist.libs}">
  99. <fileset dir="${src}/../lib">
  100. <include name="*.jar"/>
  101. </fileset>
  102. </copy>
  103. <copy todir="${build.dist.languages}">
  104. <fileset dir="${src}/../languages">
  105. <include name="**/*"/>
  106. </fileset>
  107. </copy>
  108. <copy todir="${build.dist.images}">
  109. <fileset dir="${src}/../images">
  110. <include name="**/*"/>
  111. </fileset>
  112. </copy>
  113. <copy todir="${build.dist}">
  114. <fileset dir="${basedir}">
  115. <include name="changes.txt"/>
  116. <include name="LICENSE.txt"/>
  117. <include name="README.txt"/>
  118. </fileset>
  119. </copy>
  120. <copy todir="${build.dist}">
  121. <fileset dir="${src}/../lib">
  122. <include name="*LICENSE*"/>
  123. </fileset>
  124. </copy>
  125. <copy todir="${build.dist.login}">
  126. <fileset dir="dist">
  127. <include name="startAccountManager.*"/>
  128. <include name="startSQLAccountManager.*"/>
  129. <include name="LoginServer_loop.sh"/>
  130. <include name="startLoginServer.*"/>
  131. <include name="RegisterGameServer.*"/>
  132. <include name="GSRegister.exe"/>
  133. <include name="L2JConfig.exe"/>
  134. <include name="L2JConfig.sh"/>
  135. </fileset>
  136. </copy>
  137. <copy todir="${build.dist.game}">
  138. <fileset dir="dist">
  139. <include name="GameServer_loop.sh"/>
  140. <include name="startGameServer.*"/>
  141. <include name="L2JConfig.exe"/>
  142. <include name="L2JConfig.sh"/>
  143. <include name="hibernate.cfg.xml"/>
  144. </fileset>
  145. </copy>
  146. <fixcrlf srcdir="${build.dist.game}"
  147. eol="lf"
  148. eof="remove"
  149. includes="**/*.sh">
  150. </fixcrlf>
  151. <fixcrlf srcdir="${build.dist.login}"
  152. eol="lf"
  153. eof="remove"
  154. includes="**/*.sh">
  155. </fixcrlf>
  156. <fixcrlf srcdir="${build.dist.game}"
  157. eol="crlf"
  158. eof="remove"
  159. includes="**/*.bat">
  160. </fixcrlf>
  161. <fixcrlf srcdir="${build.dist.login}"
  162. eol="crlf"
  163. eof="remove"
  164. includes="**/*.bat">
  165. </fixcrlf>
  166. <mkdir dir="${build.dist.game}/log" />
  167. <mkdir dir="${build.dist.login}/log" />
  168. <mkdir dir="${build.dist.game}/config" />
  169. <mkdir dir="${build.dist.login}/config" />
  170. <copy todir="${build.dist.game}/config">
  171. <fileset dir="java/config">
  172. <include name="*.properties"/>
  173. <exclude name="loginserver.properties" />
  174. </fileset>
  175. </copy>
  176. <copy todir="${build.dist.login}/config">
  177. <fileset dir="java/config">
  178. <include name="loginserver.properties"/>
  179. <include name="mmo.properties"/>
  180. <include name="telnet.properties"/>
  181. </fileset>
  182. </copy>
  183. <mkdir dir="${build.dist.game}/data" />
  184. <copy todir="${build.dist.game}/data">
  185. <fileset dir="data">
  186. <include name="*.csv"/>
  187. <include name="*.txt"/>
  188. </fileset>
  189. </copy>
  190. <mkdir dir="${build.dist.game}/data/geodata" />
  191. <copy todir="${build.dist.game}/data/geodata">
  192. <fileset dir="data/geodata">
  193. <include name="*.txt"/>
  194. <include name="*.l2j"/>
  195. </fileset>
  196. </copy>
  197. <mkdir dir="${build.dist.game}/data/pathnode" />
  198. <copy todir="${build.dist.game}/data/pathnode">
  199. <fileset dir="data/pathnode">
  200. <include name="*.txt"/>
  201. <include name="*.pn"/>
  202. </fileset>
  203. </copy>
  204. <zip destfile="${build}/L2J_Server.zip"
  205. basedir="${build.dist}" />
  206. </target>
  207. <target name="version"
  208. depends="init"
  209. description="Create l2j-version.properties file">
  210. <tstamp>
  211. <format property="build.tstamp"
  212. pattern="yyyyMMdd_HHmm"/>
  213. </tstamp>
  214. <exec dir="." executable="svnversion" outputproperty="l2j.revision"
  215. failifexecutionfails="false">
  216. <arg line="-n ."/>
  217. </exec>
  218. <concat destfile="${build.dist.game}/config/l2j-version.properties">
  219. version=${l2j.revision}
  220. builddate=${build.tstamp}
  221. detailed info:
  222. </concat>
  223. <concat destfile="${build.dist.game}/config/l2j-version.properties" append="true">
  224. <filelist dir="${src}/../.svn/" files="entries"/>
  225. <filterchain>
  226. <prefixlines prefix=" "/>
  227. <headfilter lines="8" skip="4"/>
  228. <tokenfilter>
  229. <ignoreblank/>
  230. </tokenfilter>
  231. </filterchain>
  232. </concat>
  233. </target>
  234. <target name="clean"
  235. description="Remove the output directories">
  236. <delete dir="${build}"/>
  237. </target>
  238. </project>