~johanvdw/osgeo-fdo/trunk

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
@echo off

rem 
rem Copyright (C) 2004-2006  Autodesk, Inc.
rem 
rem This library is free software; you can redistribute it and/or
rem modify it under the terms of version 2.1 of the GNU Lesser
rem General Public License as published by the Free Software Foundation.
rem 
rem This library is distributed in the hope that it will be useful,
rem but WITHOUT ANY WARRANTY; without even the implied warranty of
rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
rem Lesser General Public License for more details.
rem 
rem You should have received a copy of the GNU Lesser General Public
rem License along with this library; if not, write to the Free Software
rem Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
rem 

SET DEFMODIFY=no
SET FDOCOREENABLE=yes
SET SHPENABLE=yes
SET SDFENABLE=yes
SET WFSENABLE=yes
SET WMSENABLE=yes
SET ARCSDEENABLE=yes
SET RDBMSENABLE=yes
SET GDALENABLE=yes
SET KINGORACLEENABLE=yes
SET OGRENABLE=yes
SET SQLITEENABLE=yes
SET ZIPTESTDATA=yes
SET SHOWHELP=no
SET FDOTARZIPFOLDER=OpenSource_FDO
SET FDOBUILDNUMBER=O00X
SET FDOSVNROOT=%cd%

:study_params
if (%1)==() goto start_zip

if "%1"=="-help"    goto help_show
if "%1"=="-h"       goto help_show

if "%1"=="-b"       goto get_build
if "%1"=="-build"   goto get_build

if "%1"=="-o"       goto get_output
if "%1"=="-outpath" goto get_output

if "%1"=="-i"       goto get_input
if "%1"=="-inpath"  goto get_input

if "%1"=="-w"       goto get_with
if "%1"=="-with"    goto get_with

goto custom_error

:get_with
if (%2)==() goto custom_error

if "%DEFMODIFY%"=="yes" goto stp1_get_with
    SET DEFMODIFY=yes
    SET FDOCOREENABLE=no
    SET SHPENABLE=no
    SET SDFENABLE=no
    SET WFSENABLE=no
    SET WMSENABLE=no
    SET ARCSDEENABLE=no
    SET RDBMSENABLE=no
    SET GDALENABLE=no
    SET KINGORACLEENABLE=no
    SET OGRENABLE=no
	SET SQLITEENABLE=no
	SET ZIPTESTDATA=no
:stp1_get_with
if not "%2"=="sdf" goto stp2_get_with
	SET SDFENABLE=yes
	goto next_param
:stp2_get_with
if not "%2"=="shp" goto stp3_get_with
	SET SHPENABLE=yes
	goto next_param
:stp3_get_with
if not "%2"=="wfs" goto stp4_get_with
	SET WFSENABLE=yes
	goto next_param
:stp4_get_with
if not "%2"=="wms" goto stp5_get_with
	SET WMSENABLE=yes
	goto next_param
:stp5_get_with
if not "%2"=="fdo" goto stp6_get_with
	SET FDOCOREENABLE=yes
	goto next_param
:stp6_get_with
if not "%2"=="rdbms" goto stp7_get_with
	SET RDBMSENABLE=yes
	goto next_param
:stp7_get_with
if not "%2"=="gdal" goto stp8_get_with
	SET GDALENABLE=yes
	goto next_param
:stp8_get_with
if not "%2"=="kingoracle" goto stp9_get_with
	SET KINGORACLEENABLE=yes
	goto next_param
:stp9_get_with
if not "%2"=="ogr" goto stp12_get_with
	SET OGRENABLE=yes
	goto next_param
:stp12_get_with
if not "%2"=="sqlite" goto stp13_get_with
	SET SQLITEENABLE=yes
	goto next_param
