build.xml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="L2J_Server" default="build" basedir=".">
  3. <description>
  4. Copyright (C) 2004-2015 L2J Server
  5. This script will build the L2J Server.
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 3, or (at your option)
  9. any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  17. 02111-1307, USA.
  18. http://www.gnu.org/copyleft/gpl.html
  19. </description>
  20. <property name="build" location="build" />
  21. <property name="build.bin" location="${build}/bin" />
  22. <property name="build.dist" location="${build}/dist" />
  23. <property name="build.dist.doc" location="${build.dist}/doc" />
  24. <property name="build.dist.game" location="${build.dist}/game" />
  25. <property name="build.dist.login" location="${build.dist}/login" />
  26. <property name="build.dist.tools" location="${build.dist}/tools" />
  27. <property name="libs" location="dist/libs" />
  28. <property name="src" location="java" />
  29. <path id="classpath">
  30. <fileset dir="${libs}">
  31. <include name="*.jar" />
  32. </fileset>
  33. </path>
  34. <pathconvert property="manifest.libs" pathsep=" ">
  35. <path refid="classpath" />
  36. <mapper>
  37. <chainedmapper>
  38. <flattenmapper />
  39. <globmapper from="*.jar" to="../libs/*.jar" />
  40. </chainedmapper>
  41. </mapper>
  42. </pathconvert>
  43. <target name="checkRequirements" description="Check Requirements.">
  44. <fail message="Ant 1.8.2 is required. But your version is ${ant.version} and if you are using Eclipse probably is outdated.">
  45. <condition>
  46. <not>
  47. <antversion atleast="1.8.2" />
  48. </not>
  49. </condition>
  50. </fail>
  51. <available classname="java.util.stream.Stream" property="JDK8.present" />
  52. <fail unless="JDK8.present" message="Java 1.8 is required. But your version is Java ${ant.java.version} and probably JDK is not installed." />
  53. </target>
  54. <target name="init" depends="checkRequirements" description="Create the output directories.">
  55. <delete dir="${build.bin}" quiet="true" />
  56. <mkdir dir="${build.bin}" />
  57. </target>
  58. <target name="dist" depends="init" description="Export the files to the output directory.">
  59. <sync todir="${build.dist}" includeemptydirs="true">
  60. <fileset dir="dist" />
  61. </sync>
  62. </target>
  63. <target name="compile" depends="dist" description="Compile the source.">
  64. <javac srcdir="${src}" classpathref="classpath" destdir="${build.bin}" compiler="modern" debug="true" debuglevel="lines,vars,source" includeantruntime="false" source="1.8" target="1.8" />
  65. </target>
  66. <target name="jar" depends="compile" description="Create the jar files.">
  67. <tstamp>
  68. <format property="time.stamp" pattern="yyyy-MM-dd HH:mm:ss" />
  69. </tstamp>
  70. <jar destfile="${build.dist.login}/l2jlogin.jar" level="9">
  71. <fileset dir="${build.bin}">
  72. <exclude name="**/dbinstaller/**" />
  73. <exclude name="**/gameserver/**" />
  74. </fileset>
  75. <manifest>
  76. <attribute name="Built-By" value="${user.name}" />
  77. <attribute name="Built-Date" value="${time.stamp}" />
  78. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  79. <attribute name="Class-Path" value="../libs/c3p0-0.9.5.jar ../libs/javolution-5.5.1.jar ../libs/mail-1.5.2.jar ../libs/mmocore.jar ../libs/mysql-connector-java-5.1.34-bin.jar ../libs/weupnp-0.1.3.jar" />
  80. <attribute name="Main-Class" value="com.l2jserver.loginserver.L2LoginServer" />
  81. </manifest>
  82. </jar>
  83. <jar destfile="${build.dist.login}/L2J_Configurator.jar" level="9">
  84. <fileset dir="${build.bin}">
  85. <include name="**/configurator/**" />
  86. <include name="**/i18n/**" />
  87. <include name="**/images/**" />
  88. <exclude name="**/accountmanager/**" />
  89. <exclude name="**/dbinstaller/**" />
  90. <exclude name="**/gameserver/**" />
  91. <exclude name="**/gsregistering/**" />
  92. <exclude name="**/log/**" />
  93. <exclude name="**/loginserver/**" />
  94. <exclude name="**/status/**" />
  95. <exclude name="**/util/**" />
  96. <exclude name="**/Config/**" />
  97. <exclude name="**/L2DatabaseFactory/**" />
  98. <exclude name="**/Server/**" />
  99. </fileset>
  100. <manifest>
  101. <attribute name="Built-By" value="${user.name}" />
  102. <attribute name="Built-Date" value="${time.stamp}" />
  103. <attribute name="Class-Path" value="${manifest.libs}" />
  104. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  105. <attribute name="Main-Class" value="com.l2jserver.tools.configurator.ConfigUserInterface" />
  106. </manifest>
  107. </jar>
  108. <jar destfile="${build.dist.game}/l2jserver.jar" level="9">
  109. <fileset dir="${build.bin}">
  110. <exclude name="**/dbinstaller/**" />
  111. <exclude name="**/loginserver/**" />
  112. <exclude name="**/accountmanager/**" />
  113. <exclude name="**/gsregistering/**" />
  114. </fileset>
  115. <manifest>
  116. <attribute name="Built-By" value="${user.name}" />
  117. <attribute name="Built-Date" value="${time.stamp}" />
  118. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  119. <attribute name="Class-Path" value="${manifest.libs}" />
  120. <attribute name="Main-Class" value="com.l2jserver.gameserver.GameServer" />
  121. </manifest>
  122. </jar>
  123. <jar destfile="${build.dist.game}/L2J_Configurator.jar" level="9">
  124. <fileset dir="${build.bin}">
  125. <include name="**/configurator/**" />
  126. <include name="**/i18n/**" />
  127. <include name="**/images/**" />
  128. <exclude name="**/accountmanager/**" />
  129. <exclude name="**/dbinstaller/**" />
  130. <exclude name="**/gameserver/**" />
  131. <exclude name="**/gsregistering/**" />
  132. <exclude name="**/log/**" />
  133. <exclude name="**/loginserver/**" />
  134. <exclude name="**/status/**" />
  135. <exclude name="**/util/**" />
  136. <exclude name="**/Config/**" />
  137. <exclude name="**/L2DatabaseFactory/**" />
  138. <exclude name="**/Server/**" />
  139. </fileset>
  140. <manifest>
  141. <attribute name="Built-By" value="${user.name}" />
  142. <attribute name="Built-Date" value="${time.stamp}" />
  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.configurator.ConfigUserInterface" />
  146. </manifest>
  147. </jar>
  148. <jar destfile="${build.dist.tools}/Database_Installer_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="**/LauncherLS*" />
  155. </fileset>
  156. <manifest>
  157. <attribute name="Built-By" value="${user.name}" />
  158. <attribute name="Built-Date" value="${time.stamp}" />
  159. <attribute name="Class-Path" value="${manifest.libs}" />
  160. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  161. <attribute name="Main-Class" value="com.l2jserver.tools.dbinstaller.LauncherGS" />
  162. </manifest>
  163. </jar>
  164. <jar destfile="${build.dist.tools}/Database_Installer_LS.jar" level="9">
  165. <fileset dir="${build.bin}">
  166. <include name="**/dbinstaller/**" />
  167. <include name="**/images/**" />
  168. <include name="**/util/**" />
  169. <include name="**/SQLFilter**" />
  170. <exclude name="**/LauncherGS*" />
  171. </fileset>
  172. <manifest>
  173. <attribute name="Built-By" value="${user.name}" />
  174. <attribute name="Built-Date" value="${time.stamp}" />
  175. <attribute name="Class-Path" value="${manifest.libs}" />
  176. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  177. <attribute name="Main-Class" value="com.l2jserver.tools.dbinstaller.LauncherLS" />
  178. </manifest>
  179. </jar>
  180. </target>
  181. <target name="build" depends="jar" description="Create the Zip file.">
  182. <tstamp>
  183. <format property="build.date" pattern="yyyy-MM-dd"/>
  184. </tstamp>
  185. <zip destfile="${build}/L2J_Server_${build.date}.zip" basedir="${build.dist}" level="9" />
  186. </target>
  187. </project>