This repository has been archived by the owner on Aug 23, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
build.xml
169 lines (145 loc) · 5.69 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<?xml version="1.0" encoding="UTF-8"?>
<project name="molgenis" basedir=".">
<property name="dir.lib" value="lib" />
<property name="dir.src" value="src" />
<property name="dir.build" value="build" />
<property name="dir.classes" value="${dir.build}/classes" />
<property name="dir.javadoc" value="${dir.build}/javadoc" />
<property name="dir.test.src" value="test/java" />
<property name="dir.generated.test.src" value="generated/test/java" />
<property name="dir.test.resources" value="test/resources" />
<property name="dir.test.classes" value="${dir.build}/test/classes" />
<property name="testng.report.dir" value="${dir.build}/test/output" />
<property name="cb.file" location="${dir.build}/cobertura.ser" />
<property name="findbugs.home" value="${dir.lib}/findbugs-2.0.1" />
<!-- cobertura -->
<property name="cb.report.dir" value="${dir.build}/cobertura" />
<property name="cb.instrument.dir" value="${cb.report.dir}/cobertura-instrumented-classes" />
<path id="classpath">
<fileset dir="${dir.lib}" includes="**/*.jar" />
</path>
<target name="javadoc">
<javadoc access="public" destdir="${dir.javadoc}" author="true"
version="true" noindex="false" use="true" classpathref="classpath">
<fileset dir="${dir.src}" defaultexcludes="yes">
<include name="**/*.java" />
<exclude name="org/test/**/*.java" />
</fileset>
</javadoc>
</target>
<target name="clean">
<delete dir="${dir.build}" includeEmptyDirs="true" failonerror="false" />
</target>
<target name="compile">
<mkdir dir="${dir.classes}"/>
<javac srcdir="${dir.src}" destdir="${dir.classes}" debug="true" includeantruntime="false">
<compilerarg value="-Xlint"/>
<classpath refid="classpath" />
</javac>
</target>
<target name="test" depends="clean,compile,cb,findbugs" />
<path id="test.classpath">
<path refid="classpath" />
<pathelement location="${dir.classes}" />
</path>
<taskdef resource="testngtasks" classpathref="classpath" />
<target name="testng" depends="compile">
<mkdir dir="${dir.test.classes}"/>
<mkdir dir="${testng.report.dir}" />
<!-- copy the test resources -->
<copy todir="${dir.test.classes}" verbose="true">
<fileset dir="${dir.test.resources}" />
</copy>
<!-- compile the tests -->
<javac srcdir="${dir.test.src}:${dir.generated.test.src}" destdir="${dir.test.classes}" debug="true" includeantruntime="false">
<compilerarg value="-Xlint"/>
<classpath refid="test.classpath" />
</javac>
<testng outputDir="${testng.report.dir}" haltOnFailure="true">
<classpath location="${cb.instrument.dir}" />
<sysproperty key="net.sourceforge.cobertura.datafile" value="${cb.file}" />
<classpath location="${dir.src}" />
<classpath location="${dir.generated.test.src}" />
<classpath refid="cb.classpath" />
<classpath refid="test.classpath"/>
<classpath location="${dir.test.classes}" />
<classfileset dir="${dir.test.classes}" />
<jvmarg value="-noverify" />
</testng>
</target>
<!-- cobertura -->
<path id="cb.classpath">
<fileset dir="${dir.lib}/cobertura">
<include name="*.jar" />
</fileset>
</path>
<taskdef classpathref="cb.classpath" resource="tasks.properties" />
<target name="cb" depends="cb.gen, cb.xml, cb.html">
<delete file="${cb.file}" />
<delete dir="${cb.instrument.dir}" />
</target>
<target name="cb.instrument">
<mkdir dir="${cb.report.dir}" />
<cobertura-instrument todir="${cb.instrument.dir}/"
datafile="${cb.file}">
<fileset dir="${dir.classes}">
<include name="**/*.class" />
<exclude name="**/*Test.class" />
</fileset>
</cobertura-instrument>
</target>
<target name="init.cb.path">
<property name="test.cp" value="cb.test.cp" />
<path id="cb.test.cp">
<pathelement path="${cb.instrument.dir}" />
<pathelement path="${cb.classes.dir}" />
<path refid="classpath" />
</path>
</target>
<target name="cb.run" depends="init.cb.path, testng" />
<target name="cb.gen" depends="cb.instrument, cb.run" />
<target name="cb.html">
<cobertura-report format="html"
destdir="${cb.report.dir}"
datafile="${cb.file}">
<fileset dir="${dir.src}">
<include name="**/*.java" />
</fileset>
</cobertura-report>
</target>
<target name="cb.xml">
<cobertura-report format="xml"
destdir="${cb.report.dir}"
datafile="${cb.file}">
<fileset dir="${dir.src}">
<include name="**/*.java" />
</fileset>
</cobertura-report>
</target>
<!-- findbugs -->
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="classpath"/>
<target name="findbugs" depends="compile">
<mkdir dir="${dir.build}" />
<findbugs home="${findbugs.home}"
output="xml:withMessages" outputFile="${dir.build}/findbugs.xml"
jvmargs="-Xms1024M -Xmx1024M ">
<sourcePath path="${dir.src}" />
<class location="${dir.classes}" />
<auxclasspath>
<path refid="classpath" />
</auxclasspath>
</findbugs>
</target>
<target name="findbugs.html" depends="compile">
<mkdir dir="${dir.build}" />
<findbugs home="${findbugs.home}"
output="html" outputFile="${dir.build}/findbugs.html"
jvmargs="-Xms1024M -Xmx1024M ">
<sourcePath path="${dir.src}" />
<class location="${dir.classes}" />
<auxclasspath>
<path refid="classpath" />
</auxclasspath>
</findbugs>
</target>
</project>