build.xml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="L2J_DataPack_BETA" default="build" basedir=".">
  3. <description>
  4. Copyright (C) 2004-2013 L2J DataPack
  5. This file is part of L2J DataPack.
  6. L2J DataPack is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. L2J DataPack is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program. If not, see "http://www.gnu.org/licenses/".
  16. </description>
  17. <property name="build" location="build" />
  18. <property name="build.dist" location="${build}/dist" />
  19. <property name="build.dist.doc" location="${build.dist}/doc" />
  20. <property name="build.dist.game" location="${build.dist}/game" />
  21. <property name="build.dist.login" location="${build.dist}/login" />
  22. <target name="init" depends="checkRequirements,getChangelogDateVersion" description="Create the output directories.">
  23. <mkdir dir="${build}" />
  24. </target>
  25. <target name="dist" depends="init" description="Export the files to the output directory.">
  26. <sync todir="${build.dist}" includeemptydirs="true">
  27. <fileset dir="dist" />
  28. </sync>
  29. <concat destfile="${build.dist.doc}/L2J_DataPack_CHANGELOG.txt">${l2j.changelog}</concat>
  30. <concat destfile="${build.dist.game}/config/l2jdp-version.properties">version=${l2j.version}${line.separator}builddate=${build.tstamp}</concat>
  31. </target>
  32. <target name="build" depends="dist">
  33. <zip destfile="${build}/L2J_DataPack_BETA.zip" basedir="${build.dist}" level="9" />
  34. </target>
  35. <target name="checkRequirements" description="Check Requirements.">
  36. <fail message="Ant 1.8.2 is required. But your version is ${ant.version} and if you are using Eclipse probably is outdated.">
  37. <condition>
  38. <not>
  39. <antversion atleast="1.8.2" />
  40. </not>
  41. </condition>
  42. </fail>
  43. </target>
  44. <target name="getChangelogDateVersion" description="Get Changelog, Date, Version.">
  45. <exec dir="${basedir}" executable="svn" outputproperty="l2j.changelog">
  46. <arg value="log" />
  47. <arg value="--stop-on-copy" />
  48. </exec>
  49. <tstamp>
  50. <format property="build.tstamp" pattern="dd/MM/yyyy HH:mm" />
  51. </tstamp>
  52. <exec dir="${basedir}" executable="svnversion" outputproperty="l2j.version">
  53. <arg value="-c" />
  54. <redirector>
  55. <outputfilterchain>
  56. <tokenfilter>
  57. <replaceregex pattern="[0-9]+\:" replace="" />
  58. </tokenfilter>
  59. </outputfilterchain>
  60. </redirector>
  61. </exec>
  62. </target>
  63. </project>