-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
101 lines (86 loc) · 2.85 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<project name="cjunit" default="jar">
<property name="build.sysclasspath" value="ignore"/>
<property name="testsuite" value="de.fzi.cjunit.AllTests"/>
<property name="src" value="src/main"/>
<property name="testsrc" value="src/test"/>
<property name="target" value="target"/>
<property name="bin" value="${target}/main"/>
<property name="testbin" value="${target}/test"/>
<property name="lib" value="lib"/>
<property name="license" value="LICENSE"/>
<property name="binjar" value="${target}/cjunit.jar"/>
<property name="unjardir" value="${target}/unjar"/>
<property name="unjarstamp" value="${target}/unjar-stamp"/>
<property name="depjar" value="${target}/cjunit-dep.jar"/>
<property name="alljar" value="${target}/cjunit-all.jar"/>
<fileset id="deps" dir="${lib}" includes="**/*.jar"/>
<path id="deppath">
<fileset refid="deps"/>
</path>
<target name="all" depends="clean,run-test,jar,distjars"/>
<target name="clean">
<delete dir="${target}"/>
</target>
<target name="compile">
<mkdir dir="${bin}"/>
<javac srcdir="${src}" destdir="${bin}" debug="on"
classpathref="deppath"/>
<mkdir dir="${testbin}"/>
<javac srcdir="${testsrc}" destdir="${testbin}" debug="on"
classpath="${bin}" classpathref="deppath"/>
</target>
<fileset id="docpaths" dir="${src}">
<include name="de/fzi/cjunit/*.java"/>
<include name="de/fzi/cjunit/util/*.java"/>
<include name="de/fzi/concurrentmatchers/**/*.java"/>
</fileset>
<target name="doc">
<javadoc destdir="${target}/doc">
<fileset refid="docpaths"/>
</javadoc>
</target>
<target name="jar" depends="compile,doc">
<copy file="${license}" todir="${bin}"/>
<jar jarfile="${binjar}">
<fileset dir="${bin}"/>
<fileset dir="${target}" includes="doc/"/>
</jar>
</target>
<target name="run-test" depends="compile">
<java classname="org.junit.runner.JUnitCore"
classpath="${testbin};${bin}"
classpathref="deppath"
fork="yes"
failonerror="true">
<arg value="${testsuite}"/>
</java>
</target>
<target name="check-deps">
<uptodate property="nochanges.deps" targetfile="${unjarstamp}">
<srcfiles refid="deps"/>
</uptodate>
</target>
<target name="unjar-deps" depends="check-deps" unless="nochanges.deps">
<unjar dest="${unjardir}" overwrite="false">
<fileset refid="deps"/>
</unjar>
<touch file="${unjarstamp}"/>
</target>
<fileset id="depfiles" dir="${unjardir}"
includes="**/*.class **/*.properties"/>
<fileset id="deplicenses" dir="${lib}"
includes="**/LICENSE.*"/>
<target name="distjars" depends="jar,unjar-deps,doc">
<jar jarfile="${depjar}">
<fileset refid="depfiles"/>
<fileset refid="deplicenses"/>
</jar>
<jar jarfile="${alljar}">
<fileset refid="depfiles"/>
<fileset refid="deplicenses"/>
<fileset dir="${bin}"/>
<fileset dir="${testbin}"/>
<fileset dir="${target}" includes="doc/"/>
</jar>
</target>
</project>