build.xml 8.9 KB

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