forked from charig/TruffleMATE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
134 lines (118 loc) · 5.66 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
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
<project name="som" basedir="." default="compile">
<property name="src.dir" value="src"/>
<property name="src.dirMate" value="MateExtensions"/>
<property name="src_gen.dir" value="src_gen"/>
<property name="lib.dir" value="libs" />
<property name="truffle.dir" value="${lib.dir}/truffle" />
<property name="truffle.build" value="${truffle.dir}/mxbuild/dists" />
<property name="junit.version" value="4.12" />
<property name="build.dir" value="build"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="checkstyle.version" value="6.17" />
<path id="project.classpath">
<pathelement location="${classes.dir}" />
<pathelement location="tests/" />
<pathelement location="${lib.dir}/junit-${junit.version}.jar" />
<pathelement location="${lib.dir}/hamcrest-core-1.3.jar" />
<pathelement location="${lib.dir}/gson-2.7.jar" />
<pathelement location="${truffle.build}/truffle-api.jar" />
<pathelement location="${truffle.build}/truffle-dsl-processor.jar" />
<pathelement location="${truffle.build}/truffle-debug.jar" />
<pathelement location="${truffle.build}/truffle-tck.jar" />
<pathelement location="${lib.dir}/websocket/dist/websocket.jar" />
<pathelement location="${lib.dir}/json/build/minimal-json.jar" />
</path>
<target name="clean" description="Remove build directories and generated code">
<delete dir="${build.dir}"/>
<delete dir="${src_gen.dir}"/>
</target>
<target name="clobber" description="Do clean, and also clean truffle build" depends="clean">
<exec executable="../mxtool/mx" dir="${truffle.dir}">
<arg value="clean"/>
</exec>
</target>
<target name="check-core-lib-available">
<available file="core-lib/.git" property="core-lib.present"/>
</target>
<target name="core-lib" depends="check-core-lib-available"
unless="core-lib.present">
<exec executable="git">
<arg value="submodule" />
<arg value="update" />
<arg value="--init" />
</exec>
</target>
<target name="truffle-libs" >
<exec executable="../mxtool/mx" dir="${truffle.dir}">
<arg value="build"/>
</exec>
</target>
<target name="websocket-lib" depends="core-lib">
<subant buildpath="libs/websocket" target="jar" failonerror="true" />
</target>
<target name="minimal-json-lib" depends="core-lib">
<subant buildpath="libs/json" target="jar" failonerror="true" />
</target>
<target name="libs" depends="core-lib, truffle-libs, websocket-lib, minimal-json-lib">
<get src="https://repo1.maven.org/maven2/junit/junit/${junit.version}/junit-${junit.version}.jar"
usetimestamp="true"
dest="${lib.dir}/junit-${junit.version}.jar" />
<get src="https://repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"
usetimestamp="true"
dest="${lib.dir}/hamcrest-core-1.3.jar" />
<get src="https://repo1.maven.org/maven2/com/google/code/gson/gson/2.7/gson-2.7.jar"
usetimestamp="true"
dest="${lib.dir}/gson-2.7.jar" />
</target>
<target name="checkstyle-jar">
<get src="http://tenet.dl.sourceforge.net/project/checkstyle/checkstyle/${checkstyle.version}/checkstyle-${checkstyle.version}-all.jar"
usetimestamp="true"
dest="${lib.dir}/checkstyle-${checkstyle.version}-all.jar" />
</target>
<target name="checkstyle" depends="checkstyle-jar" description="Check Code with Checkstyle">
<taskdef resource="com/puppycrawl/tools/checkstyle/ant/checkstyle-ant-task.properties" classpath="${lib.dir}/checkstyle-${checkstyle.version}-all.jar" />
<checkstyle config=".checkstyle_checks.xml">
<fileset dir="src" includes="**/*.java"/>
<formatter type="plain"/>
</checkstyle>
</target>
<target name="compile" depends="libs" description="Compile TruffleSOM">
<mkdir dir="${build.dir}"/>
<mkdir dir="${classes.dir}" />
<mkdir dir="${src_gen.dir}" />
<javac includeantruntime="false" destdir="${classes.dir}" debug="true">
<src path="${src.dir}"/>
<src path="${src.dirMate}"/>
<classpath refid="project.classpath" />
<compilerarg line="-s ${src_gen.dir}" />
<compilerarg line="-XDignore.symbol.file" />
<compilerarg line="-Xlint:all" />
</javac>
<javac includeantruntime="false" srcdir="${src_gen.dir}" destdir="${classes.dir}" debug="true">
<classpath refid="project.classpath" />
<compilerarg line="-s ${src_gen.dir}" />
<compilerarg line="-Xlint:all" />
</javac>
<javac includeantruntime="false" srcdir="tests/" destdir="${classes.dir}" debug="true">
<classpath refid="project.classpath" />
</javac>
</target>
<target name="jar" depends="compile" description="Package as JAR">
<jar destfile="${build.dir}/som.jar" basedir="${classes.dir}"></jar>
</target>
<target name="test" depends="compile" description="Execute tests">
<junit haltonerror="false" haltonfailure="false" failureproperty="test.failed"
outputtoformatters="true">
<jvmarg value="-ea" />
<jvmarg value="-esa" />
<classpath refid="project.classpath" />
<batchtest fork="yes" filtertrace="false">
<fileset dir="tests">
<include name="**/*Test*.java"/>
</fileset>
</batchtest>
<formatter type="brief" usefile="false"/>
</junit>
</target>
<target name="tests" depends="test" />
</project>