Bläddra i källkod

Add build script for util project

Change-Id: I7b5063eed32ec500899cd6cd8801821fde89c16a
Reviewed-on: http://gerrit.dmdirc.com/1668
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
Reviewed-by: Greg Holmes <greg@dmdirc.com>
tags/0.6.5
Chris Smith 13 år sedan
förälder
incheckning
e8c5a10803
4 ändrade filer med 105 tillägg och 0 borttagningar
  1. 3
    0
      .gitignore
  2. 102
    0
      build.xml
  3. Binär
      lib/junit-4.8.1.jar
  4. Binär
      lib/mockito-all-1.8.2.jar

+ 3
- 0
.gitignore Visa fil

@@ -0,0 +1,3 @@
1
+/build
2
+/dist
3
+/reports

+ 102
- 0
build.xml Visa fil

@@ -0,0 +1,102 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project name="DMDirc Util" default="default" basedir=".">
3
+    <description>Builds, packages and tests DMDirc utility classes.</description>
4
+
5
+    <property name="util.src" location="src"/>
6
+    <property name="util.test" location="test"/>
7
+    <property name="util.build" location="build"/>
8
+    <property name="util.build.main" location="${util.build}/classes"/>
9
+    <property name="util.build.test" location="${util.build}/test"/>
10
+    <property name="util.reports" location="reports"/>
11
+    <property name="util.lib" location="lib"/>
12
+    <property name="util.dist" location="dist"/>
13
+
14
+    <path id="util.classpath.test">
15
+        <pathelement path="${util.build.main}"/>
16
+        <fileset dir="${util.lib}" includes="*.jar"/>
17
+    </path>
18
+
19
+    <target name="-init-compile">
20
+       <mkdir dir="${util.build.main}"/>
21
+    </target>
22
+
23
+    <target name="-init-compile-tests">
24
+       <mkdir dir="${util.build.test}"/>
25
+    </target>
26
+
27
+    <target name="-init-jar">
28
+       <mkdir dir="${util.dist}"/>
29
+    </target>
30
+
31
+    <target name="-init-test">
32
+       <mkdir dir="${util.reports}"/>
33
+    </target>
34
+
35
+    <target name="-retrieve-versions">
36
+       <exec executable="git" outputproperty="util.lastcommit.main">
37
+          <arg value="rev-list"/>
38
+          <arg value="--max-count=1"/>
39
+          <arg value="HEAD"/>
40
+          <arg value="--"/>
41
+          <arg value="${util.src}/"/>
42
+       </exec>
43
+
44
+       <exec executable="git" outputproperty="util.version.main">
45
+          <arg value="describe"/>
46
+          <arg value="--tags"/>
47
+          <arg value="--always"/>
48
+          <arg value="${util.lastcommit.main}"/>
49
+       </exec> 
50
+    </target>
51
+
52
+    <target name="compile" depends="-init-compile">
53
+       <javac srcdir="${util.src}" destdir="${util.build.main}"
54
+              includeantruntime="false"/> 
55
+    </target>
56
+
57
+    <target name="compile-tests" depends="compile,-init-compile-tests">
58
+       <javac srcdir="${util.test}" destdir="${util.build.test}"
59
+              includeantruntime="false" classpathref="util.classpath.test">
60
+       </javac>
61
+
62
+       <copy todir="${util.build.test}">
63
+          <fileset dir="${util.test}">
64
+             <exclude name="**/*.java"/>
65
+          </fileset>
66
+       </copy>
67
+    </target>
68
+
69
+    <target name="test" depends="compile-tests,-init-test">
70
+       <junit printsummary="true">
71
+          <classpath>
72
+             <path refid="util.classpath.test"/>
73
+             <pathelement location="${util.build.test}"/>
74
+          </classpath> 
75
+          <batchtest todir="${util.reports}">
76
+             <fileset dir="${util.build.test}" includes="**/*Test.class"/>
77
+             <formatter type="xml"/>
78
+          </batchtest>
79
+       </junit>
80
+
81
+       <junitreport todir="${util.reports}">
82
+          <fileset dir="${util.reports}" includes="TEST-*.xml"/>
83
+       </junitreport>
84
+    </target>
85
+
86
+    <target name="jar" depends="compile,-init-jar,-retrieve-versions">
87
+       <jar destfile="${util.dist}/util.jar" basedir="${util.build.main}">
88
+          <manifest>
89
+             <section name="com.dmdirc.util">
90
+                <attribute name="Implementation-Title" value="Utility classes"/>
91
+                <attribute name="Implementation-Version" value="${util.version.main}"/>
92
+             </section>
93
+          </manifest>
94
+       </jar>
95
+    </target>
96
+
97
+    <target name="clean">
98
+       <delete dir="${util.build}"/>
99
+       <delete dir="${util.dist}"/>
100
+       <delete dir="${util.reports}"/>
101
+    </target>
102
+</project>

Binär
lib/junit-4.8.1.jar Visa fil


Binär
lib/mockito-all-1.8.2.jar Visa fil


Laddar…
Avbryt
Spara