build.xml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  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. $Author: Lbaldi $
  6. $Date: 2006-06-30 11:11:21 +0200 (ven., 30 juin 2006) $
  7. $Revision: 2164 $
  8. This program is free software; you can redistribute it and/or modify
  9. it under the terms of the GNU General Public License as published by
  10. the Free Software Foundation; either version 2, or (at your option)
  11. any later version.
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. GNU General Public License for more details.
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  19. 02111-1307, USA.
  20. http://www.gnu.org/copyleft/gpl.html
  21. </description>
  22. <property name="src" location="java"/>
  23. <property name="lib" location="lib"/>
  24. <property name="build" location="build"/>
  25. <property name="build.classes" location="${build}/classes"/>
  26. <property name="build.dist" location="${build}/dist"/>
  27. <property name="build.dist.login" location="${build.dist}/login"/>
  28. <property name="build.dist.game" location="${build.dist}/gameserver"/>
  29. <path id="classpath">
  30. <fileset dir="${lib}">
  31. <include name="c3p0-0.9.0.jar"/>
  32. <include name="bsf.jar"/>
  33. <include name="bsh-2.0.jar"/>
  34. <include name="jython.jar"/>
  35. <include name="javolution.jar"/>
  36. <include name="hibernate3.jar"/>
  37. </fileset>
  38. </path>
  39. <target name="init"
  40. depends="clean"
  41. description="Create the output directories.">
  42. <mkdir dir="${build}"/>
  43. <mkdir dir="${build.classes}"/>
  44. <mkdir dir="${build.dist}" />
  45. <mkdir dir="${build.dist.login}" />
  46. <mkdir dir="${build.dist.game}" />
  47. </target>
  48. <target name="compile"
  49. depends="version"
  50. description="Compile the source.">
  51. <javac destdir="${build.classes}"
  52. optimize="on"
  53. debug="on"
  54. source="1.5"
  55. target="1.5"
  56. nowarn="off">
  57. <src path="${src}"/>
  58. <classpath refid="classpath"/>
  59. </javac>
  60. </target>
  61. <target name="jar"
  62. depends="compile"
  63. description="Create the jar file">
  64. <jar destfile="${build}/l2jserver.jar">
  65. <fileset dir="${build.classes}"/>
  66. <manifest>
  67. <attribute name="Main-Class" value="net.sf.l2j.Server"/>
  68. <attribute name="Class-Path" value=". bsf.jar bsh-2.0.jar c3p0-0.9.0.jar jython.jar mysql-connector-java-3.1.10-bin.jar sqljdbc.jar javolution.jar"/>
  69. </manifest>
  70. </jar>
  71. <copy todir="${build.dist.login}">
  72. <fileset dir="${build}">
  73. <include name="l2jserver.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="compile.gcj"
  83. depends="jar"
  84. description="Build machine executable binary">
  85. <exec dir="." executable="gcj" failifexecutionfails="false" os="linux:Linux:freebsd:FreeBSD" >
  86. <arg line="-O3 ${build.dist}/l2jserver.jar -o ${build.dist}/l2jserver --main=net.sf.l2j.Server"/>
  87. </exec>
  88. </target>
  89. <target name="dist" depends="jar">
  90. <copy todir="${build.dist.login}">
  91. <fileset dir="${src}">
  92. <include name="log.cfg"/>
  93. <include name="banned_ip.cfg"/>
  94. <include name="console.cfg"/>
  95. </fileset>
  96. </copy>
  97. <copy todir="${build.dist.game}">
  98. <fileset dir="${src}">
  99. <include name="log.cfg"/>
  100. <include name="console.cfg"/>
  101. </fileset>
  102. </copy>
  103. <copy todir="${build.dist.login}">
  104. <fileset dir="${src}/../lib">
  105. <include name="c3p0-0.9.0.jar"/>
  106. <include name="mysql-connector-java-3.1.10-bin.jar"/>
  107. <include name="sqljdbc.jar"/>
  108. <include name="javolution.jar"/>
  109. </fileset>
  110. </copy>
  111. <copy todir="${build.dist.game}">
  112. <fileset dir="${src}/../lib">
  113. <include name="*.jar"/>
  114. </fileset>
  115. </copy>
  116. <copy todir="${build.dist}">
  117. <fileset dir="${basedir}">
  118. <include name="changes.txt"/>
  119. <include name="LICENSE.txt"/>
  120. <include name="README.txt"/>
  121. </fileset>
  122. </copy>
  123. <copy todir="${build.dist}">
  124. <fileset dir="${src}/../lib">
  125. <include name="License*.*"/>
  126. </fileset>
  127. </copy>
  128. <copy todir="${build.dist.login}">
  129. <fileset dir="dist">
  130. <include name="startAccountManager.*"/>
  131. <include name="startSQLAccountManager.*"/>
  132. <include name="LoginServer_loop.sh"/>
  133. <include name="startLoginServer.*"/>
  134. <include name="RegisterGameServer.*"/>
  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="hibernate.cfg.xml"/>
  142. </fileset>
  143. </copy>
  144. <fixcrlf srcdir="${build.dist.game}"
  145. eol="lf"
  146. eof="remove"
  147. includes="**/*.sh">
  148. </fixcrlf>
  149. <fixcrlf srcdir="${build.dist.login}"
  150. eol="lf"
  151. eof="remove"
  152. includes="**/*.sh">
  153. </fixcrlf>
  154. <fixcrlf srcdir="${build.dist.game}"
  155. eol="crlf"
  156. eof="remove"
  157. includes="**/*.bat">
  158. </fixcrlf>
  159. <fixcrlf srcdir="${build.dist.login}"
  160. eol="crlf"
  161. eof="remove"
  162. includes="**/*.bat">
  163. </fixcrlf>
  164. <mkdir dir="${build.dist.game}/log" />
  165. <mkdir dir="${build.dist.login}/log" />
  166. <mkdir dir="${build.dist.game}/hibernate-mapping" />
  167. <mkdir dir="${build.dist.game}/config" />
  168. <mkdir dir="${build.dist.login}/config" />
  169. <copy todir="${build.dist.game}/config">
  170. <fileset dir="java/config">
  171. <include name="*.properties"/>
  172. <exclude name="loginserver.properties" />
  173. </fileset>
  174. </copy>
  175. <copy todir="${build.dist.login}/config">
  176. <fileset dir="java/config">
  177. <include name="loginserver.properties"/>
  178. <include name="telnet.properties"/>
  179. </fileset>
  180. </copy>
  181. <copy todir="${build.dist.game}/hibernate-mapping">
  182. <fileset dir="dist/hibernate-mapping">
  183. <include name="*.xml"/>
  184. </fileset>
  185. </copy>
  186. <mkdir dir="${build.dist.game}/data" />
  187. <copy todir="${build.dist.game}/data">
  188. <fileset dir="data">
  189. <include name="*.csv"/>
  190. <include name="*.txt"/>
  191. </fileset>
  192. </copy>
  193. <copy todir="${build.dist.login}">
  194. <fileset dir="data">
  195. <include name="servername.xml"/>
  196. </fileset>
  197. </copy>
  198. <mkdir dir="${build.dist.game}/data/html" />
  199. <copy todir="${build.dist.game}/data/html">
  200. <fileset dir="data/html">
  201. <include name="**/*.htm"/>
  202. <include name="**/*.html"/>
  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. <headfilter lines="5" skip="4"/>
  228. </filterchain>
  229. </concat>
  230. </target>
  231. <target name="clean"
  232. description="Remove the output directories">
  233. <delete dir="${build}"/>
  234. </target>
  235. </project>