build.xml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="L2J_DataPack_BETA" 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. </sync>
  52. <sync todir="${build.dist.cb}/data">
  53. <fileset dir="${basedir}/cb_data" />
  54. </sync>
  55. <sync todir="${build.dist.cb_sql}">
  56. <fileset dir="${basedir}/cb_sql" />
  57. </sync>
  58. <sync todir="${build.dist.sql}">
  59. <fileset dir="${basedir}/sql" />
  60. </sync>
  61. <sync todir="${build.dist.tools}">
  62. <fileset dir="${basedir}/tools" />
  63. </sync>
  64. <sync todir="${build.dist.lang}">
  65. <fileset dir="${basedir}/data/lang" />
  66. </sync>
  67. <sync todir="${build.dist.login}">
  68. <fileset dir="${build.dist.game}/data">
  69. <include name="servername.xml" />
  70. </fileset>
  71. </sync>
  72. </target>
  73. <target name="dist" depends="distclean" description="Creates a ZIP file. Suitable for distribution but building takes longer. See dist-deflate for faster builds.">
  74. <zip destfile="${build}/L2J_DataPack_BETA.zip" basedir="${build.dist}" update="true" />
  75. </target>
  76. <target name="dist-deflate" depends="distclean" description="Creates a datapack ZIP file with NO compression (bigger ZIP file but faster than regular dist target)">
  77. <zip destfile="${build}/L2J_DataPack_BETA-nocompress.zip" basedir="${build.dist}" update="true" compress="false" />
  78. </target>
  79. <target name="version" depends="init" description="Create l2jdp-version.properties file">
  80. <tstamp>
  81. <format property="build.tstamp" pattern="yyyyMMdd_HHmm" />
  82. </tstamp>
  83. <exec dir="." executable="svnversion" outputproperty="l2jdp.revision" failifexecutionfails="false">
  84. <arg line="-n ." />
  85. </exec>
  86. <concat destfile="${properties-file}">
  87. version=${l2jdp.revision}
  88. builddate=${build.tstamp}
  89. detailed info:
  90. </concat>
  91. <concat destfile="${properties-file}" append="true">
  92. <filelist dir="${src}/../.svn/" files="entries" />
  93. <filterchain>
  94. <prefixlines prefix=" " />
  95. <headfilter lines="8" skip="4" />
  96. <tokenfilter>
  97. <ignoreblank />
  98. </tokenfilter>
  99. </filterchain>
  100. </concat>
  101. </target>
  102. <target name="clean" description="Deletes the whole build space and existing packages.">
  103. <delete dir="${build}" />
  104. </target>
  105. <target name="distclean" depends="export" description="Deletes the datapack distribution ZIP file only, preserving synchronized build files.">
  106. <delete file="${build}/L2J_DataPack_BETA.zip" />
  107. <delete file="${build}/L2J_DataPack_BETA-nocompress.zip" />
  108. </target>
  109. </project>