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

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