forked from geosolutions-it/MapStore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
306 lines (263 loc) · 14.1 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="mapcomposer" default="dist" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<description>
MapStore Build File
</description>
<property name="composerbuild" location="mapcomposer/build"/>
<property name="managerbuild" location="mapmanager/build"/>
<property name="release.dir" location="build"/>
<property name="manager.war.name" value="mapstore"/>
<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.0.4-SNAPSHOT"/>
<property name="servicebox.version" value="1.3-SNAPSHOT"/>
<property name="mapstore.version" value="1.4-SNAPSHOT"/>
<property name="geostore.version" value="1.1-SNAPSHOT"/>
<property name="geonetwork.version" value="2.6.5-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="init">
<!-- 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>
<!-- mapmanager -->
<mkdir dir="${managerbuild}/mapstore/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 ${managerbuild}/mapstore/src mapmanager/buildjs.cfg"/>
</java>
</target>
<target name="dist" depends=" test, buildjs, redist"/>
<target name="redist">
<mkdir dir="${composerbuild}/${ant.project.name}"/>
<mkdir dir="${managerbuild}/mapstore"/>
<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/**"/>
</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"/>
</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>
<!-- MAP MANAGER -->
<!-- copy Lib resources -->
<copy todir="${managerbuild}/mapstore/lib">
<fileset dir="mapmanager/lib"/>
</copy>
<!-- copy theme resources -->
<copy todir="${managerbuild}/mapstore/theme">
<fileset dir="mapmanager/theme"/>
</copy>
<!-- copy i18n resources -->
<copy todir="${managerbuild}/mapstore/translations">
<fileset dir="mapmanager/translations"/>
</copy>
<!-- copy html resources -->
<copy file="mapmanager/index.html" tofile="${managerbuild}/mapstore/index.html"/>
<copy file="mapmanager/mapstore.html" tofile="${managerbuild}/mapstore/mapstore.html"/>
<!-- copy config resources -->
<copy file="mapmanager/src/config.js" tofile="${managerbuild}/mapstore/src/config.js"/>
<copy file="mapmanager/src/init.js" tofile="${managerbuild}/mapstore/src/init.js"/>
</target>
<target name="war" depends="dist">
<war destfile="${composerbuild}/${ant.project.name}.war">
<fileset dir="${composerbuild}/${ant.project.name}"/>
</war>
<war destfile="${managerbuild}/${manager.war.name}.war" needxmlfile='false'>
<fileset dir="${managerbuild}/${manager.war.name}"/>
</war>
</target>
<target name="debug" depends="init">
<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="debugall" depends="init">
<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="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="${managerbuild}"/>
<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>
<copy todir="${release.dir}/mapstore/webapps">
<fileset file="${managerbuild}/${manager.war.name}.war">
</fileset>
</copy>
<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"/>
<!-- 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" />
<!-- replace mapmanager home html file -->
<zip destfile="${release.dir}/mapstore/webapps/tmp.war">
<zipfileset src="${release.dir}/mapstore/webapps/mapstore.war">
<exclude name="*.html" />
</zipfileset>
</zip>
<zip destfile="${release.dir}/mapstore/webapps/tmp.war" update="true">
<zipfileset dir="mapmanager/release"
includes="*.html" />
</zip>
<move file="${release.dir}/mapstore/webapps/tmp.war" tofile="${release.dir}/mapstore/webapps/mapstore.war" />
<echo file="${release.dir}/mapstore/VERSION.txt">
MapStore Version: ${mapstore.version}
GeoStore Version: ${geostore.version}
HttpProxy Version: ${httpproxy.version}
servicebox Version: ${servicebox.version}
</echo>
</target>
<target name="gnrelease" depends="release">
<!-- Remove the old mapstore war -->
<delete file="${release.dir}/mapstore/webapps/mapstore.war"/>
<!-- 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 mapcomposer.war to enable geonetwork node -->
<zip destfile="${release.dir}/mapstore/webapps/tmp.war">
<zipfileset src="${release.dir}/mapstore/webapps/mapcomposer.war">
<exclude name="**/WEB-INF/app/config.js" />
</zipfileset>
<zipfileset dir="mapcomposer/release" includes="config.js" prefix="WEB-INF/app"/>
</zip>
<move file="${release.dir}/mapstore/webapps/tmp.war" tofile="${release.dir}/mapstore/webapps/mapstore.war" />
<!-- Delete the old mapcomposer war -->
<delete file="${release.dir}/mapstore/webapps/mapcomposer.war"/>
<!-- Replace the default context jetty file -->
<delete file="${release.dir}/mapstore/contexts/context.xml"/>
<copy file="mapcomposer/release/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>