build.xml 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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.doc" location="${build.dist}/doc" />
  22. <property name="build.dist.game" location="${build.dist}/game" />
  23. <property name="build.dist.login" location="${build.dist}/login" />
  24. <target name="init" depends="clean,checkRequirements,getChangelogDateVersion" description="Create the output directories. Do nothing if dirs were already created">
  25. <mkdir dir="${build}" />
  26. </target>
  27. <target name="dist" depends="init" description="Syncronizes build space contents with project.">
  28. <sync todir="${build.dist}" includeemptydirs="true">
  29. <fileset dir="dist" />
  30. </sync>
  31. <concat destfile="${build.dist.doc}/L2J_DataPack_CHANGELOG.txt">${l2j.changelog}</concat>
  32. <concat destfile="${build.dist.game}/config/l2jdp-version.properties">version=${l2j.version}${line.separator}builddate=${build.tstamp}</concat>
  33. <copy todir="${build.dist.game}/data">
  34. <fileset dir="misc" />
  35. </copy>
  36. <copy todir="${build.dist.login}/data">
  37. <fileset dir="misc" />
  38. </copy>
  39. <zip destfile="${build}/L2J_DataPack_BETA.zip" basedir="${build.dist}" />
  40. </target>
  41. <target name="clean" description="Deletes the datapack distribution ZIP file only, preserving synchronized build files.">
  42. <delete file="${build}/L2J_DataPack_BETA.zip" />
  43. </target>
  44. <target name="checkRequirements" description="Check Requirements">
  45. <fail message="Ant 1.8.2 is required. But your version is ${ant.version}">
  46. <condition>
  47. <not>
  48. <antversion atleast="1.8.2" />
  49. </not>
  50. </condition>
  51. </fail>
  52. </target>
  53. <target name="getChangelogDateVersion" description="Get Changelog, Date, Version">
  54. <exec dir="." executable="svn" outputproperty="l2j.changelog">
  55. <arg value="log" />
  56. <arg value="--stop-on-copy" />
  57. </exec>
  58. <tstamp>
  59. <format property="build.tstamp" pattern="dd/MM/yyyy HH:mm" />
  60. </tstamp>
  61. <exec dir="." executable="svnversion" outputproperty="l2j.version" />
  62. </target>
  63. </project>