forked from stadt-bielefeld/auik
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
403 lines (385 loc) · 20.8 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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
<project name="AUIK" default="compile" basedir=".">
<description>
Buildfile for project AUIK
</description>
<!-- Some properties for necessary path definitions -->
<property name="root" location="." />
<property name="src" location="src" />
<property name="lib" location="lib" />
<property name="bin" location="bin" />
<property name="dist" location="dist" />
<property name="javadoc" location="javadoc" />
<property name="test" location="test" />
<property name="data" location="data" />
<property name="resources"
value="${src}/de/bielefeld/umweltamt/aui/resources" />
<property name="config" value="${resources}/config" />
<property name="reports" value="${resources}/reports" />
<property name="gen.mappings"
value="/de/bielefeld/umweltamt/aui/mappings/generated" />
<!-- The classpath that includes the necessary external libs and AUIK -->
<path id="classpath">
<fileset dir="${lib}">
<include name="**/*.jar" />
</fileset>
<path location="${bin}" />
<path location="${config}" /> <!-- Add config path for log4j -->
</path>
<!-- =================================================================== -->
<!-- Generate hibernate stuff -->
<!-- In: hibernate.properties, hibernate.reveng.xml -->
<!-- Out: [0] ${src}/[package]/{class-name}.hbm.xml, -->
<!-- [1] ${config}/generated/hibernate.cfg.xml [1], -->
<!-- [2] ${src}/[package]/{class-name}.java, -->
<!-- =================================================================== -->
<target name="db2hbmxml"
description="Generate hibernate xml files from database via reverse
engineering">
<taskdef name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="classpath" />
<hibernatetool destdir="${src}">
<jdbcconfiguration
propertyfile="${config}/hibernate.properties"
revengfile="${config}/hibernate.reveng.xml">
</jdbcconfiguration>
<hbm2hbmxml /> <!-- [0] -->
<hbm2cfgxml destdir="${config}/generated" /> <!-- [1] -->
</hibernatetool>
</target>
<target name="db2java"
description="Generate java mapping classes from database via reverse
engineering">
<taskdef name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="classpath" />
<hibernatetool destdir="${src}">
<jdbcconfiguration
propertyfile="${config}/hibernate.properties"
revengfile="${config}/hibernate.reveng.xml">
</jdbcconfiguration>
<!-- This (below) is a costum version of hbm2java /-->
<!-- [2] -->
<hbmtemplate
templatepath="${data}/templates/auik"
template="Pojo.ftl"
filepattern="{package-name}/{class-name}.java">
<property key="jdk5" value="true" />
<property key="ejb3" value="false" />
</hbmtemplate>
<!-- [2] old -->
<!-- hbmtemplate
templatepath="${data}/templates/pojo"
template="AuikPojo.ftl"
filepattern="{package-name}/Abstract{class-name}.java">
<property key="jdk5" value="true" />
<property key="ejb3" value="false" />
</hbmtemplate -->
<!-- [3] old -->
<!-- This (below) is a costum version of hbm2dao /-->
<!-- hbmtemplate
templatepath="${data}/templates/dao"
template="AuikDaoHome.ftl"
filepattern="{package-name}/{class-name}.java">
<property key="jdk5" value="true" />
<property key="ejb3" value="false" />
<property key="sessionFactoryName" value="SessionFactory" />
</hbmtemplate -->
<!-- hbm2ddl wrong direction... ;-) / -->
</hibernatetool>
</target>
<!-- =================================================================== -->
<!-- Compile the source -->
<!-- =================================================================== -->
<target name="compile" description="Compile the source">
<mkdir dir="${bin}" />
<javac srcdir="${src}" destdir="${bin}" classpathref="classpath"
debug="on" debuglevel="lines,vars,source" />
<copy todir="${bin}">
<fileset dir="${src}">
<include name="**/*.png" />
<include name="**/*.jpg" />
<include name="**/*.gif" />
<include name="**/*.xml" />
<include name="**/*.properties" />
<include name="**/*.txt" />
<include name="**/*.jasper" />
<include name="**/*.rptdesign" />
</fileset>
</copy>
</target>
<!-- =================================================================== -->
<!-- Compile the jasper reports -->
<!-- =================================================================== -->
<target name="jasper" depends="compile">
<taskdef name="jrc"
classname="net.sf.jasperreports.ant.JRAntCompileTask">
<classpath refid="classpath" />
</taskdef>
<jrc
destdir="${reports}"
tempdir="${reports}">
<src>
<fileset dir="${reports}">
<include name="**/*.jrxml" />
</fileset>
</src>
<classpath refid="classpath" />
</jrc>
</target>
<!-- =================================================================== -->
<!-- Create a jar archive and fill its manifest -->
<!-- =================================================================== -->
<target name="dist" depends="compile"
description="Create a jar archive">
<mkdir dir="${dist}" />
<!-- Set some properties for the manifest -->
<tstamp><format property="TODAY" pattern="yyyy-MM-dd" /></tstamp>
<loadfile property="auik.authors"
srcfile="${resources}/authors.txt" />
<!-- echo message="${auik.authors}" / -->
<jar
destfile="${dist}/${TODAY} AUIK.jar"
basedir="${bin}"
filesetmanifest="skip"
update="true">
<!-- filesetmanifest="mergewithoutmain" -->
<manifest>
<attribute name="Built-By" value="${user.name}" />
<attribute name="Built-Date" value="${TODAY}" />
<attribute
name="Main-Class"
value="de.bielefeld.umweltamt.aui.AUIKataster" />
<attribute
name="Specification-Title"
value="Anlagen- und Indirekteinleiter Kataster" />
<attribute
name="Specification-Version"
value="0.0" />
<!-- Do we even have an official specification? -->
<attribute
name="Specification-Vendor"
value="Stadt Bielefeld, Umweltamt" />
<attribute
name="Implementation-Title"
value="Anlagen- und Indirekteinleiter Kataster" />
<!--<attribute
name="Implementation-Version"
value="Version ${auik.version}" /> -->
<attribute
name="Implementation-Vendor"
value="Stadt Bielefeld und Intevation GmbH" />
<attribute
name="Implementation-URL"
value="http://wald.intevation.org/projects/auik/" />
</manifest>
<!-- TODO: Something more like this, but still with extracting jars
<fileset dir="${libs}">
<include name="**/*.jar" />
</fileset>
-->
<zipfileset excludes="META-INF/*.SF" src="${lib}/antlr-2.7.7.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/aopalliance-repackaged-2.4.0-b34.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/asm-5.1.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/asm-debug-all-5.1.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/axis.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/axis-wsdl4j-1.5.1.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/c3p0-0.9.5.2.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/cglib-3.2.2.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/com.jgoodies.uif_lite.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/commons-beanutils-1.9.2.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/commons-cli-1.3.1.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/commons-codec-1.3.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/commons-collections-3.2.2.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/commons-digester-1.7.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/commons-discovery-0.5.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/commons-logging-1.2.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/concurrent-1.3.4.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/connector.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/dom4j-1.6.1.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/ehcache-3.0.0.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/forms-1.0.5.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/groovy-2.4.6.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/hibernate-commons-annotations-5.0.0.Final.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/hibernate-core-5.0.0.Final.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/hibernate-jpa-2.1-api-1.0.0.Final.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/hibernate-search-engine-5.4.0.Final.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/hibernate-search-orm-5.4.0.Final.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/hk2-api-2.4.0-b34.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/hk2-locator-2.4.0-b34.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/hk2-utils-2.4.0-b31.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/icu4j-57_1.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/iText-2.1.7.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/jackson-annotations-2.7.0.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/jackson-core-2.7.4.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/jackson-databind-2.7.4.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/jackson-jaxrs-base-2.7.4.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/jackson-jaxrs-json-provider-2.7.4.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/jackson-module-jaxb-annotations-2.7.4.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/jasperreports-6.2.2.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/jasperreports-fonts-6.2.2.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/javassist-3.18.1-GA.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/javax.annotation-api-1.2.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/javax.inject-2.4.0-b34.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/javax.servlet-api-3.0.1.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/javax.ws.rs-api-2.0.1.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/jaxb-api-2.2.7.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/jaxrpc.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/jboss-logging-3.3.0.Final.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/jcalendar.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/jcommon-1.0.23.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/jdbc2_0-stdext.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/jersey-client.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/jersey-common.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/jersey-container-servlet-core.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/jersey-container-servlet.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/jersey-entity-filtering-2.22.1.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/jersey-guava-2.22.2.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/jersey-media-jaxb.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/jersey-media-json-jackson-2.22.1.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/jersey-server.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/jfreechart-1.0.19.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/jta.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/junit-4.10.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/l2fprod-common-all.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/log4j-1.2-api-2.5.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/log4j-api-2.5.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/log4j-core-2.5.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/looks-1.2.2.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/lucene-analyzers-common-4.10.4.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/lucene-core-4.10.4.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/org.osgi.core-4.2.0.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/oscache-2.4.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/osgi-resource-locator-1.0.1.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/persistence-api-1.0.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/postgresql-9.4.1208.jre7.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/proxool-0.9.1.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/sac-1.3.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/validation-api-1.1.0.Final.jar"/>
<zipfileset excludes="META-INF/*.SF" src="${lib}/xml-apis-1.3.03.jar"/>
</jar>
</target>
<!-- =================================================================== -->
<!-- Clean up (${bin}, ${dist}, ${test}) -->
<!-- =================================================================== -->
<target name="clean"
description="Clean up everything but the directory that contains the
documentation and the previous 'yyyy-MM-dd AUIK.jar's">
<!-- delete dir="${bin}" / -->
<delete file="${dist}/AUIK.jar" />
<delete>
<fileset dir="${dist}/" includes="**/*AUIK.jar" />
</delete>
<delete file="${dist}/auik.properties" />
<!-- delete file="${config}/generated/hibernate.cfg.xml" / -->
<delete>
<fileset dir="${src}/${gen.mappings}" includes="**/*.hbm.xml" />
<fileset dir="${src}/${gen.mappings}" includes="**/*.java" />
</delete>
</target>
<!-- =================================================================== -->
<!-- Clean up everything -->
<!-- =================================================================== -->
<target name="cleanall" depends="clean" description="Clean up everything">
<delete dir="${javadoc}" />
<!--
<delete dir="${dist}" />
<delete>
<fileset dir="${src}/${reports}" includes="**/*.jasper" />
</delete>
-->
</target>
<!-- =================================================================== -->
<!-- Run the application -->
<!-- =================================================================== -->
<target name="run" depends="compile,jasper"
description="Run the application">
<java
classname="de.bielefeld.umweltamt.aui.AUIKataster"
classpathref="classpath"
fork="true"
/>
</target>
<!-- =================================================================== -->
<!-- Run the application from the jar archive -->
<!-- =================================================================== -->
<target name="runjar" depends="dist"
description="Run the application from the jar archive">
<tstamp><format property="TODAY" pattern="yyyy-MM-dd" /></tstamp>
<java jar="${dist}/${TODAY} AUIK.jar" fork="true" />
</target>
<!-- =================================================================== -->
<!-- Generate javadoc -->
<!-- =================================================================== -->
<target name="javadoc" depends="compile"
description="Creates JavaDoc for this application">
<mkdir dir="${javadoc}" />
<javadoc destdir="${javadoc}" author="true" version="true" use="true">
<!-- TODO: Get this to work under windows... -->
<!-- executable="C:\Programme\Java\jdk1.6.0_33\bin\javac.exe" -->
<fileset dir="${src}">
<include name="**/*.java" />
</fileset>
</javadoc>
</target>
<!-- =================================================================== -->
<!-- Get the latest tag and revision from the SVN and build the version -->
<!-- number from them: <version> = <tag>-rev<revision> -->
<!-- =================================================================== -->
<target name="version"
description="Get the current tag and revision from the SVN and save it
to the version number.">
<exec
executable="C:\appz\cygwin\bin\bash.exe"
outputproperty="auik.tag"
osfamily="windows">
<arg value="--login" />
<arg value="/cygdrive/d/Data/workspace/auik_pg/data/scripts/shell/getLatestTag.sh" />
</exec>
<exec
executable="./scripts/shell/getLatestTag.sh"
outputproperty="auik.tag"
osfamily="unix">
</exec>
<exec
executable="C:\appz\cygwin\bin\svnversion.exe"
outputproperty="auik.revision"
osfamily="windows"
/>
<exec
executable="svnversion"
outputproperty="auik.revision"
osfamily="unix"
/>
<property name="auik.version" value="${auik.tag}-rev${auik.revision}" />
<echo message="Version was set to '${auik.version}'." level="info" />
</target>
<!-- =================================================================== -->
<!-- This is just me testing and lerning ant here! -->
<!-- =================================================================== -->
<target name="Connz Target"
description="Testing Tasks">
<echo message="error" level="error" />
<echo message="warning" level="warning" />
<echo message="info" level="info" />
<echo message="verbose" level="verbose" />
<echo message="debug" level="debug" />
<tstamp><format property="TODAY" pattern="yyyyMMdd" /></tstamp>
<echo message="${TODAY}" />
<javac
srcdir="${test}" destdir="${bin}">
<classpath>
<path refid="classpath" />
<pathelement path="bin" />
</classpath>
</javac>
<junit printsummary="true" showoutput="true" fork="false">
<classpath>
<path refid="classpath" />
<pathelement path="bin" />
</classpath>
<formatter type="plain" />
<test name="de.bielefeld.umweltamt.aui.utils.KommaDoubleTest" />
</junit>
</target>
</project>