This repository has been archived by the owner on May 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
/
build.xml
409 lines (356 loc) · 19.6 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
403
404
405
406
407
408
409
<?xml version="1.0" encoding="UTF-8"?>
<project name="mapstore" default="dist" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<description>
MapStore Build File
</description>
<property name="composerbuild" location="mapcomposer/build"/>
<property name="release.dir" location="build"/>
<property name="ringojs.dir" location="externals/ringojs"/>
<property name="ringojs.version" value="0.7.0-geosolutions"/>
<property name="ringojs.run" location="${ringojs.dir}/lib/ringojs-run-${ringojs.version}.jar"/>
<property name="httpproxy.version" value="1.1-SNAPSHOT"/>
<property name="servicebox.version" value="1.5-SNAPSHOT"/>
<property name="mapstore.version" value="1.7-SNAPSHOT"/>
<property name="geostore.version" value="1.3-SNAPSHOT"/>
<property name="geonetwork.version" value="2.6.5-SNAPSHOT"/>
<property name="opensdi2.version" value="1.1-SNAPSHOT"/>
<property name="app.proxy.geoserver" value=""/>
<property name="app.debug.proxy" value="true"/>
<property name="app.port" value="8081"/>
<path id="maven-ant-tasks.classpath" path="lib/maven-ant-tasks-2.1.3.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="antlib:org.apache.maven.artifact.ant"
classpathref="maven-ant-tasks.classpath" />
<target name="checkringo">
<condition property="ringo">
<available file="${ringojs.dir}" type="dir"/>
</condition>
</target>
<target name="init" depends="checkringo" unless="ringo">
<echo message="downloading RingoJS jars"/>
<artifact:remoteRepository id="remote.repository" url="http://maven.geo-solutions.it" />
<artifact:dependencies filesetId="dependency.fileset" useScope="test">
<remoteRepository refid="remote.repository" />
<dependency groupId="org.ringojs" artifactId="ringojs" version="0.7.0-geosolutions"/>
<dependency groupId="org.ringojs" artifactId="ringojs-run" version="0.7.0-geosolutions"/>
</artifact:dependencies>
<copy todir="${ringojs.dir}/lib">
<fileset refid="dependency.fileset" />
<!-- This mapper strips off all leading directory information -->
<mapper type="flatten" />
</copy>
</target>
<target name="buildjs" depends="buildjsdefault,buildjsapp">
</target>
<target name="buildjsapp" depends="init" if="application">
<!-- mapcomposer -->
<mkdir dir="${composerbuild}/${ant.project.name}/WEB-INF/app/static/script"/>
<java jar="${ringojs.run}" fork="true" failonerror="true">
<sysproperty key="ringo.home" path="${ringojs.dir}"/>
<arg path="externals/buildkit/lib/buildkit/build.js"/>
<arg line="-o ${composerbuild}/${ant.project.name}/WEB-INF/app/static/script mapcomposer/app/applications/${application}/buildjs.cfg"/>
</java>
</target>
<target name="buildjsdefault" depends="init">
<delete dir="${composerbuild}"/>
<!-- mapcomposer -->
<mkdir dir="${composerbuild}/${ant.project.name}/WEB-INF/app/static/script"/>
<java jar="${ringojs.run}" fork="true" failonerror="true">
<sysproperty key="ringo.home" path="${ringojs.dir}"/>
<arg path="externals/buildkit/lib/buildkit/build.js"/>
<arg line="-o ${composerbuild}/${ant.project.name}/WEB-INF/app/static/script mapcomposer/buildjs.cfg"/>
</java>
</target>
<target name="dist" depends="test, buildjs, redist, redistapp"/>
<!-- SITE START -->
<target name="site" depends="dist">
<move file="${composerbuild}/${ant.project.name}" tofile="${composerbuild}/mapcomposer"/>
<mkdir dir="${composerbuild}/${ant.project.name}"/>
<!-- site -->
<mkdir dir="${composerbuild}/${ant.project.name}/src"/>
<java jar="${ringojs.run}" fork="true" failonerror="true">
<sysproperty key="ringo.home" path="${ringojs.dir}"/>
<arg path="externals/buildkit/lib/buildkit/build.js"/>
<arg line="-o ${composerbuild}/mapstore/src mapcomposer/app/static/externals/mapmanager/buildjs.cfg"/>
</java>
<!-- MAP MANAGER -->
<!-- copy Ext resources -->
<copy todir="${composerbuild}/${ant.project.name}/lib/ext">
<fileset dir="mapcomposer/app/static/externals/ext">
<exclude name="**/ux/**"/>
</fileset>
</copy>
<!-- copy Lib resources -->
<copy todir="${composerbuild}/${ant.project.name}/lib">
<fileset dir="mapcomposer/app/static/externals/mapmanager/lib"/>
</copy>
<!-- copy theme resources -->
<copy todir="${composerbuild}/${ant.project.name}/theme">
<fileset dir="mapcomposer/app/static/externals/mapmanager/theme"/>
</copy>
<!-- copy i18n resources -->
<copy todir="${composerbuild}/${ant.project.name}/translations">
<fileset dir="mapcomposer/app/static/externals/mapmanager/translations"/>
</copy>
<!-- copy html resources -->
<copy file="mapcomposer/app/static/externals/mapmanager/index.html" tofile="${composerbuild}/${ant.project.name}/index.html"/>
<copy file="mapcomposer/app/static/externals/mapmanager/mapstore.html" tofile="${composerbuild}/${ant.project.name}/mapstore.html"/>
<!-- copy config resources -->
<copy file="mapcomposer/app/static/externals/mapmanager/src/config.js" tofile="${composerbuild}/${ant.project.name}/src/config.js"/>
<copy file="mapcomposer/app/static/externals/mapmanager/src/init.js" tofile="${composerbuild}/${ant.project.name}/src/init.js"/>
<!-- Build the final WARs files-->
<war destfile="${composerbuild}/mapcomposer.war">
<fileset dir="${composerbuild}/mapcomposer"/>
</war>
<war destfile="${composerbuild}/${ant.project.name}.war" needxmlfile='false'>
<fileset dir="${composerbuild}/${ant.project.name}"/>
</war>
</target>
<!-- SITE END -->
<target name="redistapp" if="application">
<copy todir="${composerbuild}/${ant.project.name}/WEB-INF/app/applications/${application}">
<fileset dir="mapcomposer/app/applications/${application}">
</fileset>
</copy>
</target>
<target name="redist">
<mkdir dir="${composerbuild}/${ant.project.name}"/>
<copy todir="${composerbuild}/${ant.project.name}">
<fileset dir="mapcomposer/src/main/webapp/">
</fileset>
</copy>
<copy todir="${composerbuild}/${ant.project.name}/WEB-INF/lib" flatten="true" includeEmptyDirs="false">
<fileset dir="${ringojs.dir}/lib"/>
</copy>
<copy todir="${composerbuild}/${ant.project.name}/WEB-INF/app">
<fileset dir="mapcomposer/app">
<exclude name="**/externals/**"/>
<exclude name="**/script/**"/>
<exclude name="**/applications/**"/>
</fileset>
</copy>
<!-- MAP COMPOSER -->
<!-- copy Ext resources -->
<copy todir="${composerbuild}/${ant.project.name}/WEB-INF/app/static/externals/ext">
<fileset dir="mapcomposer/app/static/externals/ext">
<exclude name="**/ux/**"/>
</fileset>
</copy>
<!-- copy OpenLayers resources -->
<copy todir="${composerbuild}/${ant.project.name}/WEB-INF/app/static/externals/openlayers/theme">
<fileset dir="mapcomposer/app/static/externals/openlayers/theme"/>
</copy>
<!-- copy GeoExt resources -->
<copy todir="${composerbuild}/${ant.project.name}/WEB-INF/app/static/externals/GeoExt/resources">
<fileset dir="mapcomposer/app/static/externals/GeoExt/resources"/>
</copy>
<!-- copy gxp resources -->
<copy todir="${composerbuild}/${ant.project.name}/WEB-INF/app/static/externals/gxp/src/theme">
<fileset dir="mapcomposer/app/static/externals/gxp/src/theme"/>
</copy>
<!-- copy PrintPreview resources -->
<copy todir="${composerbuild}/${ant.project.name}/WEB-INF/app/static/externals/PrintPreview/resources">
<fileset dir="mapcomposer/app/static/externals/PrintPreview/resources"/>
</copy>
<!-- copy metadataexplorer css -->
<copy todir="${composerbuild}/${ant.project.name}/WEB-INF/app/static/externals/csw/css">
<fileset dir="mapcomposer/app/static/externals/csw/css"/>
</copy>
<!-- copy metadataexplorer img -->
<copy todir="${composerbuild}/${ant.project.name}/WEB-INF/app/static/externals/csw/img">
<fileset dir="mapcomposer/app/static/externals/csw/img"/>
</copy>
<!-- copy metadataexplorer i18n -->
<copy todir="${composerbuild}/${ant.project.name}/WEB-INF/app/static/externals/csw/i18n">
<fileset dir="mapcomposer/app/static/externals/csw/i18n"/>
</copy>
<!-- copy colorpicker img -->
<copy todir="${composerbuild}/${ant.project.name}/WEB-INF/app/static/externals/colorpicker/img">
<fileset dir="mapcomposer/app/static/externals/colorpicker/img"/>
</copy>
<!-- copy colorpicker css -->
<copy todir="${composerbuild}/${ant.project.name}/WEB-INF/app/static/externals/colorpicker/css">
<fileset dir="mapcomposer/app/static/externals/colorpicker/css"/>
</copy>
<!-- copy mapmanager css -->
<copy todir="${composerbuild}/${ant.project.name}/WEB-INF/app/static/externals/mapmanager/theme/css">
<fileset dir="mapcomposer/app/static/externals/mapmanager/theme/css/"
/>
</copy>
<!-- copy mapmanager img -->
<copy todir="${composerbuild}/${ant.project.name}/WEB-INF/app/static/externals/mapmanager/theme/img">
<fileset dir="mapcomposer/app/static/externals/mapmanager/theme/img"
/>
</copy>
<copy todir="${composerbuild}/${ant.project.name}/WEB-INF/app/static/externals/mapmanager/theme/images/carousel">
<fileset dir="mapcomposer/app/static/externals/mapmanager/theme/images/carousel"
/>
</copy>
<!-- copy mapmanager media -->
<copy todir="${composerbuild}/${ant.project.name}/WEB-INF/app/static/externals/mapmanager/theme/media">
<fileset dir="mapcomposer/app/static/externals/mapmanager/theme/media"
/>
</copy>
<!-- copy ux img -->
<copy todir="${composerbuild}/${ant.project.name}/WEB-INF/app/static/externals/ext/ux/images">
<fileset dir="mapcomposer/app/static/externals/ext/ux/images"/>
</copy>
<copy file="mapcomposer/app/static/externals/ext/ux/ux-all.js" tofile="${composerbuild}/${ant.project.name}/WEB-INF/app/static/externals/ext/ux/ux-all.js"/>
<!-- copy i18n resources -->
<copy todir="${composerbuild}/${ant.project.name}/WEB-INF/app/static/externals/mapmanager/translations">
<fileset dir="mapcomposer/app/static/externals/mapmanager/translations"/>
</copy>
<!-- copy CookieNotice resources -->
<copy todir="${composerbuild}/${ant.project.name}/WEB-INF/app/static/externals/cookiechoices">
<fileset dir="mapcomposer/app/static/externals/cookiechoices"/>
</copy>
</target>
<target name="war" depends="dist">
<war destfile="${composerbuild}/${ant.project.name}.war">
<fileset dir="${composerbuild}/${ant.project.name}"/>
</war>
</target>
<target name="debug" depends="debugdefault,debugapp">
</target>
<target name="debugdefault" depends="init" unless="application">
<java jar="${ringojs.run}" fork="true" classpath="${ringojs.dir}/lib">
<sysproperty key="app.proxy.geoserver" value="${app.proxy.geoserver}"/>
<sysproperty key="app.debug.proxy" value="${app.debug.proxy}"/>
<sysproperty key="ringo.home" path="${ringojs.dir}"/>
<!-- <jvmarg value="-XX:+HeapDumpOnOutOfMemoryError"/> -->
<arg path="mapcomposer/app/main.js"/>
<arg line="-p ${app.port}"/>
</java>
</target>
<target name="debugapp" depends="init" if="application">
<java jar="${ringojs.run}" fork="true" classpath="${ringojs.dir}/lib">
<sysproperty key="app.proxy.geoserver" value="${app.proxy.geoserver}"/>
<sysproperty key="app.debug.proxy" value="${app.debug.proxy}"/>
<sysproperty key="ringo.home" path="${ringojs.dir}"/>
<!-- <jvmarg value="-XX:+HeapDumpOnOutOfMemoryError"/> -->
<arg path="mapcomposer/app/main.js"/>
<arg line="-a ${application}"/>
<arg line="-p ${app.port}"/>
</java>
</target>
<target name="debugall" depends="debugalldefault,debugallapp">
</target>
<target name="debugalldefault" depends="init" unless="application">
<java jar="${ringojs.run}" fork="true">
<sysproperty key="app.proxy.geoserver" value="${app.proxy.geoserver}"/>
<sysproperty key="app.debug.proxy" value="${app.debug.proxy}"/>
<sysproperty key="ringo.home" path="${ringojs.dir}"/>
<arg value="-d"/>
<arg path="mapcomposer/app/main.js"/>
<arg line="-p ${app.port}"/>
</java>
</target>
<target name="debugallapp" depends="init" if="application">
<java jar="${ringojs.run}" fork="true">
<sysproperty key="app.proxy.geoserver" value="${app.proxy.geoserver}"/>
<sysproperty key="app.debug.proxy" value="${app.debug.proxy}"/>
<sysproperty key="ringo.home" path="${ringojs.dir}"/>
<arg value="-d"/>
<arg path="mapcomposer/app/main.js"/>
<arg line="-a ${application}"/>
<arg line="-p ${app.port}"/>
</java>
</target>
<target name="test" depends="init">
<java jar="${ringojs.run}" fork="true" failonerror="yes">
<sysproperty key="ringo.home" path="${ringojs.dir}"/>
<arg path="mapcomposer/tests/all.js"/>
</java>
</target>
<target name="clean" description="remove previous composerbuild">
<delete dir="${ringojs.dir}"/>
<delete dir="${composerbuild}"/>
<delete dir="${release.dir}"/>
</target>
<target name="release" depends="war">
<delete dir="${release.dir}"/>
<mkdir dir="${release.dir}"/>
<mkdir dir="${release.dir}/mapstore"/>
<copy todir="${release.dir}/mapstore">
<fileset dir="release">
</fileset>
</copy>
<copy todir="${release.dir}/mapstore/webapps">
<fileset file="${composerbuild}/${ant.project.name}.war">
</fileset>
</copy>
<!-- Replace the default context jetty file -->
<delete file="${release.dir}/mapstore/contexts/context.xml"/>
<copy file="mapcomposer/release/manager/context.xml" tofile="${release.dir}/mapstore/contexts/context.xml"/>
<copy todir="${release.dir}/mapstore">
<fileset file="license.txt">
</fileset>
</copy>
<get src="http://maven.geo-solutions.it/it/geosolutions/servicebox/${servicebox.version}/servicebox-${servicebox.version}.war" dest="${release.dir}/mapstore/webapps/servicebox.war"/>
<get src="http://maven.geo-solutions.it/it/geosolutions/geostore/geostore-webapp/${geostore.version}/geostore-webapp-${geostore.version}.war" dest="${release.dir}/mapstore/webapps/geostore.war"/>
<get src="http://maven.geo-solutions.it/proxy/http_proxy/${httpproxy.version}/http_proxy-${httpproxy.version}.war" dest="${release.dir}/mapstore/webapps/http_proxy.war"/>
<get src="http://maven.geo-solutions.it/it/geosolutions/opensdi2/opensdi2-web/${opensdi2.version}/opensdi2-web-${opensdi2.version}.war" dest="${release.dir}/mapstore/webapps/opensdi2-manager.war"/>
<!-- remove datasource configuration file from geostore.war -->
<zip destfile="${release.dir}/mapstore/webapps/tmp.war">
<zipfileset src="${release.dir}/mapstore/webapps/geostore.war">
<exclude name="**/geostore-datasource-ovr.properties" />
</zipfileset>
</zip>
<move file="${release.dir}/mapstore/webapps/tmp.war" tofile="${release.dir}/mapstore/webapps/geostore.war" />
<!-- remove proxy configuration file from http_proxy.war -->
<zip destfile="${release.dir}/mapstore/webapps/tmp.war">
<zipfileset src="${release.dir}/mapstore/webapps/http_proxy.war">
<exclude name="**/proxy.properties" />
</zipfileset>
</zip>
<move file="${release.dir}/mapstore/webapps/tmp.war" tofile="${release.dir}/mapstore/webapps/http_proxy.war" />
<!-- remove servicebox configuration file from servicebox.war -->
<zip destfile="${release.dir}/mapstore/webapps/tmp.war">
<zipfileset src="${release.dir}/mapstore/webapps/servicebox.war">
<exclude name="**/servicebox.properties" />
<exclude name="**/servicebox-ovr.properties" />
</zipfileset>
</zip>
<move file="${release.dir}/mapstore/webapps/tmp.war" tofile="${release.dir}/mapstore/webapps/servicebox.war" />
<!-- remove opensdi2-manager configuration file from opensdi2-manager.war -->
<zip destfile="${release.dir}/mapstore/webapps/tmp.war">
<zipfileset src="${release.dir}/mapstore/webapps/opensdi2-manager.war">
<exclude name="**/opensdi-config-ovr.properties" />
</zipfileset>
</zip>
<move file="${release.dir}/mapstore/webapps/tmp.war" tofile="${release.dir}/mapstore/webapps/opensdi2-manager.war" />
<echo file="${release.dir}/mapstore/VERSION.txt">
MapStore Version: ${mapstore.version}
GeoStore Version: ${geostore.version}
HttpProxy Version: ${httpproxy.version}
servicebox Version: ${servicebox.version}
opensdi2-manager Version: ${opensdi2.version}
</echo>
</target>
<target name="gnrelease" depends="release">
<!-- Get GeoNetwork war -->
<get src="http://demo.geo-solutions.it/share/github/mapstore/downloads/war/geonetwork/${geonetwork.version}/geonetwork-${geonetwork.version}.war" dest="${release.dir}/mapstore/webapps/geonetwork.war"/>
<!-- Remove mapcomposer ringo configuration file from mapstore.war to enable geonetwork node -->
<zip destfile="${release.dir}/mapstore/webapps/tmp.war">
<zipfileset src="${release.dir}/mapstore/webapps/mapstore.war">
<exclude name="**/WEB-INF/app/config.js" />
</zipfileset>
<zipfileset dir="mapcomposer/release/geonetwork/" includes="config.js" prefix="WEB-INF/app"/>
</zip>
<move file="${release.dir}/mapstore/webapps/tmp.war" tofile="${release.dir}/mapstore/webapps/mapstore.war" />
<!-- Replace the default context jetty file -->
<delete file="${release.dir}/mapstore/contexts/context.xml"/>
<copy file="mapcomposer/release/geonetwork/context.xml" tofile="${release.dir}/mapstore/contexts/context.xml"/>
<!-- Replace the logo GIF in GeoNetwork using the Geosolutions logo -->
<zip destfile="${release.dir}/mapstore/webapps/tmp.war">
<zipfileset src="${release.dir}/mapstore/webapps/geonetwork.war">
<exclude name="**/images/logos/dummy.gif" />
</zipfileset>
<zipfileset dir="mapcomposer/release/geonetwork/logos" includes="dummy.gif" prefix="images/logos"/>
</zip>
<move file="${release.dir}/mapstore/webapps/tmp.war" tofile="${release.dir}/mapstore/webapps/geonetwork.war" />
<echo file="${release.dir}/mapstore/VERSION.txt">
GeoNetwork Version: ${geonetwork.version}
</echo>
</target>
</project>