build.xml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. 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="build" location="build" />
  20. <property name="build.dist" location="${build}/dist" />
  21. <property name="build.dist.game" location="${build.dist}/gameserver" />
  22. <property name="build.dist.lang" location="${build.dist}/languages" />
  23. <property name="build.dist.login" location="${build.dist}/login" />
  24. <property name="build.dist.cb" location="${build.dist}/community" />
  25. <property name="build.dist.sql" location="${build.dist}/sql" />
  26. <property name="build.dist.cb_sql" location="${build.dist}/cb_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" description="Create the output directories. Do nothing if dirs were already created">
  31. <mkdir dir="${build}" />
  32. <mkdir dir="${build.dist}" />
  33. <mkdir dir="${build.dist.cb}" />
  34. <mkdir dir="${build.dist.cb_sql}" />
  35. <mkdir dir="${build.dist.game}" />
  36. <mkdir dir="${build.dist.doc}" />
  37. <mkdir dir="${build.dist.lang}" />
  38. <mkdir dir="${build.dist.login}" />
  39. <mkdir dir="${build.dist.sql}" />
  40. <mkdir dir="${build.dist.tools}" />
  41. </target>
  42. <target name="export" depends="version" description="Syncronizes build space contents with project.">
  43. <sync todir="${build.dist.doc}">
  44. <fileset dir="${basedir}">
  45. <include name="gpl.txt" />
  46. <include name="readme-dp.txt" />
  47. </fileset>
  48. </sync>
  49. <sync todir="${build.dist.game}/data" includeemptydirs="true">
  50. <fileset dir="${basedir}/data">
  51. <exclude name=".project" />
  52. <exclude name="log/**" />
  53. <exclude name="cachedir/**" />
  54. <exclude name="clans/**" />
  55. <exclude name="crests/**" />
  56. <exclude name="**.svn**" />
  57. <exclude name="**/*.class" />
  58. <exclude name="**/*.jar" />
  59. <exclude name="geodata/**" />
  60. <exclude name="pathnode/**" />
  61. </fileset>
  62. </sync>
  63. <sync todir="${build.dist.cb}/data">
  64. <fileset dir="${basedir}/cb_data" />
  65. </sync>
  66. <sync todir="${build.dist.cb_sql}">
  67. <fileset dir="${basedir}/cb_sql" />
  68. </sync>
  69. <sync todir="${build.dist.sql}">
  70. <fileset dir="${basedir}/sql" />
  71. </sync>
  72. <sync todir="${build.dist.tools}">
  73. <fileset dir="${basedir}/tools">
  74. <exclude name="database_installer.rc" />
  75. <exclude name="*.txt" />
  76. <exclude name="*.log" />
  77. <exclude name="*backup.sql" />
  78. </fileset>
  79. </sync>
  80. <sync todir="${build.dist.lang}">
  81. <fileset dir="${basedir}/data/lang" />
  82. </sync>
  83. <sync todir="${build.dist.login}">
  84. <fileset dir="${build.dist.game}/data">
  85. <include name="servername.xml" />
  86. </fileset>
  87. </sync>
  88. </target>
  89. <target name="dist" depends="distclean" 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" depends="distclean" description="Creates a datapack ZIP file with NO compression (bigger ZIP file but faster than regular dist target)">
  93. <zip destfile="${build}/L2J_DataPack-nocompress.zip" basedir="${build.dist}" update="true" compress="false" />
  94. </target>
  95. <target name="version" depends="init" description="Create l2jdp-version.properties file">
  96. <tstamp>
  97. <format property="build.tstamp" pattern="yyyyMMdd_HHmm" />
  98. </tstamp>
  99. <exec dir="." executable="svnversion" outputproperty="l2jdp.revision" failifexecutionfails="false">
  100. <arg line="-n ." />
  101. </exec>
  102. <concat destfile="${properties-file}">
  103. version=${l2jdp.revision}
  104. builddate=${build.tstamp}
  105. detailed info:
  106. </concat>
  107. <concat destfile="${properties-file}" append="true">
  108. <filelist dir="${src}/../.svn/" files="entries" />
  109. <filterchain>
  110. <prefixlines prefix=" " />
  111. <headfilter lines="8" skip="4" />
  112. <tokenfilter>
  113. <ignoreblank />
  114. </tokenfilter>
  115. </filterchain>
  116. </concat>
  117. </target>
  118. <target name="clean" description="Deletes the whole build space and existing packages.">
  119. <delete dir="${build}" />
  120. </target>
  121. <target name="distclean" depends="export" description="Deletes the datapack distribution ZIP file only, preserving synchronized build files.">
  122. <delete file="${build}/L2J_DataPack.zip" />
  123. <delete file="${build}/L2J_DataPack-nocompress.zip" />
  124. </target>
  125. </project>