2
0

build.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="L2J_Server" default="dist" 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="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. <path id="classpath">
  29. <fileset dir="${lib}">
  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="clean,checkRequirements" description="Create the output directories.">
  43. <mkdir dir="${build}" />
  44. <mkdir dir="${build.classes}" />
  45. </target>
  46. <target name="compile" depends="init" description="Compile the source.">
  47. <javac destdir="${build.classes}" compiler="javac1.8" debug="true" debuglevel="lines,vars,source" includeantruntime="false" source="1.8" target="1.8">
  48. <src path="${src}" />
  49. <classpath refid="classpath" />
  50. </javac>
  51. </target>
  52. <target name="jar" depends="compile" description="Create the jar files">
  53. <jar destfile="${build.dist.login}/l2jlogin.jar">
  54. <fileset dir="${build.classes}">
  55. <exclude name="**/gameserver/**" />
  56. </fileset>
  57. <manifest>
  58. <attribute name="Built-By" value="${user.name}" />
  59. <attribute name="Built-Date" value="${build.tstamp}" />
  60. <attribute name="Class-Path" value="${manifest.libs}" />
  61. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  62. <attribute name="Implementation-Version" value="${l2j.version}" />
  63. <attribute name="Main-Class" value="com.l2jserver.loginserver.L2LoginServer" />
  64. </manifest>
  65. </jar>
  66. <jar destfile="${build.dist.game}/l2jserver.jar">
  67. <fileset dir="${build.classes}">
  68. <exclude name="**/loginserver/**" />
  69. <exclude name="**/accountmanager/**" />
  70. <exclude name="**/gsregistering/**" />
  71. </fileset>
  72. <manifest>
  73. <attribute name="Built-By" value="${user.name}" />
  74. <attribute name="Built-Date" value="${build.tstamp}" />
  75. <attribute name="Class-Path" value="${manifest.libs}" />
  76. <attribute name="Implementation-URL" value="http://www.l2jserver.com/" />
  77. <attribute name="Implementation-Version" value="${l2j.version}" />
  78. <attribute name="Main-Class" value="com.l2jserver.gameserver.GameServer" />
  79. </manifest>
  80. </jar>
  81. </target>
  82. <target name="dist" depends="jar">
  83. <copy todir="${build.dist}">
  84. <fileset dir="dist" />
  85. </copy>
  86. <concat destfile="${build.dist.doc}/L2J_Server_CHANGELOG.txt">${l2j.changelog}</concat>
  87. <copy todir="${build.dist.game}">
  88. <fileset dir="misc" />
  89. </copy>
  90. <concat destfile="${build.dist.game}/config/l2j-version.properties">version=${l2j.version}${line.separator}builddate=${build.tstamp}</concat>
  91. <copy todir="${build.dist.libs}">
  92. <fileset dir="lib" />
  93. </copy>
  94. <copy todir="${build.dist.login}">
  95. <fileset dir="misc" />
  96. </copy>
  97. <fixcrlf srcdir="${build.dist.game}" eol="crlf" eof="remove" includes="**/*.bat" />
  98. <fixcrlf srcdir="${build.dist.game}" eol="lf" eof="remove" includes="**/*.sh" />
  99. <fixcrlf srcdir="${build.dist.login}" eol="crlf" eof="remove" includes="**/*.bat" />
  100. <fixcrlf srcdir="${build.dist.login}" eol="lf" eof="remove" includes="**/*.sh" />
  101. <tstamp>
  102. <format property="build.date" pattern="yyyy-MM-dd" />
  103. </tstamp>
  104. <zip destfile="${build}/L2J_Server_${build.date}.zip" basedir="${build.dist}" />
  105. </target>
  106. <target name="clean" description="Remove the output directories">
  107. <delete dir="${build}" />
  108. </target>
  109. <target name="checkRequirements" description="Check Requirements">
  110. <fail message="Ant 1.8.2 is required. But your version is ${ant.version}">
  111. <condition>
  112. <not>
  113. <antversion atleast="1.8.2" />
  114. </not>
  115. </condition>
  116. </fail>
  117. <available classname="java.util.stream.Stream" property="JDK8.present" />
  118. <fail unless="JDK8.present" message="Java 1.8 is required. But your version is Java ${ant.java.version} and probably JDK is not installed." />
  119. </target>
  120. </project>