-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.xml
116 lines (93 loc) · 3.62 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="SPREAD" default="help" basedir=".">
<property name="build.sysclasspath" value="last" />
<property name="Main-Class" value="app.SpreadApp" />
<property name="JDK_VERSION" value="1.6" />
<property name="src" location="src"/>
<property name="buildDir" location="classes" />
<property name="dist" location="dist" />
<property name="lib" location="lib" />
<property name="report" location="${buildDir}/junitreport" />
<target name="help">
<echo message="Common build targets:" />
<echo message="jar - Builds spread.jar" />
<echo message="build - Same as clean+jar" />
<echo message="compile - Compiles spread classes" />
<echo message="clean - Remove all *.class and spread.jar" />
</target>
<path id="classpath">
<pathelement path="." />
<fileset dir="${lib}">
<include name="*.jar" />
</fileset>
<pathelement location="." />
</path>
<target name="build" depends="clean,jar" />
<target name="jar" depends="compile">
<mkdir dir="${dist}" />
<jar jarfile="${dist}/spread.jar">
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Main-Class" value="${Main-Class}" />
<!--<attribute name="Classpath" value="." />-->
</manifest>
<fileset dir="${buildDir}" />
<zipgroupfileset dir="${lib}" includes="colt.jar" />
<zipgroupfileset dir="${lib}" includes="core.jar" />
<zipgroupfileset dir="${lib}" includes="jebl.jar" />
<!-- <zipgroupfileset dir="${lib}" includes="org.boehn.kmlframework_20090320.jar"/> -->
<!-- <zipgroupfileset dir="${lib}" includes="ColorPicker.jar"/> -->
<!-- <zipgroupfileset dir="${lib}" includes="quaqua.jar"/> -->
</jar>
</target>
<target name="compile">
<mkdir dir="${buildDir}" />
<mkdir dir="${buildDir}/icons" />
<mkdir dir="${buildDir}/colorpicker/swing/resources" />
<javac source="1.6" target="1.6" srcdir="${src}" destdir="classes" classpathref="classpath" />
<!--copy icons to icons dir-->
<copy todir="${buildDir}/icons">
<fileset dir="${src}/icons">
<include name="**/*.png" />
</fileset>
</copy>
<!--copy colorpicker resources-->
<copy todir="${buildDir}/colorpicker/swing/resources">
<fileset dir="${src}/colorpicker/swing/resources">
<include name="**/*.properties" />
</fileset>
</copy>
<!--copy map background to templates dir-->
<copy file="${src}/templates/world_map.png" todir="classes/templates" />
</target>
<target name="clean">
<delete dir="${buildDir}" />
<delete dir="${dist}" />
</target>
<!-- JUnit test -->
<target name="junit" depends="compile">
<mkdir dir="${report}" />
<junit printsummary="yes">
<!--showoutput='yes'-->
<classpath>
<path refid="classpath" />
<path location="${buildDir}" />
</classpath>
<formatter type="xml" />
<batchtest fork="yes" todir="${report}">
<fileset dir="${src}">
<include name="test/**/*Test.java" />
<exclude name="test/templates/SpatialStatsToTerminalTest.java"/>
</fileset>
</batchtest>
</junit>
<echo message="JUnit test finished." />
</target>
<target name="junitreport">
<junitreport todir="${report}">
<fileset dir="${report}" includes="*.xml" />
<report format="frames" todir="${report}" />
</junitreport>
<echo message="JUnit test report finished." />
</target>
</project>