-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.xml
More file actions
executable file
·133 lines (115 loc) · 5.15 KB
/
build.xml
File metadata and controls
executable file
·133 lines (115 loc) · 5.15 KB
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
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2018 Spencer Pearson, José Campos and killmap contributors.
This file is part of killmap.
killmap is free software: you can redistribute it and/or modify it under the terms of the GNU
Lesser General Public License as published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
killmap is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with killmap.
If not, see <https://www.gnu.org/licenses/>.
-->
<project name="KillMap" default="jar" basedir=".">
<description>Mutation-analysis tool</description>
<property environment="env" />
<property name="javac.version" value="1.7" />
<property name="killmap.version" value="0.0.1-SNAPSHOT" />
<property name="src.dir" location="src/main/java" />
<property name="test.dir" location="src/test/java" />
<property name="lib.dir" location="lib" />
<property name="bin.dir" location="bin" />
<property name="major.version" value="1.3.2_jre7" />
<property name="major.zip" value="${lib.dir}/major-${major.version}.zip" />
<property name="major.dir" value="${lib.dir}/major" />
<property name="major-config.jar" value="${major.dir}/config/config.jar" />
<property name="junit.jar" value="${major.dir}/lib/junit-4.11.jar" />
<property name="killmap.jar" value="${bin.dir}/killmap-${killmap.version}.jar" />
<path id="classpath">
<pathelement location="${bin.dir}"/>
<pathelement path="${major-config.jar}"/>
<pathelement path="${junit.jar}"/>
</path>
<target name="clean" description="Clean">
<delete dir="${bin.dir}"/>
</target>
<target name="init" description="Prepare for compilation">
<mkdir dir="${bin.dir}"/>
<mkdir dir="${lib.dir}"/>
<get src="http://mutation-testing.org/downloads/files/major-${major.version}.zip"
dest="${lib.dir}/"
usetimestamp="true"
skipexisting="true"/>
<mkdir dir="${major.dir}"/>
<unzip src="${major.zip}" dest="${lib.dir}" overwrite="false"/>
</target>
<!-- Target to compile the project -->
<target name="compile" depends="init" description="Compile">
<javac includeantruntime="true"
debug="true"
srcdir="${src.dir}"
destdir="${bin.dir}"
source="${javac.version}"
target="${javac.version}"
includes="**/*.java">
<classpath refid="classpath"/>
</javac>
<javac includeantruntime="true"
debug="true"
srcdir="${test.dir}"
destdir="${bin.dir}"
source="${javac.version}"
target="${javac.version}"
includes="**/*.java">
<classpath refid="classpath"/>
</javac>
</target>
<!-- Execute the test suite -->
<target name="test" depends="compile" description="Run all unit tests">
<!-- hack for testing purpose -->
<pathconvert property="cp" refid="classpath" />
<fail unless="env.KILLMAP_CLASSPATH" message="To execute all test cases you must execute the following command first `export KILLMAP_CLASSPATH=${cp}` "/>
<junit printsummary="true"
showoutput="true"
fork="true"
haltonfailure="true">
<formatter type="brief" usefile="false"/>
<classpath refid="classpath"/>
<batchtest>
<fileset dir="${basedir}/src/test/java">
<include name="**/*Test.java"/>
<exclude name="**/*Dummy*.java"/>
<exclude name="**/RemoteTestRunnerTest.java"/>
</fileset>
</batchtest>
</junit>
<!-- oughta test this without forking, to make sure it works right even
though Ant runs it with a funny classloader -->
<junit printsummary="true"
showoutput="true"
fork="false"
haltonfailure="true">
<formatter type="brief" usefile="false"/>
<classpath refid="classpath"/>
<batchtest>
<fileset dir="${basedir}/src/test/java">
<include name="**/RemoteTestRunnerTest.java"/>
</fileset>
</batchtest>
</junit>
</target>
<!-- Create an executable .jar file -->
<target name="jar" depends="test" description="Create an executable jar file">
<jar destfile="${killmap.jar}"
basedir="${bin.dir}"
includes="**/*.class"
compress="false">
<zipfileset src="${major-config.jar}" excludes="META-INF/*.MF" />
<zipfileset src="${junit.jar}" excludes="META-INF/*.MF,LICENSE.txt" />
<manifest>
<attribute name="Main-Class" value="killmap.Main"/>
</manifest>
</jar>
</target>
</project>