build.xml 7.3 KB

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