You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build-versioning.xml 3.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="DMDirc-versioning" default="default" basedir=".">
  3. <description>Adds automatic versioning information to DMDirc</description>
  4. <property name="version.config" value="build/classes/com/dmdirc/version.config"/>
  5. <property name="defaults.path" value="modules/defaults/.git/"/>
  6. <property name="defaults.output" value="build/classes/com/dmdirc/config/defaults/"/>
  7. <property name="defaults.target" value="${defaults.output}default/defaults"/>
  8. <property name="modealiases.target" value="${defaults.output}modealiases/generic"/>
  9. <available file=".git" property="is.git"/>
  10. <taskdef name="git-describe" classname="org.mdonoughe.JGitDescribeTask" classpathref="libclasspath"/>
  11. <target name="-write-version" depends="-write-version-header, -add-version, -write-updater, -write-identities, -write-disable-updates"/>
  12. <target name="-write-version-header">
  13. <echo file="${version.config}"># This is a DMDirc configuration file automatically generated by
  14. # the build process.
  15. keysections:
  16. identity
  17. version
  18. updater
  19. identity:
  20. name=DMDirc version information
  21. globaldefault=true
  22. order=95000
  23. version:
  24. version=</echo>
  25. </target>
  26. <target name="-add-version" depends="-add-git-version"/>
  27. <target name="-add-git-version" if="is.git">
  28. <git-describe dir=".git" property="git.version" />
  29. <echo file="${version.config}" append="true">${git.version}
  30. </echo>
  31. </target>
  32. <target name="-init-channel" unless="channel">
  33. <property name="channel" value="NONE"/>
  34. </target>
  35. <target name="with.disabled.updater">
  36. <property name="disableupdates" value="true" />
  37. </target>
  38. <target name="-write-disable-updates" if="disableupdates">
  39. <echo file="${version.config}" append="true">
  40. version:
  41. noupdates=true
  42. </echo>
  43. </target>
  44. <target name="-write-updater" depends="-init-channel, -read-identities">
  45. <echo file="${version.config}" append="true">
  46. updater:
  47. channel=${channel}
  48. bundleddefaultsversion=${defaults.version}
  49. bundledmodealiasesversion=${modealiases.version}
  50. </echo>
  51. </target>
  52. <target name="-write-identities" depends="-read-identities, -copy-identities">
  53. <echo file="${defaults.target}" append="true">
  54. identity:
  55. defaultsversion=${defaults.version}
  56. </echo>
  57. <echo file="${modealiases.target}" append="true">
  58. identity:
  59. modealiasversion=${modealiases.version}
  60. </echo>
  61. </target>
  62. <target name="-copy-identities">
  63. <mkdir dir="${defaults.output}"/>
  64. <copy todir="${defaults.output}" overwrite="true">
  65. <fileset dir="modules/defaults/" excludes=".git/"/>
  66. </copy>
  67. </target>
  68. <target name="-read-identities" depends="-read-identities-git"/>
  69. <target name="-read-identities-git" if="is.git">
  70. <git-describe dir="${defaults.path}" property="defaults.version" subdir="default" />
  71. <git-describe dir="${defaults.path}" property="modealiases.version" subdir="modealiases" />
  72. </target>
  73. </project>