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-plugins.xml 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <project name="DMDirc-plugins" default="default" basedir=".">
  3. <import file="modules/plugins/build-pluginutils.xml"/>
  4. <target name="-init-plugins">
  5. <taskdef resource="net/sf/fikin/ant/ant.properties" classpathref="build-classpath"/>
  6. <taskdef resource="net/sf/antcontrib/antlib.xml" classpathref="build-classpath"/>
  7. </target>
  8. <target name="-init-default-build-target" unless="plugins.build.target">
  9. <property name="plugins.build.target" value="jar"/>
  10. </target>
  11. <target name="build-plugins" description="Build all plugins" depends="-init-default-build-target">
  12. <subant buildpath="modules/plugins" target="${plugins.build.target}">
  13. <property name="plugins.dmdirc.build.dir" value="../../${build.classes.dir}"/>
  14. <property name="clover.search.path" value="../../lib/test"/>
  15. <property name="clover.license.path" location="etc/clover/clover.license"/>
  16. <property name="clover.init.string" location=".clover/clover.db"/>
  17. </subant>
  18. </target>
  19. <target name="clean-plugins" description="Clean all plugins">
  20. <subant buildpath="modules/plugins" target="clean"/>
  21. </target>
  22. <target name="-update-bundled-plugins" depends="-init-plugins">
  23. <bundleplugins jar="${dist.jar}">
  24. <fileset dir="modules/plugins/dist/">
  25. <include name="tabcompletion_*.jar"/>
  26. <include name="parser_irc.jar"/>
  27. <include name="ui_swing.jar"/>
  28. </fileset>
  29. </bundleplugins>
  30. </target>
  31. <target name="-check-addons-key" unless="dmdirc.addons.apikey">
  32. <fail>You must specify an API key in the the dmdirc.addons.apikey property</fail>
  33. </target>
  34. <target name="-check-addon-id" unless="addon.id">
  35. <fail>The ID of the addon to be published must be specified in the addon.id property</fail>
  36. </target>
  37. <target name="-check-addon-channel" unless="addon.channel">
  38. <fail>
  39. The channel of the addon to be published must be specified in the addon.channel property.
  40. Use 1 for Stable, 2 for Unstable, or 3 for Nightly.
  41. </fail>
  42. </target>
  43. <target name="-check-addon-file" unless="addon.file">
  44. <fail>The file of the addon to be published must be specified in the addon.file property</fail>
  45. </target>
  46. <target name="publish-all-plugins" description="Publishes all plugins to the addons site"
  47. depends="-init-plugins,-check-addons-key,-check-addon-channel">
  48. <foreach target="publish-plugin" param="addon.file" inheritall="true" parallel="true">
  49. <path>
  50. <fileset dir="plugins">
  51. <include name="*.jar"/>
  52. </fileset>
  53. </path>
  54. </foreach>
  55. </target>
  56. <target name="publish-plugin" description="Publish a plugin to the addons site"
  57. depends="-init-plugins,-check-addons-key,-check-addon-channel,-check-addon-file">
  58. <tempfile property="temp.dir" prefix="plugintmp"/>
  59. <mkdir dir="${temp.dir}"/>
  60. <unzip src="${addon.file}" dest="${temp.dir}">
  61. <patternset>
  62. <include name="META-INF/plugin.config"/>
  63. </patternset>
  64. </unzip>
  65. <loadfile srcfile="${temp.dir}/META-INF/plugin.config" property="addon.id">
  66. <filterchain>
  67. <!-- This is a bit fickle, and needs to understand config files better. -->
  68. <linecontains>
  69. <contains value=" id="/>
  70. </linecontains>
  71. <deletecharacters chars="\t id="/>
  72. <striplinebreaks/>
  73. </filterchain>
  74. </loadfile>
  75. <delete dir="${temp.dir}"/>
  76. <antcall target="publish-addon"/>
  77. </target>
  78. <target name="publish-addon" description="Publish an addon to the addons site"
  79. depends="-init-plugins,-check-addons-key,-check-addon-id,-check-addon-channel,-check-addon-file">
  80. <httpmpost url="http://addons.dmdirc.com/editaddon/${addon.id}" logLevel="none">
  81. <postString name="apikey" value="${dmdirc.addons.apikey}"/>
  82. <postString name="channel" value="${addon.channel}"/>
  83. <postFile name="download" file="${addon.file}"/>
  84. </httpmpost>
  85. </target>
  86. </project>