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

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