build.xml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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 2, 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. <path id="classpath">
  28. <fileset dir="${lib}">
  29. <include name="c3p0-0.9.1.2.jar"/>
  30. <include name="jython.jar"/>
  31. <include name="javolution.jar"/>
  32. <include name="mysql-connector-java-5.1.5-bin.jar"/>
  33. <include name="mmocore.jar"/>
  34. </fileset>
  35. </path>
  36. <target name="init"
  37. depends="clean"
  38. description="Create the output directories.">
  39. <mkdir dir="${build}"/>
  40. <mkdir dir="${build.classes}"/>
  41. <mkdir dir="${build.dist}" />
  42. <mkdir dir="${build.dist.login}" />
  43. <mkdir dir="${build.dist.game}" />
  44. </target>
  45. <target name="compile"
  46. depends="version"
  47. description="Compile the source.">
  48. <javac destdir="${build.classes}"
  49. optimize="on"
  50. debug="on"
  51. source="1.5"
  52. target="1.5"
  53. nowarn="off">
  54. <src path="${src}"/>
  55. <classpath refid="classpath"/>
  56. </javac>
  57. </target>
  58. <target name="jar"
  59. depends="compile"
  60. description="Create the jar file">
  61. <jar destfile="${build}/l2jserver.jar">
  62. <fileset dir="${build.classes}"/>
  63. </jar>
  64. <copy todir="${build.dist.login}">
  65. <fileset dir="${build}">
  66. <include name="l2jserver.jar"/>
  67. </fileset>
  68. </copy>
  69. <copy todir="${build.dist.game}">
  70. <fileset dir="${build}">
  71. <include name="l2jserver.jar"/>
  72. </fileset>
  73. </copy>
  74. </target>
  75. <target name="compile.gcj"
  76. depends="jar"
  77. description="Build machine executable binary">
  78. <exec dir="." executable="gcj" failifexecutionfails="false" os="linux:Linux:freebsd:FreeBSD" >
  79. <arg line="-O3 ${build.dist}/l2jserver.jar -o ${build.dist}/l2jserver --main=net.sf.l2j.Server"/>
  80. </exec>
  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}">
  102. <fileset dir="${basedir}">
  103. <include name="changes.txt"/>
  104. <include name="LICENSE.txt"/>
  105. <include name="README.txt"/>
  106. </fileset>
  107. </copy>
  108. <copy todir="${build.dist}">
  109. <fileset dir="${src}/../lib">
  110. <include name="*LICENSE*"/>
  111. </fileset>
  112. </copy>
  113. <copy todir="${build.dist.login}">
  114. <fileset dir="dist">
  115. <include name="startAccountManager.*"/>
  116. <include name="startSQLAccountManager.*"/>
  117. <include name="LoginServer_loop.sh"/>
  118. <include name="startLoginServer.*"/>
  119. <include name="RegisterGameServer.*"/>
  120. </fileset>
  121. </copy>
  122. <copy todir="${build.dist.game}">
  123. <fileset dir="dist">
  124. <include name="GameServer_loop.sh"/>
  125. <include name="startGameServer.*"/>
  126. <include name="hibernate.cfg.xml"/>
  127. </fileset>
  128. </copy>
  129. <fixcrlf srcdir="${build.dist.game}"
  130. eol="lf"
  131. eof="remove"
  132. includes="**/*.sh">
  133. </fixcrlf>
  134. <fixcrlf srcdir="${build.dist.login}"
  135. eol="lf"
  136. eof="remove"
  137. includes="**/*.sh">
  138. </fixcrlf>
  139. <fixcrlf srcdir="${build.dist.game}"
  140. eol="crlf"
  141. eof="remove"
  142. includes="**/*.bat">
  143. </fixcrlf>
  144. <fixcrlf srcdir="${build.dist.login}"
  145. eol="crlf"
  146. eof="remove"
  147. includes="**/*.bat">
  148. </fixcrlf>
  149. <mkdir dir="${build.dist.game}/log" />
  150. <mkdir dir="${build.dist.login}/log" />
  151. <mkdir dir="${build.dist.game}/config" />
  152. <mkdir dir="${build.dist.login}/config" />
  153. <copy todir="${build.dist.game}/config">
  154. <fileset dir="java/config">
  155. <include name="*.properties"/>
  156. <exclude name="loginserver.properties" />
  157. </fileset>
  158. </copy>
  159. <copy todir="${build.dist.login}/config">
  160. <fileset dir="java/config">
  161. <include name="loginserver.properties"/>
  162. <include name="telnet.properties"/>
  163. </fileset>
  164. </copy>
  165. <mkdir dir="${build.dist.game}/data" />
  166. <copy todir="${build.dist.game}/data">
  167. <fileset dir="data">
  168. <include name="*.csv"/>
  169. <include name="*.txt"/>
  170. </fileset>
  171. </copy>
  172. <mkdir dir="${build.dist.game}/data/geodata" />
  173. <copy todir="${build.dist.game}/data/geodata">
  174. <fileset dir="data/geodata">
  175. <include name="*.txt"/>
  176. <include name="*.l2j"/>
  177. </fileset>
  178. </copy>
  179. <mkdir dir="${build.dist.game}/data/pathnode" />
  180. <copy todir="${build.dist.game}/data/pathnode">
  181. <fileset dir="data/pathnode">
  182. <include name="*.txt"/>
  183. <include name="*.pn"/>
  184. </fileset>
  185. </copy>
  186. <zip destfile="${build}/l2j-server.zip"
  187. basedir="${build.dist}" />
  188. </target>
  189. <target name="version"
  190. depends="init"
  191. description="Create l2j-version.properties file">
  192. <tstamp>
  193. <format property="build.tstamp"
  194. pattern="yyyyMMdd_HHmm"/>
  195. </tstamp>
  196. <exec dir="." executable="svnversion" outputproperty="l2j.revision"
  197. failifexecutionfails="false">
  198. <arg line="-n ."/>
  199. </exec>
  200. <concat destfile="${build.dist.game}/config/l2j-version.properties">
  201. version=${l2j.revision}
  202. builddate=${build.tstamp}
  203. detailed info:
  204. </concat>
  205. <concat destfile="${build.dist.game}/config/l2j-version.properties" append="true">
  206. <filelist dir="${src}/../.svn/" files="entries"/>
  207. <filterchain>
  208. <prefixlines prefix=" "/>
  209. <headfilter lines="8" skip="4"/>
  210. <tokenfilter>
  211. <ignoreblank/>
  212. </tokenfilter>
  213. </filterchain>
  214. </concat>
  215. </target>
  216. <target name="clean"
  217. description="Remove the output directories">
  218. <delete dir="${build}"/>
  219. </target>
  220. </project>