build.xml 7.4 KB

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