build.xml 9.0 KB

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