:stp13_get_with
if not "%2"=="providers" goto stp14_get_with
    SET FDOCOREENABLE=no
    SET SHPENABLE=yes
    SET SDFENABLE=yes
    SET WFSENABLE=yes
    SET WMSENABLE=yes
    SET ARCSDEENABLE=yes
    SET RDBMSENABLE=yes
    SET GDALENABLE=yes
    SET KINGORACLEENABLE=yes
    SET OGRENABLE=yes
	SET SQLITEENABLE=yes
    goto next_param
:stp14_get_with
if not "%2"=="testdata" goto stp15_get_with
	set ZIPTESTDATA=yes
    goto next_param
:stp15_get_with
if not "%2"=="all" goto custom_error
    SET FDOCOREENABLE=yes
    SET SHPENABLE=yes
    SET SDFENABLE=yes
    SET WFSENABLE=yes
    SET WMSENABLE=yes
    SET ARCSDEENABLE=yes
    SET RDBMSENABLE=yes
    SET GDALENABLE=yes
    SET KINGORACLEENABLE=yes
    SET OGRENABLE=yes
	SET SQLITEENABLE=yes
	set ZIPTESTDATA=yes
    goto next_param

:get_build
SET FDOBUILDNUMBER=%2
goto next_param

:get_output
SET FDOTARZIPFOLDER=%2
goto next_param

:get_input
SET FDOSVNROOT=%2
goto next_param

:next_param
shift
shift
goto study_params

:start_zip
:start_zip_fdo
if "%FDOCOREENABLE%"=="no" goto start_zip_shp
   mkdir "%FDOTARZIPFOLDER%"
   svn export "%FDOSVNROOT%" "%FDOTARZIPFOLDER%" --non-recursive --force
   svn export "%FDOSVNROOT%\Fdo" "%FDOTARZIPFOLDER%\Fdo" --force
   svn export "%FDOSVNROOT%\Utilities" "%FDOTARZIPFOLDER%\Utilities" --force
   svn export "%FDOSVNROOT%\Thirdparty" "%FDOTARZIPFOLDER%\Thirdparty" --force
   svn export "%FDOSVNROOT%\DocResources" "%FDOTARZIPFOLDER%\DocResources" --force
   pushd "%FDOTARZIPFOLDER%"
   if exist .svn del /q /f /s .svn
   popd
   if exist "fdo-4.2.0_%FDOBUILDNUMBER%.zip" del /q /f "fdo-4.2.0_%FDOBUILDNUMBER%.zip"
   7z a -airy -bd -tzip "fdo-4.2.0_%FDOBUILDNUMBER%.zip" "%FDOTARZIPFOLDER%"
   deltree /Y "%FDOTARZIPFOLDER%"
:start_zip_shp
if "%SHPENABLE%"=="no" goto start_zip_sdf
   mkdir "%FDOTARZIPFOLDER%\Providers\SHP"
   svn export "%FDOSVNROOT%\Providers\SHP" "%FDOTARZIPFOLDER%\Providers\SHP" --force
   deltree /Y "%FDOTARZIPFOLDER%\Providers\SHP\TestData"
   pushd "%FDOTARZIPFOLDER%"
   if exist .svn del /q /f /s .svn
   popd
   if exist "fdoshp-4.2.0_%FDOBUILDNUMBER%.zip" del /q /f "fdoshp-4.2.0_%FDOBUILDNUMBER%.zip"
   7z a -airy -bd -tzip "fdoshp-4.2.0_%FDOBUILDNUMBER%.zip" "%FDOTARZIPFOLDER%"
   deltree /Y "%FDOTARZIPFOLDER%"
:start_zip_sdf
if "%SDFENABLE%"=="no" goto start_zip_wfs
   mkdir "%FDOTARZIPFOLDER%\Providers\SDF"
   svn export "%FDOSVNROOT%\Providers\SDF" "%FDOTARZIPFOLDER%\Providers\SDF" --force
   deltree /Y "%FDOTARZIPFOLDER%\Providers\SDF\TestData"
   pushd "%FDOTARZIPFOLDER%"
   if exist .svn del /q /f /s .svn
   popd
   if exist "fdosdf-4.2.0_%FDOBUILDNUMBER%.zip" del /q /f "fdosdf-4.2.0_%FDOBUILDNUMBER%.zip"
   7z a -airy -bd -tzip "fdosdf-4.2.0_%FDOBUILDNUMBER%.zip" "%FDOTARZIPFOLDER%"
   deltree /Y "%FDOTARZIPFOLDER%"
