build.xml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="L2J_Datapack" default="dist" basedir=".">
  3. <description>
  4. This script will build the L2J_Datapack.
  5. $Author: DrLecter $
  6. $Date: 2007-11-19 16:57:12 -0300 (mo, 19 nov 2007) $
  7. $Revision: 3627 $
  8. This program is free software; you can redistribute it and/or modify
  9. it under the terms of the GNU General Public License as published by
  10. the Free Software Foundation; either version 2, or (at your option)
  11. any later version.
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. GNU General Public License for more details.
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  19. 02111-1307, USA.
  20. http://www.gnu.org/copyleft/gpl.html
  21. </description>
  22. <property name="build" location="build"/>
  23. <property name="build.dist" location="${build}/dist"/>
  24. <property name="build.dist.game" location="${build.dist}/gameserver"/>
  25. <property name="build.dist.login" location="${build.dist}/login"/>
  26. <property name="build.dist.sql" location="${build.dist}/sql"/>
  27. <property name="build.dist.tools" location="${build.dist}/tools"/>
  28. <property name="build.dist.doc" location="${build.dist}/doc"/>
  29. <property name="properties-file" location="${build.dist.game}/config/l2jdp-version.properties"/>
  30. <target name="init"
  31. description="Create the output directories. Do nothing if dirs were already created">
  32. <mkdir dir="${build}"/>
  33. <mkdir dir="${build.dist}"/>
  34. <mkdir dir="${build.dist.game}"/>
  35. <mkdir dir="${build.dist.doc}" />
  36. <mkdir dir="${build.dist.login}" />
  37. </target>
  38. <target name="export"
  39. depends="version"
  40. description="Syncronizes build space contents with project.">
  41. <sync todir="${build.dist.doc}">
  42. <fileset dir="${basedir}">
  43. <include name="gpl.txt"/>
  44. <include name="readme-dp.txt"/>
  45. </fileset>
  46. </sync>
  47. <sync todir="${build.dist.game}/data">
  48. <fileset dir="${basedir}/data">
  49. <exclude name=".project"/>
  50. <exclude name="log/**"/>
  51. <exclude name="cachedir/**"/>
  52. <exclude name="clans/**"/>
  53. <exclude name="crests/**"/>
  54. <exclude name="**.svn**"/>
  55. <exclude name="**/*.class"/>
  56. <exclude name="**/*.jar"/>
  57. <exclude name="geodata/**"/>
  58. <exclude name="pathnode/**"/>
  59. <include name="**/*.*"/>
  60. </fileset>
  61. </sync>
  62. <sync todir="${build.dist.sql}">
  63. <fileset dir="${basedir}/sql">
  64. <include name="*.*"/>
  65. <include name="experimental/*.*"/>
  66. <include name="custom/*.*"/>
  67. <include name="maintenance/*.*"/>
  68. <include name="mods/*.*"/>
  69. <include name="updates/*.*"/>
  70. </fileset>
  71. </sync>
  72. <sync todir="${build.dist.tools}">
  73. <fileset dir="${basedir}/tools">
  74. <include name="*.*"/>
  75. <exclude name="database_installer.rc"/>
  76. <exclude name="*.txt"/>
  77. <exclude name="*.log"/>
  78. <exclude name="*backup.sql"/>
  79. </fileset>
  80. </sync>
  81. <sync todir="${build.dist.login}">
  82. <fileset dir="${build.dist.game}/data">
  83. <include name="servername.xml"/>
  84. </fileset>
  85. </sync>
  86. </target>
  87. <target name="dist"
  88. depends="export"
  89. description="Creates a ZIP file. Suitable for distribution but building takes longer. See dist-deflate for faster builds.">
  90. <zip destfile="${build}/L2J_DataPack.zip" basedir="${build.dist}" update="true"/>
  91. </target>
  92. <target name="dist-deflate"
  93. depends="export"
  94. description="Creates a datapack ZIP file with NO compression (bigger ZIP file but faster than regular dist target)">
  95. <zip destfile="${build}/L2J_DataPack-nocompress.zip" basedir="${build.dist}" update="true" compress="false"/>
  96. </target>
  97. <target name="version"
  98. depends="init"
  99. description="Create l2jdp-version.properties file">
  100. <tstamp>
  101. <format property="build.tstamp" pattern="yyyyMMdd_HHmm"/>
  102. </tstamp>
  103. <exec dir="." executable="svnversion" outputproperty="l2jdp.revision"
  104. failifexecutionfails="false">
  105. <arg line="-n ."/>
  106. </exec>
  107. <concat destfile="${properties-file}">
  108. version=${l2jdp.revision}
  109. builddate=${build.tstamp}
  110. detailed info:
  111. </concat>
  112. <concat destfile="${properties-file}" append="true">
  113. <filelist dir="${src}/../.svn/" files="entries"/>
  114. <filterchain>
  115. <prefixlines prefix=" "/>
  116. <headfilter lines="8" skip="4"/>
  117. <tokenfilter>
  118. <ignoreblank/>
  119. </tokenfilter>
  120. </filterchain>
  121. </concat>
  122. </target>
  123. <target name="clean"
  124. description="Deletes the whole build space and existing packages.">
  125. <delete dir="${build}"/>
  126. </target>
  127. <target name="distclean"
  128. description="Deletes the datapack distribution ZIP file only, preserving synchronized build files.">
  129. <delete file="${build}/L2J_DataPack.zip"/>
  130. <delete file="${build}/L2J_DataPack-nocompress.zip"/>
  131. </target>
  132. </project>