-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathbuild.xml
100 lines (85 loc) · 3.87 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
<?xml version="1.0"?>
<project name="AuToBI" default="jar">
<path id="project.classpath">
<fileset dir="lib" includes="*.jar"/>
</path>
<property name="classes" location="out/production/Release"/>
<property name="test-classes" location="out/test/Release"/>
<property name="test.data.dir" location="test_data"/>
<path id="test.classpath">
<fileset dir="lib" includes="*.jar"/>
<pathelement location="${classes}"/>
<pathelement location="${test-classes}"/>
</path>
<target name="compile">
<mkdir dir="${classes}"/>
<javac srcdir="src" destdir="${classes}" classpathref="project.classpath" debug="true"
includeantruntime="false"/>
</target>
<target name="compile-test" depends="compile">
<mkdir dir="${test-classes}"/>
<mkdir dir="${test-classes}/results"/>
<javac srcdir="test" destdir="${test-classes}" classpathref="test.classpath" debug="true"
includeantruntime="false"/>
</target>
<target name="jar" depends="compile">
<jar destfile="AuToBI.jar">
<zipfileset dir="${classes}/" prefix=""/>
<zipfileset src="lib/commons-math3-3.3.jar"/>
<zipfileset src="lib/guava-16.0.1.jar"/>
<zipfileset src="lib/jakarta-oro-2.1-dev-1.jar"/>
<zipfileset src="lib/Jama-1.0.2.jar"/>
<zipfileset src="lib/JLargeArrays-1.2.jar"/>
<zipfileset src="lib/javassist.jar"/>
<zipfileset src="lib/jnt_fft.jar"/>
<zipfileset src="lib/JTransforms-3.0.jar"/>
<zipfileset src="lib/liblinear-1.94.jar"/>
<zipfileset src="lib/log4j-1.2.15.jar"/>
<zipfileset src="lib/reflections-0.9.9-RC1-uberjar.jar"/>
<zipfileset src="lib/slf4j-simple-1.7.7-sources.jar"/>
<zipfileset src="lib/weka.jar"/>
<manifest>
<attribute name="Main-Class" value="edu.cuny.qc.speech.AuToBI.AuToBI"/>
</manifest>
</jar>
</target>
<target name="clean">
<delete dir="out/"/>
</target>
<target name="test" depends="compile-test">
<property name="test.class.name" value="edu.cuny.qc.speech.AuToBI.AuToBITest"/>
<junit fork="yes" haltonfailure="no" printsummary="yes" failureProperty="test.failure">
<env key="AUTOBI_TEST_DIR" value="${test.data.dir}"/>
<batchtest fork="yes" todir="${test-classes}/results">
<fileset dir="test">
<include name="**/*Test*.java"/>
</fileset>
</batchtest>
<!-- use XML formatter and let it output to file and plain text file -->
<formatter type="plain"/>
<formatter type="xml"/>
<classpath refid="test.classpath"/>
</junit>
<!-- generate report with junitreport -->
<junitreport todir="${test-classes}">
<fileset dir="${test-classes}/results"/>
<report todir="${test-classes}/report"/>
</junitreport>
<!-- concat the report through a filter chain to extract what you want -->
<concat>
<fileset file="${test-classes}/report/overview-summary.html"/>
<filterchain>
<linecontainsregexp>
<regexp pattern='title="Display all tests"'/>
</linecontainsregexp>
<tokenfilter>
<replaceregex
pattern='.*href="all-tests.html">(\d+)<.*href="alltests-fails.html">(\d+)<.*href="alltests-errors.html">(\d+).*'
replace="Run: \1, Failed: \2, Errors: \3.
HTML Report generated on ${test-classes}/report/index.html"/>
</tokenfilter>
</filterchain>
</concat>
<fail message="FAILING - JUnit tests failed." if="test.failure"/>
</target>
</project>