:start_zip_wfs
if "%WFSENABLE%"=="no" goto start_zip_wms
   mkdir "%FDOTARZIPFOLDER%\Providers\WFS"
   svn export "%FDOSVNROOT%\Providers\WFS" "%FDOTARZIPFOLDER%\Providers\WFS" --force
   pushd "%FDOTARZIPFOLDER%"
   if exist .svn del /q /f /s .svn
   popd
   if exist "fdowfs-4.2.0_%FDOBUILDNUMBER%.zip" del /q /f "fdowfs-4.2.0_%FDOBUILDNUMBER%.zip"
   7z a -airy -bd -tzip "fdowfs-4.2.0_%FDOBUILDNUMBER%.zip" "%FDOTARZIPFOLDER%"
   deltree /Y "%FDOTARZIPFOLDER%"
:start_zip_wms
if "%WMSENABLE%"=="no" goto start_zip_arcsde
   mkdir "%FDOTARZIPFOLDER%\Providers\WMS"
   svn export "%FDOSVNROOT%\Providers\WMS" "%FDOTARZIPFOLDER%\Providers\WMS" --force
   pushd "%FDOTARZIPFOLDER%"
   if exist .svn del /q /f /s .svn
   popd
   if exist "fdowms-4.2.0_%FDOBUILDNUMBER%.zip" del /q /f "fdowms-4.2.0_%FDOBUILDNUMBER%.zip"
   7z a -airy -bd -tzip "fdowms-4.2.0_%FDOBUILDNUMBER%.zip" "%FDOTARZIPFOLDER%"
   deltree /Y "%FDOTARZIPFOLDER%"
:start_zip_arcsde
if "%ARCSDEENABLE%"=="no" goto start_zip_rdbms
   mkdir "%FDOTARZIPFOLDER%\Providers\ArcSDE"
   svn export "%FDOSVNROOT%\Providers\ArcSDE" "%FDOTARZIPFOLDER%\Providers\ArcSDE" --force
   deltree /Y "%FDOTARZIPFOLDER%\Providers\ArcSDE\TestData"
   pushd "%FDOTARZIPFOLDER%"
   if exist .svn del /q /f /s .svn
   popd
   if exist "fdoarcsde-4.2.0_%FDOBUILDNUMBER%.zip" del /q /f "fdoarcsde-4.2.0_%FDOBUILDNUMBER%.zip"
   7z a -airy -bd -tzip "fdoarcsde-4.2.0_%FDOBUILDNUMBER%.zip" "%FDOTARZIPFOLDER%"
   deltree /Y "%FDOTARZIPFOLDER%"
:start_zip_rdbms
if "%RDBMSENABLE%"=="no" goto start_zip_gdal
   mkdir "%FDOTARZIPFOLDER%\Providers\GenericRdbms"
   svn export "%FDOSVNROOT%\Providers\GenericRdbms" "%FDOTARZIPFOLDER%\Providers\GenericRdbms" --force
   pushd "%FDOTARZIPFOLDER%"
   if exist .svn del /q /f /s .svn
   popd
   if exist "fdordbms-4.2.0_%FDOBUILDNUMBER%.zip" del /q /f "fdordbms-4.2.0_%FDOBUILDNUMBER%.zip"
   7z a -airy -bd -tzip "fdordbms-4.2.0_%FDOBUILDNUMBER%.zip" "%FDOTARZIPFOLDER%"
   deltree /Y "%FDOTARZIPFOLDER%"
