-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathbuild.xml
126 lines (111 loc) · 4.83 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
<project name="som" basedir="." default="compile">
<property name="src.dir" value="src"/>
<property name="test.dir" value="tests"/>
<property name="lib.dir" value="libs" />
<property name="build.dir" value="build"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="junit.version" value="4.12" />
<property name="checkstyle.version" value="8.36" />
<property environment="env"/>
<path id="project.classpath">
<pathelement location="${classes.dir}" />
<pathelement location="${test.dir}" />
<pathelement location="${lib.dir}/junit-${junit.version}.jar" />
<pathelement location="${lib.dir}/hamcrest-core-1.3.jar" />
</path>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="eclipseformat">
<pathconvert pathsep=" " property="javafiles">
<fileset dir="${src.dir}">
<include name="**/*.java"/>
</fileset>
<fileset dir="${test.dir}">
<include name="**/*.java"/>
</fileset>
</pathconvert>
<exec executable="${env.ECLIPSE_EXE}" dir="${basedir}">
<arg value="-nosplash"/>
<arg value="-application"/>
<arg value="-consolelog"/>
<arg value="-data"/>
<arg value="${basedir}"/>
<arg value="-vm"/>
<arg value="${env.JAVA_HOME}/bin/java"/>
<arg value="org.eclipse.jdt.core.JavaCodeFormatter"/>
<arg value="-config"/>
<arg value="${basedir}/.settings/org.eclipse.jdt.core.prefs"/>
<arg line="${javafiles}"/>
</exec>
<exec executable="git" dir="${basedir}" failonerror="true">
<arg value="status" />
<arg value="*.java" />
</exec>
<exec executable="git" dir="${basedir}" failonerror="true">
<arg value="diff-index" />
<arg value="--quiet" />
<arg value="HEAD" />
</exec>
</target>
<target name="libs">
<mkdir dir="${lib.dir}" />
<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" />
</target>
<target name="checkstyle-jar">
<mkdir dir="${lib.dir}" />
<get src="https://github.com/checkstyle/checkstyle/releases/download/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">
<mkdir dir="${classes.dir}" />
<javac includeantruntime="false" srcdir="${src.dir}" destdir="${classes.dir}" debug="true" />
<javac includeantruntime="false" srcdir="${test.dir}" destdir="${classes.dir}" debug="true">
<classpath refid="project.classpath" />
</javac>
</target>
<target name="jar" depends="compile">
<mkdir dir="${build.dir}"/>
<jar destfile="${build.dir}/som.jar" basedir="${classes.dir}">
</jar>
</target>
<target name="unit-tests" 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"/>
<include name="**/*TCK.java"/>
<exclude name="dym"/>
</fileset>
</batchtest>
<formatter type="brief" usefile="false"/>
</junit>
<java classname="som.vm.Universe" fork="true" failonerror="true">
<classpath refid="project.classpath" />
<jvmarg value="-ea" />
<jvmarg value="-esa" />
<arg line="-cp Smalltalk TestSuite/TestHarness.som" />
</java>
<fail message="Basic tests failed." if="test.failed" />
</target>
<target name="test" depends="unit-tests">
</target>
<target name="tests" depends="test" />
</project>