build.xml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="L2J_Server_BETA" 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. <property name="build.dist.doc" location="${build.dist}/doc" />
  30. <path id="classpath">
  31. <fileset dir="${lib}">
  32. <include name="bonecp-0.7.1.jar" />
  33. <include name="guava-r09.jar" />
  34. <include name="slf4j-api-1.6.1.jar" />
  35. <include name="slf4j-simple-1.6.1.jar" />
  36. <include name="jython.jar" />
  37. <include name="jython-engine.jar" />
  38. <include name="javolution-5.5.1.jar" />
  39. <include name="mmocore.jar" />
  40. <include name="trove-2.1.0.jar" />
  41. <include name="netcon.jar" />
  42. </fileset>
  43. </path>
  44. <target name="verifyRequirements" description="Checks if the necessary requirements for building L2J are fulfilled">
  45. <available classname="javax.script.ScriptContext" property="JDK6.present" />
  46. <fail unless="JDK6.present" message="JDK 6 or greater is required." />
  47. </target>
  48. <target name="init" depends="clean, verifyRequirements" 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" depends="version" description="Compile the source.">
  56. <javac destdir="${build.classes}" optimize="on" debug="on" source="1.6" target="1.6" nowarn="off">
  57. <src path="${src}" />
  58. <classpath refid="classpath" />
  59. </javac>
  60. </target>
  61. <target name="jar" depends="compile" description="Create the jar file">
  62. <jar destfile="${build}/l2jserver.jar">
  63. <fileset dir="${build.classes}">
  64. <exclude name="**/loginserver/**" />
  65. <exclude name="**/accountmanager/**" />
  66. <exclude name="**/gsregistering/**" />
  67. </fileset>
  68. <manifest>
  69. <attribute name="Built-By" value="${user.name}" />
  70. <attribute name="Built-Date" value="${build.tstamp}" />
  71. <attribute name="Implementation-Version" value="${l2j.revision}" />
  72. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  73. </manifest>
  74. </jar>
  75. <jar destfile="${build}/l2jlogin.jar">
  76. <fileset dir="${build.classes}">
  77. <exclude name="**/gameserver/**" />
  78. </fileset>
  79. <manifest>
  80. <attribute name="Built-By" value="${user.name}" />
  81. <attribute name="Built-Date" value="${build.tstamp}" />
  82. <attribute name="Implementation-Version" value="${l2j.revision}" />
  83. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  84. </manifest>
  85. </jar>
  86. <copy todir="${build.dist.login}">
  87. <fileset dir="${build}">
  88. <include name="l2jlogin.jar" />
  89. </fileset>
  90. </copy>
  91. <copy todir="${build.dist.game}">
  92. <fileset dir="${build}">
  93. <include name="l2jserver.jar" />
  94. </fileset>
  95. </copy>
  96. </target>
  97. <target name="jarsrc" depends="jar">
  98. <mkdir dir="${build.dist.libs}" />
  99. <jar destfile="${build.dist.libs}/l2jserver-src.jar">
  100. <fileset dir="${src}" >
  101. <exclude name="/config/**" />
  102. <exclude name="**.cfg" />
  103. </fileset>
  104. </jar>
  105. </target>
  106. <target name="dist" depends="jarsrc">
  107. <copy todir="${build.dist.login}">
  108. <fileset dir="${src}">
  109. <include name="log.cfg" />
  110. <include name="banned_ip.cfg" />
  111. <include name="console.cfg" />
  112. </fileset>
  113. </copy>
  114. <copy todir="${build.dist.game}">
  115. <fileset dir="${src}">
  116. <include name="log.cfg" />
  117. <include name="console.cfg" />
  118. </fileset>
  119. </copy>
  120. <copy todir="${build.dist.libs}">
  121. <fileset dir="${src}/../lib">
  122. <include name="*.jar" />
  123. </fileset>
  124. </copy>
  125. <copy todir="${build.dist.languages}">
  126. <fileset dir="${src}/../languages" />
  127. </copy>
  128. <copy todir="${build.dist.images}">
  129. <fileset dir="${src}/../images" />
  130. </copy>
  131. <copy todir="${build.dist.doc}">
  132. <fileset dir="${basedir}">
  133. <include name="changes.txt" />
  134. <include name="LICENSE.txt" />
  135. <include name="README.txt" />
  136. </fileset>
  137. </copy>
  138. <copy todir="${build.dist.doc}">
  139. <fileset dir="${src}/../lib">
  140. <include name="*LICENSE*" />
  141. </fileset>
  142. </copy>
  143. <copy todir="${build.dist.login}">
  144. <fileset dir="dist">
  145. <include name="startAccountManager.*" />
  146. <include name="startSQLAccountManager.*" />
  147. <include name="LoginServer_loop.sh" />
  148. <include name="startLoginServer.*" />
  149. <include name="RegisterGameServer.*" />
  150. <include name="GSRegister.exe" />
  151. <include name="L2JConfig.exe" />
  152. <include name="L2JConfig.sh" />
  153. </fileset>
  154. </copy>
  155. <copy todir="${build.dist.game}">
  156. <fileset dir="dist">
  157. <include name="GameServer_loop.sh" />
  158. <include name="startGameServer.*" />
  159. <include name="L2JConfig.exe" />
  160. <include name="L2JConfig.sh" />
  161. <include name="hibernate.cfg.xml" />
  162. </fileset>
  163. </copy>
  164. <fixcrlf srcdir="${build.dist.game}" eol="lf" eof="remove" includes="**/*.sh" />
  165. <fixcrlf srcdir="${build.dist.login}" eol="lf" eof="remove" includes="**/*.sh" />
  166. <fixcrlf srcdir="${build.dist.game}" eol="crlf" eof="remove" includes="**/*.bat" />
  167. <fixcrlf srcdir="${build.dist.login}" eol="crlf" eof="remove" includes="**/*.bat" />
  168. <mkdir dir="${build.dist.game}/log" />
  169. <mkdir dir="${build.dist.login}/log" />
  170. <mkdir dir="${build.dist.game}/config" />
  171. <mkdir dir="${build.dist.login}/config" />
  172. <copy todir="${build.dist.game}/config">
  173. <fileset dir="java/config">
  174. <include name="*.properties" />
  175. <include name="*.xml" />
  176. <include name="*.xsd" />
  177. <include name="*.txt" />
  178. <exclude name="loginserver.properties" />
  179. </fileset>
  180. </copy>
  181. <copy todir="${build.dist.login}/config">
  182. <fileset dir="java/config">
  183. <include name="loginserver.properties" />
  184. <include name="mmo.properties" />
  185. <include name="telnet.properties" />
  186. </fileset>
  187. </copy>
  188. <mkdir dir="${build.dist.game}/data" />
  189. <copy todir="${build.dist.game}/data">
  190. <fileset dir="data">
  191. <include name="*.csv" />
  192. <include name="*.txt" />
  193. </fileset>
  194. </copy>
  195. <mkdir dir="${build.dist.game}/data/geodata" />
  196. <copy todir="${build.dist.game}/data/geodata">
  197. <fileset dir="data/geodata">
  198. <include name="*.txt" />
  199. <include name="*.l2j" />
  200. </fileset>
  201. </copy>
  202. <mkdir dir="${build.dist.game}/data/pathnode" />
  203. <copy todir="${build.dist.game}/data/pathnode">
  204. <fileset dir="data/pathnode">
  205. <include name="*.txt" />
  206. <include name="*.pn" />
  207. </fileset>
  208. </copy>
  209. <zip destfile="${build}/L2J_Server_BETA.zip" basedir="${build.dist}" />
  210. </target>
  211. <target name="version" depends="init" description="Create l2j-version.properties file">
  212. <tstamp>
  213. <format property="build.tstamp" pattern="yyyyMMdd_HHmm" />
  214. </tstamp>
  215. <exec dir="." executable="svnversion" outputproperty="l2j.revision" 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" description="Remove the output directories">
  235. <delete dir="${build}" />
  236. </target>
  237. </project>