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

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