build.xml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  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="src" location="java" />
  20. <property name="lib" location="dist/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}/game" />
  26. <property name="build.dist.libs" location="${build.dist}/libs" />
  27. <property name="build.dist.login" location="${build.dist}/login" />
  28. <property name="build.dist.tools" location="${build.dist}/tools" />
  29. <path id="classpath">
  30. <fileset dir="${lib}">
  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="init" depends="checkRequirements,getChangelogDateVersion" description="Create the output directories.">
  44. <mkdir dir="${build}" />
  45. <mkdir dir="${build.classes}" />
  46. </target>
  47. <target name="dist" depends="init">
  48. <sync todir="${build.dist}">
  49. <fileset dir="dist" />
  50. </sync>
  51. <concat destfile="${build.dist.doc}/L2J_Server_CHANGELOG.txt">${l2j.changelog}</concat>
  52. <copy todir="${build.dist.game}">
  53. <fileset dir="misc" />
  54. </copy>
  55. <concat destfile="${build.dist.game}/config/l2j-version.properties">version=${l2j.version}${line.separator}builddate=${build.tstamp}</concat>
  56. <copy todir="${build.dist.login}">
  57. <fileset dir="misc" />
  58. </copy>
  59. </target>
  60. <target name="compile" depends="dist" description="Compile the source.">
  61. <javac srcdir="${src}" classpathref="classpath" destdir="${build.classes}" compiler="javac1.7" debug="true" debuglevel="lines,vars,source" includeantruntime="false" source="1.7" target="1.7" />
  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="Class-Path" value="${manifest.libs}" />
  73. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  74. <attribute name="Implementation-Version" value="${l2j.version}" />
  75. <attribute name="Main-Class" value="com.l2jserver.loginserver.L2LoginServer" />
  76. </manifest>
  77. </jar>
  78. <jar destfile="${build.dist.game}/l2jserver.jar">
  79. <fileset dir="${build.classes}">
  80. <exclude name="**/dbinstaller/**" />
  81. <exclude name="**/loginserver/**" />
  82. <exclude name="**/accountmanager/**" />
  83. <exclude name="**/gsregistering/**" />
  84. </fileset>
  85. <manifest>
  86. <attribute name="Built-By" value="${user.name}" />
  87. <attribute name="Built-Date" value="${build.tstamp}" />
  88. <attribute name="Class-Path" value="${manifest.libs}" />
  89. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  90. <attribute name="Implementation-Version" value="${l2j.version}" />
  91. <attribute name="Main-Class" value="com.l2jserver.gameserver.GameServer" />
  92. </manifest>
  93. </jar>
  94. <jar destfile="${build.dist.tools}/dbinst_cs.jar">
  95. <fileset dir="${build.classes}">
  96. <include name="**/dbinstaller/**" />
  97. <include name="**/images/**" />
  98. <include name="**/util/swing/**" />
  99. <exclude name="**/LauncherGS*" />
  100. <exclude name="**/LauncherLS*" />
  101. </fileset>
  102. <manifest>
  103. <attribute name="Built-By" value="${user.name}" />
  104. <attribute name="Built-Date" value="${build.tstamp}" />
  105. <attribute name="Class-Path" value="${manifest.libs}" />
  106. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  107. <attribute name="Implementation-Version" value="${l2j.version}" />
  108. <attribute name="Main-Class" value="com.l2jserver.tools.dbinstaller.LauncherCS" />
  109. </manifest>
  110. </jar>
  111. <jar destfile="${build.dist.tools}/dbinst_gs.jar">
  112. <fileset dir="${build.classes}">
  113. <include name="**/dbinstaller/**" />
  114. <include name="**/images/**" />
  115. <include name="**/util/swing/**" />
  116. <exclude name="**/LauncherCS*" />
  117. <exclude name="**/LauncherLS*" />
  118. </fileset>
  119. <manifest>
  120. <attribute name="Built-By" value="${user.name}" />
  121. <attribute name="Built-Date" value="${build.tstamp}" />
  122. <attribute name="Class-Path" value="${manifest.libs}" />
  123. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  124. <attribute name="Implementation-Version" value="${l2j.version}" />
  125. <attribute name="Main-Class" value="com.l2jserver.tools.dbinstaller.LauncherGS" />
  126. </manifest>
  127. </jar>
  128. <jar destfile="${build.dist.tools}/dbinst_ls.jar">
  129. <fileset dir="${build.classes}">
  130. <include name="**/dbinstaller/**" />
  131. <include name="**/images/**" />
  132. <include name="**/util/swing/**" />
  133. <exclude name="**/LauncherCS*" />
  134. <exclude name="**/LauncherGS*" />
  135. </fileset>
  136. <manifest>
  137. <attribute name="Built-By" value="${user.name}" />
  138. <attribute name="Built-Date" value="${build.tstamp}" />
  139. <attribute name="Class-Path" value="${manifest.libs}" />
  140. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  141. <attribute name="Implementation-Version" value="${l2j.version}" />
  142. <attribute name="Main-Class" value="com.l2jserver.tools.dbinstaller.LauncherLS" />
  143. </manifest>
  144. </jar>
  145. </target>
  146. <target name="build" depends="jar">
  147. <zip destfile="${build}/L2J_Server_BETA.zip" basedir="${build.dist}" level="9" update="true" />
  148. </target>
  149. <target name="checkRequirements" description="Check Requirements">
  150. <fail message="Ant 1.8.2 is required. But your version is ${ant.version}">
  151. <condition>
  152. <not>
  153. <antversion atleast="1.8.2" />
  154. </not>
  155. </condition>
  156. </fail>
  157. <available classname="java.lang.AutoCloseable" property="JDK7.present" />
  158. <fail unless="JDK7.present" message="Java 1.7 is required. But your version is Java ${ant.java.version} and probably JDK is not installed." />
  159. </target>
  160. <target name="getChangelogDateVersion" description="Get Changelog, Date, Version">
  161. <exec dir="." executable="svn" outputproperty="l2j.changelog">
  162. <arg value="log" />
  163. <arg value="--stop-on-copy" />
  164. </exec>
  165. <tstamp>
  166. <format property="build.tstamp" pattern="dd/MM/yyyy HH:mm" />
  167. </tstamp>
  168. <exec dir="." executable="svnversion" outputproperty="l2j.version" />
  169. </target>
  170. </project>