-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.xml
More file actions
90 lines (81 loc) · 3.08 KB
/
build.xml
File metadata and controls
90 lines (81 loc) · 3.08 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
<project name="DeepMutation" default="dist" basedir=".">
<description>
Build file adapted from https://ant.apache.org/manual/using.html
</description>
<!-- set global properties for this build -->
<property name="entry.point" value="edu.wm.cs.mutation.DeepMutation"/>
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="src.main" location="src/main/java"/>
<property name="src.test" location="src/test/java"/>
<property name="build.c" location="build/main/c"/>
<property name="build.main" location="build/main/java"/>
<property name="build.test" location="build/test/java"/>
<property name="c.path" location="src/main/c"/>
<property name="c.lib.out" location="${dist}/libWrapper.so"/>
<!-- https://stackoverflow.com/a/1892936 -->
<path id="build.classpath">
<fileset dir="${basedir}">
<include name="lib/*.jar"/>
</fileset>
</path>
<pathconvert property="manifest.classpath" pathsep=" ">
<path refid="build.classpath"/>
<mapper>
<chainedmapper>
<flattenmapper/>
<globmapper from="*.jar" to="../lib/*.jar"/>
</chainedmapper>
</mapper>
</pathconvert>
<!-- end -->
<!-- Helpers -->
<target name="init">
<tstamp/>
<mkdir dir="${build.main}"/>
<mkdir dir="${build.c}"/>
<mkdir dir="${dist}"/>
</target>
<!-- Compile the Java code from ${src.main} into ${build.main} -->
<target name="compile">
<javac includeantruntime="false" classpathref="build.classpath"
srcdir="${src.main}" destdir="${build.main}"/>
<!-- Java 1.9+
nativeHeaderDir="${build.c}"/>
-->
</target>
<!-- Java 1.8 -->
<target name="jni">
<javah outputFile="${build.c}/Wrapper.h" classpath="${build.main}">
<class name="edu.wm.cs.mutation.tester.Wrapper"/>
</javah>
</target>
<target name="make">
<exec executable="make" failonerror="true">
<arg value="-f"/>
<arg value="jni/Makefile"/>
<arg value="C_PATH=${c.path}"/>
<arg value="HEADER_PATH=${build.c}"/>
<arg value="LIB_OUT=${c.lib.out}"/>
</exec>
</target>
<target name="dist" depends="init,compile,jni,make">
<jar jarfile="${dist}/DeepMutation.jar" basedir="${build.main}">
<manifest>
<attribute name="Main-Class" value="${entry.point}"/>
<attribute name="Class-Path" value="${manifest.classpath}"/>
</manifest>
</jar>
</target>
<target name="test" depends="dist">
<mkdir dir="${build.test}"/>
<javac includeantruntime="false" classpath="${build.main}" classpathref="build.classpath"
srcdir="${src.test}" destdir="${build.test}"/>
</target>
<target name="clean">
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
</project>