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.

BuildPlugins.xml 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <project name="DMDirc-Plugins" default="default" basedir=".">
  2. <!-- ant-contrib default location (can be overridden in the property files below)-->
  3. <property name="libs.antcontrib" value="ant-contrib-1.0b3.jar"/>
  4. <!-- Netbeans property files -->
  5. <property file="nbproject/project.properties"/>
  6. <property file="nbproject/private/private.properties"/>
  7. <property file="${user.properties.file}"/>
  8. <available file="${libs.antcontrib}" property="has.ant-contrib"/>
  9. <taskdef resource="net/sf/antcontrib/antcontrib.properties">
  10. <classpath>
  11. <pathelement location="${libs.antcontrib}"/>
  12. </classpath>
  13. </taskdef>
  14. <target name="makepluginjar">
  15. <propertyregex property="pluginjar.name" input="${target.file}" regexp=".*[\\/](.*)$" select="\1.jar" casesensitive="false" />
  16. <propertyregex property="folder.name" input="${target.file}" regexp=".*${build.classes.dir}/(.*)$" select="\1" casesensitive="false" />
  17. <echo message="Building: ${folder.name} to ${pluginjar.name}"/>
  18. <delete file="plugins/${pluginjar.name}"/>
  19. <jar jarfile="plugins/${pluginjar.name}" basedir="build/classes" includes="${folder.name}/*.class">
  20. <metainf file="${target.file}/plugin.info"/>
  21. </jar>
  22. </target>
  23. <target name="build-plugins" depends="build-plugins_bash, build-plugins_ant-contrib"/>
  24. <available file="/bin/bash" property="has.bash"/>
  25. <target name="build-plugins_bash" unless="has.ant-contrib" if="has.bash">
  26. <exec executable="/bin/bash">
  27. <arg value="createAllPluginJar.sh"/>
  28. <arg value="${src.dir}/com/dmdirc/addons/"/>
  29. </exec>
  30. </target>
  31. <target name="build-plugins_ant-contrib" if="has.ant-contrib">
  32. <mkdir dir="plugins/"/>
  33. <foreach target="makepluginjar" param="target.file">
  34. <path>
  35. <dirset dir="${build.classes.dir}/com/dmdirc/addons/">
  36. <include name="**/*"/>
  37. <exclude name="**/*/*/**"/>
  38. </dirset>
  39. </path>
  40. </foreach>
  41. </target>
  42. </project>