-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
92 lines (78 loc) · 2.71 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
<project name="Game31" basedir="." default="main">
<property name="src.dir" value="src"/>
<property name="build.dir" value="build"/>
<property name="lib.dir" value="lib" />
<property name="conf.dir" value="${build.dir}/conf"/>
<property name="bin.dir" value="${build.dir}/bin"/>
<property name="jar.dir" value="${build.dir}/jar"/>
<property name="reports.dir" value="${build.dir}/reports" />
<property name="main-class" value="src.main.java.game31.Main"/>
<path id="classpath">
<pathelement location="${bin.dir}" />
<pathelement location="${src.dir}" />
<fileset dir="${lib.dir}" includes="*.jar" />
</path>
<target name="main" depends="addresources"/>
<!-- Cleanup working directory -->
<target name="clean">
<delete dir="${bin.dir}"/>
<delete dir="${jar.dir}"/>
<delete dir="${reports.dir}"/>
</target>
<!-- Compile source -->
<target name="compile" depends="clean">
<mkdir dir="${bin.dir}"/>
<javac srcdir="${src.dir}" destdir="${bin.dir}" debug="true" deprecation="on" includeantruntime="false">
<classpath refid="classpath" />
</javac>
</target>
<!-- Extract external libraries -->
<target name="extractlib" depends="compile">
<unzip dest="${bin.dir}">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
<exclude name="**/HUSACCT*"/>
<exclude name="**/junit*"/>
</fileset>
</unzip>
</target>
<!-- Run test classes -->
<target name="test" depends="extractlib">
<junit fork="yes" printsummary="on" haltonfailure="yes">
<!-- Project classpath, must include junit.jar -->
<classpath>
<path refid="classpath" />
</classpath>
<formatter type="brief" usefile="false" />
<test name="test.java.unit.KaartStapelTest" haltonfailure="yes"/>
</junit>
</target>
<!-- Run SACC test to compare implemented to intended architecture-->
<target name="sacc" depends="test">
<junit fork="yes" printsummary="on" haltonfailure="yes">
<!-- Project classpath, must include junit.jar -->
<classpath>
<path refid="classpath" />
</classpath>
<formatter type="brief" usefile="false" />
<test name="test.java.sacc.SoftwareArchitectureComplianceCheck" haltonfailure="yes"/>
</junit>
</target>
<!-- Create runnable Jars -->
<target name="jar" depends="sacc">
<mkdir dir="${jar.dir}"/>
<jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${bin.dir}" excludes="husacct/**">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
</jar>
</target>
<!-- Add resources -->
<target name="addresources" depends="jar">
<jar jarfile="${jar.dir}/${ant.project.name}.jar" update="true">
<fileset dir="${src.dir}" >
<include name="src/main/resources/**/*" />
</fileset>
</jar>
</target>
</project>