forked from CompEvol/beast2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-testing.xml
163 lines (142 loc) · 6.22 KB
/
build-testing.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
<project basedir="." default="test-all" name="BEAST 2 Unit Tests"
xmlns:fx="javafx:com.sun.javafx.tools.ant">
<description>
Simplified build script for running unit tests only.
Not for producing releases.
</description>
<!-- set global properties for this build -->
<property name="src" location="src" />
<property name="build" location="build" />
<property name="lib" location="lib" />
<property name="doc" location="doc" />
<property name="dist" location="build/dist" />
<property name="test" location="test" />
<property name="main_class_BEASTLauncher" value="beast.app.beastapp.BeastLauncher" />
<property name="report" value="build/junitreport" />
<path id="classpath">
<fileset dir="${lib}" includes="beagle.jar"/>
<fileset dir="${lib}" includes="jam.jar"/>
<fileset dir="${lib}" includes="colt.jar"/>
<fileset dir="${lib}" includes="fest.jar"/>
<fileset dir="${lib}" includes="junit-4.8.2.jar"/>
<fileset dir="${lib}" includes="antlr-runtime-4.7.jar"/>
</path>
<target name="init">
<echo message="${ant.project.name}: ${ant.file}" />
</target>
<target name="clean">
<delete dir="${build}" />
<delete dir="${test}" />
</target>
<!-- compile Java source code -->
<target name="compile-all" depends="init">
<echo>Building BEAST 2</echo>
<mkdir dir="${build}" />
<!-- Compile the java code from ${src} into ${build} /bin -->
<javac source="1.8"
target="1.8"
bootclasspath='/opt/jdk1.8.0_131/jre/lib/rt.jar'
srcdir="${src}"
destdir="${build}"
classpathref="classpath"
fork="true"
memoryinitialsize="256m"
memorymaximumsize="1024m"
includeAntRuntime='false'>
<include name="beast/**/**" />
<!-- apache commons math -->
<include name="org/**/**" />
<!-- compile JUnit test classes -->
<include name="test/beast/**" />
</javac>
<echo message="Ant running on Java version ${ant.java.version}"/>
<!-- compile the launcher apps against Java 6-->
<delete file="${build}/beast/app/beauti/BeautiLauncher.class" />
<delete file="${build}/beast/app/tools/AppLauncherLauncher.class" />
<delete file="${build}/beast/app/tools/LogCombinerLauncher.class" />
<delete file="${build}/beast/app/treeannotator/TreeAnnotatorLauncher.class" />
<delete file="${build}/beast/app/util/Utils6.class" />
<delete file="${build}/beast/app/BEASTVersion.class" />
<delete file="${build}/beast/util/BEASTClassLoader.class" />
<delete>
<fileset dir="${build}/beast/core/util/" includes="Log*.class" />
<fileset dir="${build}/beast/app/beastapp/" includes="BeastLauncher*.class" />
<fileset dir="${build}/beast/app/util/" includes="Arguments*.class"/>
<fileset dir="${build}/beast/util/" includes="Package*.class"/>
</delete>
<delete file="${build}/beast/app/util/Version.class" />
<javac source="1.6"
target="1.6"
bootclasspath='/opt/jdk1.6.0_45/jre/lib/rt.jar'
srcdir="${src}"
destdir="${build}"
classpathref="classpath"
fork="true"
memoryinitialsize="256m"
memorymaximumsize="1024m"
includeAntRuntime='false'>
<include name="beast/**/*Launcher.java" />
<include name="beast/**/Utils6.java" />
<include name="beast/**/BEASTVersion.java" />
<include name="beast/**/Version.java" />
<include name="beast/util/Package*.java" />
<include name="beast/app/util/Arguments.java" />
<include name="beast/core/util/Log.java" />
<include name="beast/util/BEASTClassLoader.java" />
</javac>
<copy todir="${build}">
<fileset dir="${src}" includes="**/*.properties" />
<fileset dir="${src}" includes="**/*.png" />
</copy>
<echo message="Successfully compiled." />
</target>
<!-- Core BEAST unit tests -->
<target name="junit">
<mkdir dir="${report}" />
<junit printsummary="yes" failureproperty="junitfailed">
<!--showoutput='yes'-->
<classpath>
<path refid="classpath" />
<path location="${build}" />
</classpath>
<formatter type="xml" />
<batchtest fork="yes" todir="${report}">
<fileset dir="${src}">
<include name="test/**/*Test.java" />
<exclude name="test/beast/beast2vs1/**/*Test.java"/>
<exclude name="test/beast/app/beauti/**/*Test.java"/>
</fileset>
</batchtest>
</junit>
<echo message="JUnit test finished." />
</target>
<!-- BEAUti UI unit tests -->
<target name="junitb">
<mkdir dir="${report}" />
<junit printsummary="yes" failureproperty="junitbfailed" maxmemory="4G">
<!--showoutput='yes'-->
<classpath>
<path refid="classpath" />
<path location="${build}" />
</classpath>
<formatter type="xml" />
<batchtest fork="yes" todir="${report}">
<fileset dir="${src}">
<include name="test/beast/app/beauti/**/*Test.java"/>
</fileset>
</batchtest>
</junit>
<echo message="JUnit test finished." />
</target>
<!-- Target for CI testing with non-zero exit status on test failure. -->
<target name="test-all" depends="clean, compile-all, junit, junitb">
<fail if="junitfailed" message="One or more CORE BEAST tests failed."/>
<fail if="junitbfailed" message="One or more BEAUTI tests failed."/>
</target>
<target name="test-core" depends="clean, compile-all, junit">
<fail if="junitfailed" message="One or more CORE BEAST tests failed."/>
</target>
<target name="test-beauti" depends="clean, compile-all, junitb">
<fail if="junitbfailed" message="One or more BEAUTI tests failed."/>
</target>
</project>