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 3.5KB

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