build.xml 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="L2J_Server_BETA" default="build" 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="build" location="build" />
  20. <property name="build.bin" location="${build}/bin" />
  21. <property name="build.dist" location="${build}/dist" />
  22. <property name="build.dist.doc" location="${build.dist}/doc" />
  23. <property name="build.dist.game" location="${build.dist}/game" />
  24. <property name="build.dist.login" location="${build.dist}/login" />
  25. <property name="build.dist.tools" location="${build.dist}/tools" />
  26. <property name="libs" location="dist/libs" />
  27. <property name="src" location="java" />
  28. <path id="classpath">
  29. <fileset dir="${libs}">
  30. <include name="*.jar" />
  31. </fileset>
  32. </path>
  33. <pathconvert property="manifest.libs" pathsep=" ">
  34. <path refid="classpath" />
  35. <mapper>
  36. <chainedmapper>
  37. <flattenmapper />
  38. <globmapper from="*.jar" to="../libs/*.jar" />
  39. </chainedmapper>
  40. </mapper>
  41. </pathconvert>
  42. <target name="init" depends="checkRequirements,getChangelogDateVersion" description="Create the output directories.">
  43. <delete dir="${build.bin}" quiet="true" />
  44. <mkdir dir="${build.bin}" />
  45. </target>
  46. <target name="dist" depends="init" description="Export the files to the output directory.">
  47. <sync todir="${build.dist}" includeemptydirs="true">
  48. <fileset dir="dist" />
  49. </sync>
  50. <concat destfile="${build.dist.doc}/L2J_Server_CHANGELOG.txt">${l2j.changelog}</concat>
  51. <concat destfile="${build.dist.game}/config/l2j-version.properties">version=${l2j.version}${line.separator}builddate=${build.tstamp}</concat>
  52. </target>
  53. <target name="compile" depends="dist" description="Compile the source.">
  54. <javac srcdir="${src}" classpathref="classpath" destdir="${build.bin}" compiler="javac1.8" debug="true" debuglevel="lines,vars,source" includeantruntime="false" source="1.8" target="1.8" />
  55. </target>
  56. <target name="jar" depends="compile" description="Create the jar files.">
  57. <jar destfile="${build.dist.login}/l2jlogin.jar" level="9">
  58. <fileset dir="${build.bin}">
  59. <exclude name="**/dbinstaller/**" />
  60. <exclude name="**/gameserver/**" />
  61. </fileset>
  62. <manifest>
  63. <attribute name="Built-By" value="${user.name}" />
  64. <attribute name="Built-Date" value="${build.tstamp}" />
  65. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  66. </manifest>
  67. </jar>
  68. <jar destfile="${build.dist.login}/L2J_Configurator.jar" level="9">
  69. <fileset dir="${build.bin}">
  70. <include name="**/configurator/**" />
  71. <include name="**/i18n/**" />
  72. <include name="**/images/**" />
  73. <exclude name="**/accountmanager/**" />
  74. <exclude name="**/dbinstaller/**" />
  75. <exclude name="**/gameserver/**" />
  76. <exclude name="**/gsregistering/**" />
  77. <exclude name="**/log/**" />
  78. <exclude name="**/loginserver/**" />
  79. <exclude name="**/ngl/**" />
  80. <exclude name="**/status/**" />
  81. <exclude name="**/util/**" />
  82. <exclude name="**/Config/**" />
  83. <exclude name="**/L2DatabaseFactory/**" />
  84. <exclude name="**/Server/**" />
  85. </fileset>
  86. <manifest>
  87. <attribute name="Built-By" value="${user.name}" />
  88. <attribute name="Built-Date" value="${build.tstamp}" />
  89. <attribute name="Class-Path" value="${manifest.libs}" />
  90. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  91. <attribute name="Main-Class" value="com.l2jserver.tools.configurator.ConfigUserInterface" />
  92. </manifest>
  93. </jar>
  94. <jar destfile="${build.dist.game}/l2jserver.jar" level="9">
  95. <fileset dir="${build.bin}">
  96. <exclude name="**/dbinstaller/**" />
  97. <exclude name="**/loginserver/**" />
  98. <exclude name="**/accountmanager/**" />
  99. <exclude name="**/gsregistering/**" />
  100. </fileset>
  101. <manifest>
  102. <attribute name="Built-By" value="${user.name}" />
  103. <attribute name="Built-Date" value="${build.tstamp}" />
  104. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  105. </manifest>
  106. </jar>
  107. <jar destfile="${build.dist.game}/L2J_Configurator.jar" level="9">
  108. <fileset dir="${build.bin}">
  109. <include name="**/configurator/**" />
  110. <include name="**/i18n/**" />
  111. <include name="**/images/**" />
  112. <exclude name="**/accountmanager/**" />
  113. <exclude name="**/dbinstaller/**" />
  114. <exclude name="**/gameserver/**" />
  115. <exclude name="**/gsregistering/**" />
  116. <exclude name="**/log/**" />
  117. <exclude name="**/loginserver/**" />
  118. <exclude name="**/ngl/**" />
  119. <exclude name="**/status/**" />
  120. <exclude name="**/util/**" />
  121. <exclude name="**/Config/**" />
  122. <exclude name="**/L2DatabaseFactory/**" />
  123. <exclude name="**/Server/**" />
  124. </fileset>
  125. <manifest>
  126. <attribute name="Built-By" value="${user.name}" />
  127. <attribute name="Built-Date" value="${build.tstamp}" />
  128. <attribute name="Class-Path" value="${manifest.libs}" />
  129. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  130. <attribute name="Main-Class" value="com.l2jserver.tools.configurator.ConfigUserInterface" />
  131. </manifest>
  132. </jar>
  133. <jar destfile="${build.dist.tools}/dbinst_cs.jar" level="9">
  134. <fileset dir="${build.bin}">
  135. <include name="**/dbinstaller/**" />
  136. <include name="**/images/**" />
  137. <include name="**/util/**" />
  138. <include name="**/SQLFilter**" />
  139. <exclude name="**/LauncherGS*" />
  140. <exclude name="**/LauncherLS*" />
  141. </fileset>
  142. <manifest>
  143. <attribute name="Built-By" value="${user.name}" />
  144. <attribute name="Built-Date" value="${build.tstamp}" />
  145. <attribute name="Class-Path" value="${manifest.libs}" />
  146. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  147. <attribute name="Main-Class" value="com.l2jserver.tools.dbinstaller.LauncherCS" />
  148. </manifest>
  149. </jar>
  150. <jar destfile="${build.dist.tools}/dbinst_gs.jar" level="9">
  151. <fileset dir="${build.bin}">
  152. <include name="**/dbinstaller/**" />
  153. <include name="**/images/**" />
  154. <include name="**/util/**" />
  155. <include name="**/SQLFilter**" />
  156. <exclude name="**/LauncherCS*" />
  157. <exclude name="**/LauncherLS*" />
  158. </fileset>
  159. <manifest>
  160. <attribute name="Built-By" value="${user.name}" />
  161. <attribute name="Built-Date" value="${build.tstamp}" />
  162. <attribute name="Class-Path" value="${manifest.libs}" />
  163. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  164. <attribute name="Main-Class" value="com.l2jserver.tools.dbinstaller.LauncherGS" />
  165. </manifest>
  166. </jar>
  167. <jar destfile="${build.dist.tools}/dbinst_ls.jar" level="9">
  168. <fileset dir="${build.bin}">
  169. <include name="**/dbinstaller/**" />
  170. <include name="**/images/**" />
  171. <include name="**/util/**" />
  172. <include name="**/SQLFilter**" />
  173. <exclude name="**/LauncherCS*" />
  174. <exclude name="**/LauncherGS*" />
  175. </fileset>
  176. <manifest>
  177. <attribute name="Built-By" value="${user.name}" />
  178. <attribute name="Built-Date" value="${build.tstamp}" />
  179. <attribute name="Class-Path" value="${manifest.libs}" />
  180. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  181. <attribute name="Main-Class" value="com.l2jserver.tools.dbinstaller.LauncherLS" />
  182. </manifest>
  183. </jar>
  184. </target>
  185. <target name="build" depends="jar" description="Create the Zip file.">
  186. <zip destfile="${build}/L2J_Server_BETA.zip" basedir="${build.dist}" level="9" />
  187. </target>
  188. <target name="checkRequirements" description="Check Requirements.">
  189. <fail message="Ant 1.9.1 is required. But your version is ${ant.version} and if you are using Eclipse probably is outdated.">
  190. <condition>
  191. <not>
  192. <antversion atleast="1.9.1" />
  193. </not>
  194. </condition>
  195. </fail>
  196. <available classname="java.util.stream.Stream" property="JDK8.present" />
  197. <fail unless="JDK8.present" message="Java 1.8 is required. But your version is Java ${ant.java.version} and probably JDK is not installed." />
  198. </target>
  199. <target name="getChangelogDateVersion" description="Get Changelog, Date, Version.">
  200. <exec dir="${basedir}" executable="svn" outputproperty="l2j.changelog">
  201. <arg value="log" />
  202. <arg value="--stop-on-copy" />
  203. <arg value="--limit=50" />
  204. </exec>
  205. <tstamp>
  206. <format property="build.tstamp" pattern="dd/MM/yyyy HH:mm" />
  207. </tstamp>
  208. <exec dir="${basedir}" executable="svnversion" outputproperty="l2j.version">
  209. <arg value="-c" />
  210. <redirector>
  211. <outputfilterchain>
  212. <tokenfilter>
  213. <replaceregex pattern="[0-9]+\:" replace="" />
  214. </tokenfilter>
  215. </outputfilterchain>
  216. </redirector>
  217. </exec>
  218. </target>
  219. </project>