2
0

build.xml 8.5 KB

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