:start_zip_gdal
if "%GDALENABLE%"=="no" goto start_zip_king_oracle
   mkdir "%FDOTARZIPFOLDER%\Providers\GDAL"
   svn export "%FDOSVNROOT%\Providers\GDAL" "%FDOTARZIPFOLDER%\Providers\GDAL" --force
   deltree /Y "%FDOTARZIPFOLDER%\Providers\GDAL\TestData"
   pushd "%FDOTARZIPFOLDER%"
   if exist .svn del /q /f /s .svn
   popd
   if exist "fdogdal-4.2.0_%FDOBUILDNUMBER%.zip" del /q /f "fdogdal-4.2.0_%FDOBUILDNUMBER%.zip"
   7z a -airy -bd -tzip "fdogdal-4.2.0_%FDOBUILDNUMBER%.zip" "%FDOTARZIPFOLDER%"
   deltree /Y "%FDOTARZIPFOLDER%"
:start_zip_king_oracle
if "%KINGORACLEENABLE%"=="no" goto start_zip_ogr
   mkdir "%FDOTARZIPFOLDER%\Providers\KingOracle"
   svn export "%FDOSVNROOT%\Providers\KingOracle" "%FDOTARZIPFOLDER%\Providers\KingOracle" --force
   pushd "%FDOTARZIPFOLDER%"
   if exist .svn del /q /f /s .svn
   popd
   if exist "fdokingoracle-4.2.0_%FDOBUILDNUMBER%.zip" del /q /f "fdokingoracle-4.2.0_%FDOBUILDNUMBER%.zip"
   7z a -airy -bd -tzip "fdokingoracle-4.2.0_%FDOBUILDNUMBER%.zip" "%FDOTARZIPFOLDER%"
   deltree /Y "%FDOTARZIPFOLDER%"
:start_zip_ogr
if "%OGRENABLE%"=="no" goto start_zip_sqlite
   mkdir "%FDOTARZIPFOLDER%\Providers\OGR"
   svn export "%FDOSVNROOT%\Providers\OGR" "%FDOTARZIPFOLDER%\Providers\OGR" --force
   pushd "%FDOTARZIPFOLDER%"
   if exist .svn del /q /f /s .svn
   popd
   if exist "fdoogr-4.2.0_%FDOBUILDNUMBER%.zip" del /q /f "fdoogr-4.2.0_%FDOBUILDNUMBER%.zip"
   7z a -airy -bd -tzip "fdoogr-4.2.0_%FDOBUILDNUMBER%.zip" "%FDOTARZIPFOLDER%"
   deltree /Y "%FDOTARZIPFOLDER%"
:start_zip_sqlite
if "%SQLITEENABLE%"=="no" goto start_zip_testdata
   mkdir "%FDOTARZIPFOLDER%\Providers\SQLite"
   svn export "%FDOSVNROOT%\Providers\SQLite" "%FDOTARZIPFOLDER%\Providers\SQLite" --force
   pushd "%FDOTARZIPFOLDER%"
   if exist .svn del /q /f /s .svn
   popd
   if exist "fdosqlite-4.2.0_%FDOBUILDNUMBER%.zip" del /q /f "fdosqlite-4.2.0_%FDOBUILDNUMBER%.zip"
   7z a -airy -bd -tzip "fdosqlite-4.2.0_%FDOBUILDNUMBER%.zip" "%FDOTARZIPFOLDER%"
   deltree /Y "%FDOTARZIPFOLDER%"
