build.xml 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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" 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. </target>
  51. <target name="compile" depends="dist" description="Compile the source.">
  52. <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" />
  53. </target>
  54. <target name="jar" depends="compile" description="Create the jar files.">
  55. <jar destfile="${build.dist.login}/l2jlogin.jar" level="9">
  56. <fileset dir="${build.bin}">
  57. <exclude name="**/dbinstaller/**" />
  58. <exclude name="**/gameserver/**" />
  59. </fileset>
  60. <manifest>
  61. <attribute name="Built-By" value="${user.name}" />
  62. <attribute name="Built-Date" value="${build.tstamp}" />
  63. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  64. </manifest>
  65. </jar>
  66. <jar destfile="${build.dist.login}/L2J_Configurator.jar" level="9">
  67. <fileset dir="${build.bin}">
  68. <include name="**/configurator/**" />
  69. <include name="**/i18n/**" />
  70. <include name="**/images/**" />
  71. <exclude name="**/accountmanager/**" />
  72. <exclude name="**/dbinstaller/**" />
  73. <exclude name="**/gameserver/**" />
  74. <exclude name="**/gsregistering/**" />
  75. <exclude name="**/log/**" />
  76. <exclude name="**/loginserver/**" />
  77. <exclude name="**/ngl/**" />
  78. <exclude name="**/status/**" />
  79. <exclude name="**/util/**" />
  80. <exclude name="**/Config/**" />
  81. <exclude name="**/L2DatabaseFactory/**" />
  82. <exclude name="**/Server/**" />
  83. </fileset>
  84. <manifest>
  85. <attribute name="Built-By" value="${user.name}" />
  86. <attribute name="Built-Date" value="${build.tstamp}" />
  87. <attribute name="Class-Path" value="${manifest.libs}" />
  88. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  89. <attribute name="Main-Class" value="com.l2jserver.tools.configurator.ConfigUserInterface" />
  90. </manifest>
  91. </jar>
  92. <jar destfile="${build.dist.game}/l2jserver.jar" level="9">
  93. <fileset dir="${build.bin}">
  94. <exclude name="**/dbinstaller/**" />
  95. <exclude name="**/loginserver/**" />
  96. <exclude name="**/accountmanager/**" />
  97. <exclude name="**/gsregistering/**" />
  98. </fileset>
  99. <manifest>
  100. <attribute name="Built-By" value="${user.name}" />
  101. <attribute name="Built-Date" value="${build.tstamp}" />
  102. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  103. </manifest>
  104. </jar>
  105. <jar destfile="${build.dist.game}/L2J_Configurator.jar" level="9">
  106. <fileset dir="${build.bin}">
  107. <include name="**/configurator/**" />
  108. <include name="**/i18n/**" />
  109. <include name="**/images/**" />
  110. <exclude name="**/accountmanager/**" />
  111. <exclude name="**/dbinstaller/**" />
  112. <exclude name="**/gameserver/**" />
  113. <exclude name="**/gsregistering/**" />
  114. <exclude name="**/log/**" />
  115. <exclude name="**/loginserver/**" />
  116. <exclude name="**/ngl/**" />
  117. <exclude name="**/status/**" />
  118. <exclude name="**/util/**" />
  119. <exclude name="**/Config/**" />
  120. <exclude name="**/L2DatabaseFactory/**" />
  121. <exclude name="**/Server/**" />
  122. </fileset>
  123. <manifest>
  124. <attribute name="Built-By" value="${user.name}" />
  125. <attribute name="Built-Date" value="${build.tstamp}" />
  126. <attribute name="Class-Path" value="${manifest.libs}" />
  127. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  128. <attribute name="Main-Class" value="com.l2jserver.tools.configurator.ConfigUserInterface" />
  129. </manifest>
  130. </jar>
  131. <jar destfile="${build.dist.tools}/dbinst_cs.jar" level="9">
  132. <fileset dir="${build.bin}">
  133. <include name="**/dbinstaller/**" />
  134. <include name="**/images/**" />
  135. <include name="**/util/**" />
  136. <include name="**/SQLFilter**" />
  137. <exclude name="**/LauncherGS*" />
  138. <exclude name="**/LauncherLS*" />
  139. </fileset>
  140. <manifest>
  141. <attribute name="Built-By" value="${user.name}" />
  142. <attribute name="Built-Date" value="${build.tstamp}" />
  143. <attribute name="Class-Path" value="${manifest.libs}" />
  144. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  145. <attribute name="Main-Class" value="com.l2jserver.tools.dbinstaller.LauncherCS" />
  146. </manifest>
  147. </jar>
  148. <jar destfile="${build.dist.tools}/dbinst_gs.jar" level="9">
  149. <fileset dir="${build.bin}">
  150. <include name="**/dbinstaller/**" />
  151. <include name="**/images/**" />
  152. <include name="**/util/**" />
  153. <include name="**/SQLFilter**" />
  154. <exclude name="**/LauncherCS*" />
  155. <exclude name="**/LauncherLS*" />
  156. </fileset>
  157. <manifest>
  158. <attribute name="Built-By" value="${user.name}" />
  159. <attribute name="Built-Date" value="${build.tstamp}" />
  160. <attribute name="Class-Path" value="${manifest.libs}" />
  161. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  162. <attribute name="Main-Class" value="com.l2jserver.tools.dbinstaller.LauncherGS" />
  163. </manifest>
  164. </jar>
  165. <jar destfile="${build.dist.tools}/dbinst_ls.jar" level="9">
  166. <fileset dir="${build.bin}">
  167. <include name="**/dbinstaller/**" />
  168. <include name="**/images/**" />
  169. <include name="**/util/**" />
  170. <include name="**/SQLFilter**" />
  171. <exclude name="**/LauncherCS*" />
  172. <exclude name="**/LauncherGS*" />
  173. </fileset>
  174. <manifest>
  175. <attribute name="Built-By" value="${user.name}" />
  176. <attribute name="Built-Date" value="${build.tstamp}" />
  177. <attribute name="Class-Path" value="${manifest.libs}" />
  178. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  179. <attribute name="Main-Class" value="com.l2jserver.tools.dbinstaller.LauncherLS" />
  180. </manifest>
  181. </jar>
  182. </target>
  183. <target name="build" depends="jar" description="Create the Zip file.">
  184. <zip destfile="${build}/L2J_Server_BETA.zip" basedir="${build.dist}" level="9" />
  185. </target>
  186. <target name="checkRequirements" description="Check Requirements.">
  187. <fail message="Ant 1.9.1 is required. But your version is ${ant.version} and if you are using Eclipse probably is outdated.">
  188. <condition>
  189. <not>
  190. <antversion atleast="1.9.1" />
  191. </not>
  192. </condition>
  193. </fail>
  194. <available classname="java.util.stream.Stream" property="JDK8.present" />
  195. <fail unless="JDK8.present" message="Java 1.8 is required. But your version is Java ${ant.java.version} and probably JDK is not installed." />
  196. </target>
  197. </project>