forked from gem/oq-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
97 lines (77 loc) · 3.48 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
<?xml version="1.0" ?>
<project name="GEM Java Tests" default="help" basedir=".">
<property name="lib.dir" value="lib" />
<property name="src.dir" value="java" />
<property name="test.dir" value="java_tests" />
<property name="dist.dir" value="dist" />
<property name="build.dir" value="build" />
<property name="coverage.dir" value="${dist.dir}" />
<property name="classes.dir" value="${build.dir}/classes" />
<property name="instrumented.dir" value="${build.dir}/inst" />
<property name="javadoc.report.dir" value="${dist.dir}/javadoc" />
<property name="tests.report.dir" value="${dist.dir}/tests_result" />
<path id="dependencies">
<fileset dir="${lib.dir}" includes="*.jar" />
</path>
<target name="help" description="Display detailed usage information">
<exec executable="ant">
<arg value="-p"/>
</exec>
</target>
<target name="clean" description="Clean build directories">
<delete dir="${dist.dir}" />
<delete dir="${build.dir}" />
</target>
<target name="javadoc" description="Build the documentation for the Java classes">
<javadoc classpathref="dependencies" packagenames="org.gem.engine.*" sourcepath="${src.dir}" destdir="${javadoc.report.dir}" author="true" version="true" use="true" windowtitle="OpenGEM Java Core API" />
</target>
<target name="compile-sources" depends="clean" description="Compile the Java classes">
<mkdir dir="${classes.dir}" />
<javac fork="no" debug="true" destdir="${classes.dir}" classpathref="dependencies" includes="org/**/*.java " srcdir="${src.dir}" />
</target>
<target name="build-openquake-jar" depends="compile-sources" description="Build the OpenQuake jar">
<mkdir dir="${dist.dir}" />
<jar destfile="${dist.dir}/openquake-minimal.jar" basedir="${classes.dir}" includes="**/*.class" />
</target>
<taskdef resource="emma_ant.properties" classpathref="dependencies" />
<target name="junit-tests-with-coverage" depends="compile-sources" description="Run the test suite and check the code coverage">
<mkdir dir="${coverage.dir}" />
<mkdir dir="${tests.report.dir}" />
<!-- Compile test classes -->
<javac fork="no" debug="true" destdir="${classes.dir}" classpathref="dependencies" includes="org/gem/**/*.java" srcdir="${test.dir}" />
<emma enabled="true">
<instr verbosity="verbose" instrpath="${classes.dir}" destdir="${instrumented.dir}" metadatafile="${coverage.dir}/metadata.emma" merge="true" mode="fullcopy">
<filter excludes="*Test*" />
<filter excludes="au.com.jenisys.view.*" />
</instr>
</emma>
<junit dir="." haltonerror="yes" haltonfailure="yes" fork="yes">
<classpath>
<!-- External libraries -->
<path refid="dependencies" />
<!-- Input test files -->
<pathelement path="${test.dir}/data" />
<pathelement path="${instrumented.dir}/classes" />
</classpath>
<formatter type="xml" />
<batchtest fork="yes" todir="${tests.report.dir}">
<fileset dir="${test.dir}">
<exclude name="**/*Base*.java" />
<exclude name="**/*TestHelper*.java" />
<exclude name="**/*TestUtils*.java" />
<exclude name="**/AllTests.java" />
</fileset>
</batchtest>
</junit>
<emma enabled="true">
<report sourcepath="${src.dir}">
<infileset file="coverage.ec" />
<infileset file="${coverage.dir}/metadata.emma" />
<xml outfile="${coverage.dir}/coverage.xml" depth="method" />
</report>
</emma>
<echo message="Cleaning compiled resources..." />
<delete dir="${build.dir}" />
<delete file="coverage.ec" />
</target>
</project>