:start_zip_testdata
if "%ZIPTESTDATA%"=="no" goto end
   mkdir "%FDOTARZIPFOLDER%\Providers\ArcSDE\TestData"
   svn export "%FDOSVNROOT%\Providers\ArcSDE\TestData" "%FDOTARZIPFOLDER%\Providers\ArcSDE\TestData" --force

   pushd "%FDOTARZIPFOLDER%"
   if exist .svn del /q /f /s .svn
   popd
   if exist "fdoarcsde-testdata-4.2.0_%FDOBUILDNUMBER%.zip" del /q /f fdoarcsde-testdata-4.2.0_%FDOBUILDNUMBER%.zip"
   7z a -airy -bd -tzip "fdoarcsde-testdata-4.2.0_%FDOBUILDNUMBER%.zip" "%FDOTARZIPFOLDER%"
   deltree /Y "%FDOTARZIPFOLDER%"

   mkdir "%FDOTARZIPFOLDER%\Providers\GDAL\TestData"
   svn export "%FDOSVNROOT%\Providers\GDAL\TestData" "%FDOTARZIPFOLDER%\Providers\GDAL\TestData" --force

   pushd "%FDOTARZIPFOLDER%"
   if exist .svn del /q /f /s .svn
   popd
   if exist "fdogdal-testdata-4.2.0_%FDOBUILDNUMBER%.zip" del /q /f fdogdal-testdata-4.2.0_%FDOBUILDNUMBER%.zip"
   7z a -airy -bd -tzip "fdogdal-testdata-4.2.0_%FDOBUILDNUMBER%.zip" "%FDOTARZIPFOLDER%"
   deltree /Y "%FDOTARZIPFOLDER%"

   mkdir "%FDOTARZIPFOLDER%\Providers\SDF\TestData"
   svn export "%FDOSVNROOT%\Providers\SDF\TestData" "%FDOTARZIPFOLDER%\Providers\SDF\TestData" --force

   pushd "%FDOTARZIPFOLDER%"
   if exist .svn del /q /f /s .svn
   popd
   if exist "fdosdf-testdata-4.2.0_%FDOBUILDNUMBER%.zip" del /q /f fdosdf-testdata-4.2.0_%FDOBUILDNUMBER%.zip"
   7z a -airy -bd -tzip "fdosdf-testdata-4.2.0_%FDOBUILDNUMBER%.zip" "%FDOTARZIPFOLDER%"
   deltree /Y "%FDOTARZIPFOLDER%"

   mkdir "%FDOTARZIPFOLDER%\Providers\SHP\TestData"
   svn export "%FDOSVNROOT%\Providers\SHP\TestData" "%FDOTARZIPFOLDER%\Providers\SHP\TestData" --force

   pushd "%FDOTARZIPFOLDER%"
   if exist .svn del /q /f /s .svn
   popd
   if exist "fdoshp-testdata-4.2.0_%FDOBUILDNUMBER%.zip" del /q /f fdoshp-testdata-4.2.0_%FDOBUILDNUMBER%.zip"
   7z a -airy -bd -tzip "fdoshp-testdata-4.2.0_%FDOBUILDNUMBER%.zip" "%FDOTARZIPFOLDER%"
   deltree /Y "%FDOTARZIPFOLDER%"

:end
echo End Build
exit /B 0

:error
echo There was a build error.
exit /B 1

:custom_error
echo The command is not recognized.
echo Please use the format:
:help_show
echo **************************************************************************
echo NOTE: To use the createtarzip script, download and install the 7z  
echo       command-line and Windows shell utility for manipulating ZIP 
echo       archives. 7-Zip is free software distributed under the GNU LGPL. 
echo       7z can be obtained from http://www.7-zip.org/
echo *
echo createtarzipfiles.bat [-h] [-i=InFolder] [-o=OutFolder] [-w=WithModule] [-b=BuildNumber]
echo *
echo Help:           -h[elp]
echo InFolder:       -i[npath]=input source svn checkout folder
echo OutFolder:      -o[utpath]=destination folder for exported svn files
echo WithModule:     -w[ith]=all(default), 
echo                         fdo, 
echo                         providers, 
echo                         shp, 
echo                         sdf, 
echo                         wfs, 
echo                         wms, 
echo                         arcsde, 
echo                         rdbms, 
echo                         gdal, 
echo                         kingoracle, 
echo                         ogr,
echo                         sqlite,
echo                         testdata
echo BuildNumber:    -b[uild]=User-Defined build number appended to the end of the tar.gz files
echo **************************************************************************

exit /B 0