2
0

build.xml 10 KB

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