-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.xml
211 lines (174 loc) · 6.27 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<?xml version="1.0"?>
<!--
File: build.xml
Copyright (C) 2006 Steve Ratcliffe
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Author: Steve Ratcliffe
Create date: 26 Nov 2006
-->
<project name="mkgmap" default="dist" basedir=".">
<!-- Init -->
<property name="top" value="."/>
<property file="${top}/external.properties"/>
<property name="build" value="build"/>
<property name="dist" value="dist"/>
<property name="build.classes" value="${build}/classes"/>
<property name="build.test" value="${build}/test"/>
<property name="src" value="src"/>
<property name="test" value="test"/>
<property name="doc" value="doc"/>
<property name="javadoc" value="${doc}/api"/>
<property name="resources" value="resources"/>
<property name="jars" value="/opt/jars"/>
<property name="junit.jar" value="${jars}/junit-4.5/junit-4.5.jar"/>
<!-- A place to keep a local copy of the test input data. The test files
are large and so are not kept in svn. If you don't set this then they
will be downloaded.
You can set it in the external.properties file too.
-->
<property name="test.input.cache" value="/opt/data/testinput"/>
<!-- For class paths -->
<path id="main">
<pathelement location="${build.classes}" />
</path>
<path id="test">
<pathelement location="test/resources"/>
<pathelement location="build/test"/>
<pathelement location="${junit.jar}"/>
<path refid="main"/>
<pathelement location="test"/>
</path>
<!-- Prepare - make all the directories -->
<target name="prepare">
<mkdir dir="${build.classes}" />
</target>
<!-- Compile the product itself (no tests). -->
<target name="compile" depends="prepare" description="main compilation">
<javac srcdir="${src}" destdir="${build.classes}" target="1.5" debug="true">
<include name="**/*.java" />
<classpath refid="main"/>
<!-- <compilerarg value="-Xlint:unchecked"/> -->
<exclude name="**/reader/dem/optional/*.java"/>
</javac>
</target>
<!-- Build into the build direcotory. All resource files are copied in. -->
<target name="build" depends="compile" >
<copy todir="${build.classes}">
<fileset dir="${resources}">
<include name="*.csv"/>
<include name="*.properties"/>
<include name="*.xml"/>
<include name="**/*.trans"/>
<include name="styles/**"/>
<include name="help/**"/>
<exclude name="**/.*"/>
</fileset>
<fileset dir="src">
<include name="**/*.properties"/>
</fileset>
</copy>
</target>
<!-- Compile the test classes -->
<target name="build-test" depends="build">
<mkdir dir="${build.test}" />
<javac srcdir="${test}" destdir="${build.test}" target="1.5" debug="true">
<include name="**/*.java" />
<classpath refid="test"/>
</javac>
</target>
<target name="test" depends="build-test" description="Run the junit tests">
<mkdir dir="tmp/report"/>
<junit printsummary="yes">
<formatter type="plain"/>
<classpath refid="test"/>
<assertions>
<enable/>
</assertions>
<batchtest fork="yes" todir="tmp/report">
<fileset dir="test">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="obtain-test-input-files" description="download the input files for the functional tests">
<!-- Local cache, if it doesn't exist then it is not a problem the files
will be downloaded in the next step -->
<copy todir="test/resources/in" failonerror="false">
<fileset dir="${test.input.cache}" includes="**"/>
</copy>
<mkdir dir="test/resources/in/osm"/>
<mkdir dir="test/resources/in/mp"/>
<mkdir dir="test/resources/in/img"/>
<get src="http://www.mkgmap.org.uk/testinput/osm/lon1.osm.gz"
dest="test/resources/in/osm/lon1.osm.gz" usetimestamp="true"
ignoreerrors="true"/>
<get src="http://www.mkgmap.org.uk/testinput/osm/uk-test-1.osm.gz"
dest="test/resources/in/osm/uk-test-1.osm.gz" usetimestamp="true"
ignoreerrors="true"/>
<get src="http://www.mkgmap.org.uk/testinput/osm/uk-test-2.osm.gz"
dest="test/resources/in/osm/uk-test-2.osm.gz" usetimestamp="true"
ignoreerrors="true"/>
<get src="http://www.mkgmap.org.uk/testinput/mp/test1.mp"
dest="test/resources/in/mp/test1.mp" usetimestamp="true"
ignoreerrors="true"/>
<get src="http://www.mkgmap.org.uk/testinput/img/63240001.img"
dest="test/resources/in/img/63240001.img" usetimestamp="true"
ignoreerrors="true"/>
<get src="http://www.mkgmap.org.uk/testinput/img/63240002.img"
dest="test/resources/in/img/63240002.img" usetimestamp="true"
ignoreerrors="true"/>
</target>
<target name="dist" depends="build"
description="Make the distribution area">
<mkdir dir="${dist}"/>
<mkdir dir="${dist}/doc/api"/>
<!-- Make the jar -->
<jar basedir="${build.classes}" jarfile="${dist}/mkgmap.jar"
manifest="${resources}/MANIFEST.MF">
<include name="**/*.class"/>
<include name="*.csv"/>
<include name="*.xml"/>
<include name="*.properties"/>
<include name="**/*.trans"/>
<include name="styles/**"/>
<include name="help/**"/>
</jar>
<copy todir="${dist}/doc" >
<fileset dir="doc" includes="*.txt, Credits, mkgmap.1"/>
</copy>
<!-- misc -->
<copy todir="${dist}" >
<fileset dir="${basedir}">
<include name="README"/>
<include name="LICENCE*"/>
<include name="build.xml"/>
<include name="external.properties"/>
<include name="resources/**"/>
</fileset>
</copy>
</target>
<target name="javadoc" description="Create the javadoc">
<mkdir dir="doc"/>
<javadoc destdir="${javadoc}">
<fileset dir="${src}" includes="**/*.java"/>
<classpath refid="main"/>
</javadoc>
</target>
<!-- Clean everything -->
<target name="clean">
<delete dir="${build}" />
<delete dir="tmp"/>
</target>
<!-- Clobber all generated and built files -->
<target name="clobber" depends="clean">
<delete dir="${dist}" />
</target>
<target name="rebuild" depends="clean, build" />
</project>