-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildJar.xml
76 lines (69 loc) · 2.68 KB
/
buildJar.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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="jar" name="Create Runnable Jar for Project MazeSolver">
<property environment="env" />
<condition property="jarfile" value="MicroMouse-r${env.SVN_REVISION}.jar" else="MicroMouse.jar">
<isset property="env.SVN_REVISION" />
</condition>
<property name="build.dir" value="build/classes" />
<property name="test.dir" value="build/test/" />
<property name="test.report" value="build/report" />
<property name="version.file" location="${build.dir}/maze/build.properties" />
<condition property="version.revision" value="${env.SVN_REVISION}" else="Unknown">
<isset property="env.SVN_REVISION" />
</condition>
<path id="MazeSolver.classpath">
<pathelement location="${build.dir}" />
<pathelement location="${test.dir}" />
<pathelement location="lib/rsyntaxtextarea.jar" />
<pathelement location="lib/jython.jar" />
<pathelement location="lib/junit-4.6.jar" />
</path>
<target name="clean">
<delete dir="build" />
<delete file="${jarfile}" />
<delete dir="." includes="MicroMouse*.jar" />
</target>
<target name="init" depends="clean">
<mkdir dir="${build.dir}" />
<mkdir dir="${test.dir}" />
<mkdir dir="${test.report}" />
<copy includeemptydirs="false" todir="${build.dir}">
<fileset dir="src" excludes="**/*.launch, **/*.java" />
</copy>
<tstamp />
<echo file="${version.file}">date: ${TODAY}</echo>
<echo file="${version.file}" append="true">
revision: ${version.revision}
</echo>
</target>
<target name="build" depends="init" description="Compile source files.">
<javac debug="false" destdir="${build.dir}" source="1.6" target="1.6">
<src path="src" />
<classpath refid="MazeSolver.classpath" />
</javac>
<javac debug="false" destdir="${test.dir}" source="1.6" target="1.6">
<src path="test" />
<classpath refid="MazeSolver.classpath" />
</javac>
</target>
<target name="test" depends="build" description="Run Junit tests">
<junit printsummary="true" haltonfailure="false">
<classpath refid="MazeSolver.classpath" />
<formatter type="xml" />
<batchtest todir="${test.report}">
<fileset dir="${test.dir}" includes="**/*Test.class" />
</batchtest>
</junit>
</target>
<target name="jar" depends="test">
<jar destfile="${jarfile}" filesetmanifest="mergewithoutmain">
<manifest>
<attribute name="Main-Class" value="maze.Main" />
<attribute name="Class-Path" value="." />
</manifest>
<fileset dir="${build.dir}" />
<zipfileset excludes="META-INF/*.SF" src="lib/rsyntaxtextarea.jar" />
<zipfileset excludes="META-INF/*.SF" src="lib/jython.jar" />
</jar>
</target>
</project>