-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
110 lines (94 loc) · 3.34 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
<?xml version="1.0" encoding="utf-8"?>
<project default="jar">
<basename property="project" file="${basedir}"/>
<property name="app.src" location="src"/>
<property name="app.derived" location="derived"/>
<property name="derived.classes" location="${app.derived}/classes"/>
<property name="derived.jar" location="${app.derived}/${project}.jar"/>
<property name="derived.javadoc" location="${app.derived}/javadoc"/>
<property name="derived.student" location="${app.derived}/student/${project}"/>
<path id="class.path">
<fileset dir="lib">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
</fileset>
</path>
<target name="compile">
<mkdir dir="${derived.classes}"/>
<javac srcdir="${app.src}" destdir="${derived.classes}" debug="true" includeantruntime="true">
<classpath refid="class.path"/>
<compilerarg value="-Xlint:all"/>
<!-- <compilerarg value="-Werror"/> -->
</javac>
</target>
<target name="jar" depends="compile">
<jar destfile="${derived.jar}" basedir="${derived.classes}" includes="**/*.class"/>
</target>
<target name="unit_test" depends="jar">
<junit>
<classpath refid="class.path"/>
<classpath>
<pathelement location="${derived.jar}"/>
</classpath>
<formatter type="brief" usefile="false"/>
<sysproperty key="java.awt.headless" value="true"/>
<test name="${testcase}" if="testcase"/>
<batchtest unless="testcase">
<fileset dir="${derived.classes}" includes="**/*Test.class"/>
</batchtest>
</junit>
</target>
<target name="student" depends="jar">
<copy todir="${derived.student}">
<fileset file="build.xml"/>
</copy>
<copy todir="${derived.student}/src">
<fileset dir="${app.src}">
<exclude name="**/staff/**"/>
</fileset>
</copy>
<copy todir="${derived.student}/bin">
<fileset dir="bin"/>
</copy>
<apply executable="chmod" parallel="true">
<arg value="+x"/>
<fileset dir="${derived.student}/bin"/>
</apply>
<copy todir="${derived.student}/lib">
<fileset dir="lib"/>
</copy>
<copy file="${derived.jar}" tofile="${derived.student}/lib/${project}-staff.jar"/>
</target>
<target name="javadoc">
<javadoc sourcepath="src" destdir="${derived.javadoc}">
<classpath refid="class.path"/>
</javadoc>
</target>
<target name="dist">
<exec executable="scp">
<arg value="-r"/>
<arg value="handout/${project}.html"/>
<arg value="ssh.cs.brown.edu:/course/cs032/www/docs/${project}/index.html"/>
</exec>
<exec executable="scp">
<arg value="-r"/>
<arg value="handout/${project}.jpg"/>
<arg value="ssh.cs.brown.edu:/course/cs032/www/docs/${project}/${project}.jpg"/>
</exec>
</target>
<target name="clean">
<delete dir="${app.derived}"/>
</target>
<target name="system_test" depends="compile,jar">
<exec executable="sh">
<arg value="-c"/>
<arg value="python /course/cs032/bin/tester.py -t5.0 -aTime: bin/${project} /course/cs032/data/suites/stars-student/*"/>
</exec>
</target>
<target name="skortchm_system_test" depends="compile,jar">
<exec executable="sh">
<arg value="-c"/>
<arg value="python /course/cs032/bin/tester.py -t5.0 -aTime: bin/${project} ./data/suites/skortchm_system_tests/*"/>
</exec>
</target>
</project>