|
@@ -2,6 +2,8 @@
|
2
|
2
|
<project name="DMDirc Plugins" default="default" basedir=".">
|
3
|
3
|
<description>Builds, packages and tests DMDirc plugins.</description>
|
4
|
4
|
|
|
5
|
+ <import file="build-gitversion.xml"/>
|
|
6
|
+
|
5
|
7
|
<property name="plugins.src" location="src"/>
|
6
|
8
|
<property name="plugins.build" location="build"/>
|
7
|
9
|
<property name="plugins.build.classes" location="${plugins.build}/classes"/>
|
|
@@ -18,7 +20,15 @@
|
18
|
20
|
<available classname="com.dmdirc.Main" classpathref="plugins.classpath"/>
|
19
|
21
|
</condition>
|
20
|
22
|
|
21
|
|
- <taskdef resource="net/sf/antcontrib/antlib.xml" classpathref="plugins.classpath"/>
|
|
23
|
+ <condition property="plugins.need.antlib">
|
|
24
|
+ <not>
|
|
25
|
+ <typefound name="foreach"/>
|
|
26
|
+ </not>
|
|
27
|
+ </condition>
|
|
28
|
+
|
|
29
|
+ <target name="-init-taskdefs" if="plugins.need.antlib">
|
|
30
|
+ <taskdef resource="net/sf/antcontrib/antlib.xml" classpathref="plugins.classpath"/>
|
|
31
|
+ </target>
|
22
|
32
|
|
23
|
33
|
<target name="-check-dmdirc-jar" unless="plugins.dmdirc.exists">
|
24
|
34
|
<fail>DMDirc class files not found. Please put DMDirc on the classpath or specify the 'plugins.dmdirc.build.dir' property.</fail>
|
|
@@ -42,7 +52,7 @@
|
42
|
52
|
|
43
|
53
|
<target name="jar" depends="-package,-add-libs"/>
|
44
|
54
|
|
45
|
|
- <target name="-package" depends="compile">
|
|
55
|
+ <target name="-package" depends="-init-taskdefs, compile">
|
46
|
56
|
<for param="configfile">
|
47
|
57
|
<fileset dir="${plugins.src}" includes="**/plugin.config"/>
|
48
|
58
|
<sequential>
|
|
@@ -50,7 +60,6 @@
|
50
|
60
|
<local name="plugin.build.dir"/>
|
51
|
61
|
<local name="plugin.name"/>
|
52
|
62
|
<local name="plugin.jar"/>
|
53
|
|
- <local name="plugin.lastcommit"/>
|
54
|
63
|
<local name="plugin.version"/>
|
55
|
64
|
|
56
|
65
|
<mkdir dir="${plugins.build.metadata}/${plugin.name}/META-INF"/>
|
|
@@ -65,20 +74,7 @@
|
65
|
74
|
<fileset dir="${plugin.src.dir}" includes="identities/** licences/**"/>
|
66
|
75
|
</copy>
|
67
|
76
|
|
68
|
|
- <exec executable="git" outputproperty="plugin.lastcommit">
|
69
|
|
- <arg value="rev-list"/>
|
70
|
|
- <arg value="--max-count=1"/>
|
71
|
|
- <arg value="HEAD"/>
|
72
|
|
- <arg value="--"/>
|
73
|
|
- <arg value="${plugin.src.dir}"/>
|
74
|
|
- </exec>
|
75
|
|
-
|
76
|
|
- <exec executable="git" outputproperty="plugin.version">
|
77
|
|
- <arg value="describe"/>
|
78
|
|
- <arg value="--tags"/>
|
79
|
|
- <arg value="--always"/>
|
80
|
|
- <arg value="${plugin.lastcommit}"/>
|
81
|
|
- </exec>
|
|
77
|
+ <gitversion target="${plugin.src.dir}" outputproperty="plugin.version"/>
|
82
|
78
|
|
83
|
79
|
<echo file="${plugins.build.metadata}/${plugin.name}/META-INF/plugin.config" append="true">
|
84
|
80
|
version:
|