Advertisement
Guest User

Untitled

a guest
Apr 18th, 2015
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.74 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="L2JHellasC" default="Build" basedir=".">
  3. <description>
  4. This program is free software: you can redistribute it and/or modify it under
  5. the terms of the GNU General Public License as published by the Free Software
  6. Foundation, either version 3 of the License, or (at your option) any later
  7. version.
  8.  
  9. This program is distributed in the hope that it will be useful, but WITHOUT
  10. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  11. FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  12. details.
  13.  
  14. You should have received a copy of the GNU General Public License along with
  15. this program. If not, see http://www.gnu.org/licenses.
  16. </description>
  17.  
  18. <property name="src" location="java" />
  19. <property name="libs" location="libs" />
  20. <property name="build" location="../build/Core" />
  21. <property name="build.classes" location="${build}/classes" />
  22. <property name="build.dist" location="${build}/dist" />
  23. <property name="build.dist.doc" location="${build.dist}/doc" />
  24. <property name="build.dist.doc.3rdPartyLicenses" location="${build.dist}/doc/3rdPartyLicenses" />
  25. <property name="build.dist.login" location="${build.dist}/login" />
  26. <property name="build.dist.game" location="${build.dist}/gameserver" />
  27. <property name="build.dist.libs" location="${build.dist}/libs" />
  28.  
  29. <path id="classpath">
  30. <fileset dir="${libs}">
  31. <include name="*.jar" />
  32. </fileset>
  33. </path>
  34.  
  35. <echo>Building L2j Hellas.</echo>
  36. <target name="Building Dirs" depends="Clean" description="Create the output directories.">
  37. <mkdir dir="${build}" />
  38. <mkdir dir="${build.classes}" />
  39. <mkdir dir="${build.dist}" />
  40. <mkdir dir="${build.dist.doc}" />
  41. <mkdir dir="${build.dist.doc.3rdPartyLicenses}" />
  42. <mkdir dir="${build.dist.login}" />
  43. <mkdir dir="${build.dist.game}" />
  44. <mkdir dir="${build.dist.libs}" />
  45. </target>
  46.  
  47. <target name="Compile" depends="Requirements,Version" description="Compile the source.">
  48. <echo>Compiling L2J Hellas.</echo>
  49. <javac compiler="javac1.8" destdir="${build.classes}" optimize="on" encoding="utf-8" debug="true" debuglevel="lines,vars,source" source="1.8" target="1.8" nowarn="off" includeantruntime="true">
  50. <src path="${src}" />
  51. <classpath refid="classpath" />
  52. </javac>
  53. </target>
  54.  
  55. <target name="Jar" depends="Compile" description="Create the jar file">
  56. <jar destfile="${build}/l2jhellas.jar" level="9">
  57. <fileset dir="${build.classes}" />
  58. <manifest>
  59. <attribute name="Built-By" value="L2JHellas" />
  60. <attribute name="Built-Date" value="${build.tstamp}" />
  61. <attribute name="Implementation-URL" value="http://www.l2jhellas.info/" />
  62. <attribute name="Implementation-Version" value="${revision}" />
  63. <attribute name="Main-Class" value="com.l2jhellas.Server" />
  64. <attribute name="Class-Path" value=". BoneCP-0.7.1.jar bsf-2.4.0.jar bsh-2.0b4.jar bsh-engine.jar ecj-4.4.jar google-collect-1.0.jar java-engine-1.8.jar javolution.jar jna-3.5.1.jar mail.jar mmocore.jar mysql-connector-java-5.1.33-bin.jar slf4j-api-1.7.5.jar slf4j-simple-1.7.5.jar Subnet-1.0.jar worldwind.jar " />
  65. </manifest>
  66. </jar>
  67. <copy todir="${build.dist.libs}">
  68. <fileset dir="${build}">
  69. <include name="*.jar" />
  70. </fileset>
  71. </copy>
  72. </target>
  73.  
  74. <target name="dist" depends="Jar">
  75. <concat destfile="${build.dist}/L2JHellas_CHANGELOG.txt">${l2jhellas.changelog}</concat>
  76. </target>
  77.  
  78. <!-- Basic Build -->
  79. <target name="Build" depends="dist">
  80. <echo>Creating L2J Hellas Server:</echo>
  81. <copy todir="${build.dist.login}">
  82. <fileset dir="config">
  83. <include name="log.cfg" />
  84. <include name="BannedIPs.cfg" />
  85. <include name="console.cfg" />
  86. </fileset>
  87. </copy>
  88. <copy todir="${build.dist.game}">
  89. <fileset dir="config">
  90. <include name="log.cfg" />
  91. <include name="console.cfg" />
  92. </fileset>
  93. </copy>
  94. <copy todir="${build.dist.libs}">
  95. <fileset dir="${src}/../libs">
  96. <include name="*.jar" />
  97. </fileset>
  98. </copy>
  99. <copy todir="${build.dist.login}">
  100. <fileset dir="dist">
  101. <include name="startAccountManager.bat" />
  102. <include name="startSQLAccountManager.bat" />
  103. <include name="LoginServer_loop.bat" />
  104. <include name="startLoginServer.bat" />
  105. <include name="RegisterGameServer.bat" />
  106. </fileset>
  107. </copy>
  108. <copy todir="${build.dist.game}">
  109. <fileset dir="dist">
  110. <include name="startGameServer.bat" />
  111. </fileset>
  112. </copy>
  113. <copy todir="${build.dist.doc}">
  114. <fileset dir="doc">
  115. <include name="*.txt" />
  116. </fileset>
  117. </copy>
  118. <copy todir="${build.dist.doc.3rdPartyLicenses}">
  119. <fileset dir="doc/3rdPartyLicenses">
  120. <include name="*.txt" />
  121. </fileset>
  122. </copy>
  123.  
  124. <!-- Game Server -->
  125. <copy todir="${build.dist.game}/config">
  126. <fileset dir="config">
  127. <include name="Telnet.ini" />
  128. </fileset>
  129. </copy>
  130. <copy todir="${build.dist.login}/config">
  131. <fileset dir="config">
  132. <include name="Telnet.ini" />
  133. </fileset>
  134. </copy>
  135. <copy todir="${build.dist.game}/config/Admin">
  136. <fileset dir="config/Admin">
  137. <include name="*.ini" />
  138. </fileset>
  139. </copy>
  140. <copy todir="${build.dist.game}/config/Events">
  141. <fileset dir="config/Events">
  142. <include name="*.ini" />
  143. </fileset>
  144. </copy>
  145. <copy todir="${build.dist.game}/config/Main">
  146. <fileset dir="config/Main">
  147. <include name="*.ini" />
  148. </fileset>
  149. </copy>
  150. <copy todir="${build.dist.game}/config/Mods">
  151. <fileset dir="config/Mods">
  152. <include name="*.ini" />
  153. </fileset>
  154. </copy>
  155. <copy todir="${build.dist.game}/config/Network">
  156. <fileset dir="config/Network">
  157. <include name="*.ini" />
  158. <include name="*.xml" />
  159. <exclude name="LoginServer.ini" />
  160. </fileset>
  161. </copy>
  162. <copy todir="${build.dist.game}/config/Network/IPConfig">
  163. <fileset dir="config/Network/IPConfig">
  164. <include name="IPGameServer.ini" />
  165. </fileset>
  166. </copy>
  167. <copy todir="${build.dist.game}/config/Olympiad">
  168. <fileset dir="config/Olympiad">
  169. <include name="*.ini" />
  170. </fileset>
  171. </copy>
  172. <!-- Login server -->
  173. <copy todir="${build.dist.login}/config/Network">
  174. <fileset dir="config/Network">
  175. <include name="*.ini" />
  176. <include name="*.xml" />
  177. <exclude name="GameServer.ini" />
  178. </fileset>
  179. </copy>
  180. <copy todir="${build.dist.login}/config/Network/IPConfig">
  181. <fileset dir="config/Network/IPConfig">
  182. <include name="IPLoginServer.ini" />
  183. </fileset>
  184. </copy>
  185. <copy todir="${build.dist.game}/config/Others">
  186. <fileset dir="config/Others">
  187. <include name="*.*" />
  188. </fileset>
  189. </copy>
  190. <copy todir="${build.dist.login}/config/Others">
  191. <fileset dir="config/Others">
  192. <include name="*.cfg" />
  193. <include name="*.ini" />
  194. </fileset>
  195. </copy>
  196.  
  197. <!-- Finalizing -->
  198. <zip destfile="${build}/L2J_Hellas_Core_${revision}.zip" basedir="${build.dist}" level="9" />
  199. <mkdir dir="C:/L2JHellas" />
  200. <mkdir dir="C:/L2JHellas/Backup" />
  201. <echo>Store L2jhellas.</echo>
  202. <unzip src="${build}/L2J_Hellas_Core_${revision}.zip" dest="C:/L2JHellas" />
  203. <echo>Backup L2jhellas.</echo>
  204. <copy file="${build}/L2J_Hellas_Core_${revision}.zip" todir="C:/L2JHellas/Backup">
  205. </copy>
  206. <delete dir="${build}" />
  207. <echo>L2J Hellas Server version:${revision} stored in C:/L2JHellas.</echo>
  208. <echo>Please visit our forum http://l2jhellas.info/</echo>
  209. <echo>Owner Boorinio.</echo>
  210. </target>
  211.  
  212. <!-- Version -->
  213. <target name="Version" depends="Building Dirs" description="Get Changelog, Date, Version">
  214. <exec dir="${basedir}" executable="svn" outputproperty="l2jhellas.changelog">
  215. <arg value="log" />
  216. <arg value="--stop-on-copy" />
  217. </exec>
  218. <tstamp>
  219. <format property="build.tstamp" pattern="dd/MM/yyyy HH:mm" />
  220. </tstamp>
  221. <exec dir="." executable="svnversion" outputproperty="revision" failifexecutionfails="false">
  222. <arg value="-c" />
  223. <redirector>
  224. <outputfilterchain>
  225. <tokenfilter>
  226. <replaceregex pattern="[0-9]+\:" replace="" />
  227. </tokenfilter>
  228. </outputfilterchain>
  229. </redirector>
  230. </exec>
  231. <concat destfile="${build.dist.game}/config/Version/L2J Hellas Version.ini">
  232. L2jHellas Project details:
  233. ${line.separator}
  234. version = ${revision}
  235. ${line.separator}
  236. builddate = ${build.tstamp}
  237. ${line.separator}
  238. Forum = http://l2jhellas.info/
  239. ${line.separator}
  240. Svn = https://subversion.assembla.com/svn/l2hellas/trunk/
  241. ${line.separator}
  242. Timeline = https://www.assembla.com/code/l2hellas/subversion/changesets
  243. </concat>
  244. <concat destfile="${build.dist.login}/config/Version/L2J Hellas Version.ini">
  245. L2jHellas Project details:
  246. ${line.separator}
  247. version = ${revision}
  248. ${line.separator}
  249. builddate = ${build.tstamp}
  250. ${line.separator}
  251. Forum = http://l2jhellas.info/
  252. ${line.separator}
  253. Svn = https://subversion.assembla.com/svn/l2hellas/trunk/
  254. ${line.separator}
  255. Timeline = https://www.assembla.com/code/l2hellas/subversion/changesets
  256. </concat>
  257. <echo>version = ${revision}</echo>
  258. </target>
  259.  
  260. <!-- Requirements -->
  261. <target name="Requirements" description="Check Requirements.">
  262. <fail message="Ant 1.9.1 is required But your version is ${ant.version} and if you are using Eclipse probably is outdated.">
  263. <condition>
  264. <not>
  265. <antversion atleast="1.9.1" />
  266. </not>
  267. </condition>
  268. </fail>
  269. <available classname="java.util.stream.Stream" property="JDK8.present" />
  270. <fail unless="JDK8.present" message="Java 1.8 is required. But your version is Java ${ant.java.version} and probably JDK is not installed." />
  271. </target>
  272.  
  273. <!-- Clean UP -->
  274. <target name="Clean" description="Remove the build directories before the compile.">
  275. <delete dir="${build}" />
  276. </target>
  277. </project>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement