gvsig-raster / org.gvsig.raster / tags / v2.2.3 / gvprjutils @ 22479
History | View | Annotate | Download (20.5 KB)
1 | 2443 | nbrodin | #/bin/sh |
---|---|---|---|
2 | |||
3 | #---------------------- |
||
4 | #Configuration section |
||
5 | #---------------------- |
||
6 | |||
7 | GVSIG_VERSION=2.1.0 |
||
8 | FIX_VERSION=SNAPSHOT |
||
9 | RELEASE=testing |
||
10 | PACKAGE_PREFIX=gvSIG-desktop |
||
11 | LIB_PKG=depman.tgz |
||
12 | |||
13 | PACKAGE_DIRECTORY=/tmp |
||
14 | 2622 | nbrodin | USER= |
15 | 2443 | nbrodin | PASS= |
16 | |||
17 | #Distribution groups |
||
18 | #------------------- |
||
19 | |||
20 | #GROUP 0 (CORE) |
||
21 | PROJECTS[0]="org.gvsig.raster.cache |
||
22 | org.gvsig.raster |
||
23 | org.gvsig.raster.gdal |
||
24 | org.gvsig.raster.tilecache |
||
25 | org.gvsig.raster.tools" |
||
26 | REPO_NAME[0]="Raster" #Repository of packages |
||
27 | URL_REPO[0]="https://devel.gvsig.org/download/projects/${REPO_NAME[0]}/pool/" |
||
28 | URL_SVN[0]="https://devel.gvsig.org/svn/gvsig-raster/" |
||
29 | PATH_TICKET[0]="/tmp/ticket-raster.txt" |
||
30 | PLUGINS[0]="org.gvsig.raster/org.gvsig.raster.mainplugin |
||
31 | org.gvsig.raster.tilecache/org.gvsig.raster.tilecache.app |
||
32 | org.gvsig.raster.tools/org.gvsig.raster.tools.app.basic |
||
33 | org.gvsig.raster.gdal/org.gvsig.raster.gdal.app" |
||
34 | ARCH_DEP[0]="org.gvsig.raster/org.gvsig.raster.mainplugin |
||
35 | org.gvsig.raster.gdal/org.gvsig.raster.gdal.app" #Architecture dependent plugins |
||
36 | |||
37 | #GROUP 1 (PLUGINS) |
||
38 | PROJECTS[1]="org.gvsig.raster.multifile |
||
39 | org.gvsig.raster.reproject |
||
40 | org.gvsig.raster.principalcomponents" |
||
41 | REPO_NAME[1]="Raster" |
||
42 | URL_REPO[1]="https://devel.gvsig.org/download/projects/${REPO_NAME[1]}/pool/" |
||
43 | URL_SVN[1]="https://devel.gvsig.org/svn/gvsig-raster/" |
||
44 | PATH_TICKET[1]="/tmp/ticket-raster.txt" |
||
45 | PLUGINS[1]="org.gvsig.raster.multifile/org.gvsig.raster.multifile.app.multifileclient |
||
46 | org.gvsig.raster.reproject/org.gvsig.raster.reproject.app.reprojectclient |
||
47 | org.gvsig.raster.principalcomponents/org.gvsig.raster.principalcomponents.app.principalcomponentsclient" |
||
48 | ARCH_DEP[1]="" |
||
49 | |||
50 | #GROUP 2 (FORMATS) |
||
51 | PROJECTS[2]="org.gvsig.raster.ermapper |
||
52 | org.gvsig.raster.lizardtech |
||
53 | org.gvsig.raster.netcdf" |
||
54 | REPO_NAME[2]="Raster" |
||
55 | URL_REPO[2]="https://devel.gvsig.org/download/projects/${REPO_NAME[2]}/pool/" |
||
56 | URL_SVN[2]="https://devel.gvsig.org/svn/gvsig-raster/" |
||
57 | PATH_TICKET[2]="/tmp/ticket-raster.txt" |
||
58 | PLUGINS[2]="org.gvsig.raster.netcdf/org.gvsig.raster.netcdf.app.netcdfclient |
||
59 | org.gvsig.raster.ermapper/org.gvsig.raster.ermapper.app |
||
60 | org.gvsig.raster.lizardtech/org.gvsig.raster.lizardtech.app" |
||
61 | ARCH_DEP[2]="org.gvsig.raster.ermapper/org.gvsig.raster.ermapper.app |
||
62 | org.gvsig.raster.lizardtech/org.gvsig.raster.lizardtech.app" |
||
63 | |||
64 | #GROUP 3 (REMOTE) |
||
65 | PROJECTS[3]="org.gvsig.raster.wmts |
||
66 | org.gvsig.raster.wms |
||
67 | org.gvsig.raster.wcs |
||
68 | org.gvsig.raster.postgis" |
||
69 | REPO_NAME[3]="Raster" |
||
70 | URL_REPO[3]="https://devel.gvsig.org/download/projects/${REPO_NAME[3]}/pool/" |
||
71 | URL_SVN[3]="https://devel.gvsig.org/svn/gvsig-raster/" |
||
72 | PATH_TICKET[3]="/tmp/ticket-raster.txt" |
||
73 | PLUGINS[3]="org.gvsig.raster.wmts/org.gvsig.raster.wmts.app.wmtsclient |
||
74 | org.gvsig.raster.wms/org.gvsig.raster.wms.app.wmsclient |
||
75 | org.gvsig.raster.wcs/org.gvsig.raster.wcs.app.wcsclient |
||
76 | org.gvsig.raster.postgis/org.gvsig.raster.postgis.app.postgisrasterclient" |
||
77 | ARCH_DEP[3]="" |
||
78 | |||
79 | #GROUP 4 (GEOREFERENCING) |
||
80 | PROJECTS[4]="org.gvsig.raster.georeferencing" |
||
81 | REPO_NAME[4]="Raster" |
||
82 | URL_REPO[4]="https://devel.gvsig.org/download/projects/${REPO_NAME[4]}/pool/" |
||
83 | URL_SVN[4]="https://devel.gvsig.org/svn/gvsig-georeferencing/" |
||
84 | PATH_TICKET[4]="/tmp/ticket-raster.txt" |
||
85 | PLUGINS[4]="org.gvsig.raster.georeferencing/org.gvsig.raster.georeferencing.app.georeferencingclient" |
||
86 | ARCH_DEP[4]="" |
||
87 | |||
88 | #GROUP 5 (OSM) |
||
89 | PROJECTS[5]="org.gvsig.raster.osm" |
||
90 | REPO_NAME[5]="Raster" |
||
91 | URL_REPO[5]="https://devel.gvsig.org/download/projects/${REPO_NAME[5]}/pool/" |
||
92 | URL_SVN[5]="https://devel.gvsig.org/svn/gvsig-osm/" |
||
93 | PATH_TICKET[5]="/tmp/ticket-raster.txt" |
||
94 | PLUGINS[5]="org.gvsig.raster.osm/org.gvsig.raster.osm.app.osmclient" |
||
95 | ARCH_DEP[5]="" |
||
96 | |||
97 | #GROUP 6 (GEOPROCESS) |
||
98 | PROJECTS[6]="org.gvsig.geoprocess" |
||
99 | REPO_NAME[6]="gvsig-geoprocess" |
||
100 | URL_REPO[6]="https://devel.gvsig.org/download/projects/${REPO_NAME[6]}/pool/" |
||
101 | URL_SVN[6]="https://devel.gvsig.org/svn/gvsig-geoprocess/" |
||
102 | PATH_TICKET[6]="/tmp/ticket-geoprocess.txt" |
||
103 | PLUGINS[6]="org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.algorithm |
||
104 | org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.mainplugin |
||
105 | org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.sextante |
||
106 | org.gvsig.geoprocess/org.gvsig.geoprocess.app/org.gvsig.geoprocess.app.tool" |
||
107 | ARCH_DEP[6]="" |
||
108 | |||
109 | #Platforms supported (Add a new block for a new architecture) |
||
110 | #------------------------------------------------------------- |
||
111 | |||
112 | ARCH="i386" |
||
113 | TYPE="dynamic" |
||
114 | |||
115 | PLATFORM[0]="linux" |
||
116 | COMPILER[0]="gcc4" |
||
117 | DISTRIBUTION[0]="all" |
||
118 | CLASSIFIER[0]=${PLATFORM[0]}"-"${DISTRIBUTION[0]}"-"${COMPILER[0]}"-"$ARCH"-"$TYPE |
||
119 | |||
120 | PLATFORM[1]="win" |
||
121 | COMPILER[1]="vs8" |
||
122 | DISTRIBUTION[1]="nt" |
||
123 | CLASSIFIER[1]=${PLATFORM[1]}"-"${DISTRIBUTION[1]}"-"${COMPILER[1]}"-"$ARCH"-"$TYPE |
||
124 | |||
125 | #------------------------- |
||
126 | #End configuration section |
||
127 | #------------------------- |
||
128 | |||
129 | ALL_PROJECTS=${PROJECTS[*]} |
||
130 | ALL_PLUGINS=${PLUGINS[*]} |
||
131 | ARCH_DEP_PLUGINS=${ARCH_DEP[*]} |
||
132 | |||
133 | for k in `seq 1 ${#PLATFORM[@]}` |
||
134 | do |
||
135 | let "i=k-1"; |
||
136 | INSTALL_PARAMS[$i]="install -Dnative-platform="${PLATFORM[$i]}" -Dnative-compiler="${COMPILER[$i]}" -Dnative-arch="$ARCH" -Dnative-distribution="${DISTRIBUTION[$i]}" -Dlibrary-type="$TYPE" -Dnative-classifier="${CLASSIFIER[$i]}" -Dnative_classifier="${CLASSIFIER[$i]}" -Dmaven.test.skip -Dmaven.javadoc.skip=true -Danimal.sniffer.skip=true -Dlicense.skip=true" |
||
137 | done |
||
138 | |||
139 | if [ $1 != "-changeversion" ] ; then |
||
140 | PACKAGE_TO_BUILD=$2 |
||
141 | |||
142 | if [ "$PACKAGE_TO_BUILD" != "" ]; then |
||
143 | if [ -n $PACKAGE_TO_BUILD -a $PACKAGE_TO_BUILD -ge ${#PROJECTS[@]} ]; then |
||
144 | t=${#PROJECTS[@]} |
||
145 | let "t=t-1" |
||
146 | echo "Number of package to build wrong. Maximum "$t |
||
147 | exit |
||
148 | fi |
||
149 | fi |
||
150 | |||
151 | if [ -z $PACKAGE_TO_BUILD ]; then #Si PACKAGE_TO_BUILD es null |
||
152 | PROJECTS_TO_BUILD=$ALL_PROJECTS |
||
153 | else |
||
154 | PROJECTS_TO_BUILD=${PROJECTS[$PACKAGE_TO_BUILD]} |
||
155 | fi |
||
156 | |||
157 | if [ -z $PACKAGE_TO_BUILD ]; then |
||
158 | PLUGINS_TO_BUILD=$ALL_PLUGINS |
||
159 | else |
||
160 | PLUGINS_TO_BUILD=${PLUGINS[$PACKAGE_TO_BUILD]} |
||
161 | fi |
||
162 | |||
163 | if [ -z $PACKAGE_TO_BUILD ]; then |
||
164 | PLUGINS_ARCH_DEP_TO_BUILD=$ARCH_DEP_PLUGINS |
||
165 | else |
||
166 | PLUGINS_ARCH_DEP_TO_BUILD=${ARCH_DEP[$PACKAGE_TO_BUILD]} |
||
167 | fi |
||
168 | fi |
||
169 | |||
170 | #------------------------------------------------- |
||
171 | # HELP |
||
172 | #------------------------------------------------- |
||
173 | |||
174 | if [ "$1" = "--help" ] ; then |
||
175 | echo "Usage: First parameter:" |
||
176 | echo " -all (clean, update, buildnumber, install, tags, commit, ticket, upload)" |
||
177 | echo " -clean" |
||
178 | echo " -update" |
||
179 | echo " -buildnumber" |
||
180 | echo " -install" |
||
181 | echo " -upload: Upload to the repository" |
||
182 | echo " -tags: Create tags tagdate_date_hour" |
||
183 | echo " -commit: Commit the build number" |
||
184 | echo " -ticket: Build a file with the URL for the package index" |
||
185 | echo " Second parameter:" |
||
186 | echo " -number: Number of group to build the package or empty to build all" |
||
187 | echo "" |
||
188 | echo "Other utils:" |
||
189 | echo " -changeversion <old_version> <new_version>:Change the parent pom version (org.gvsig.desktop) of all projects" |
||
190 | echo " -eclipse: mvn eclipse:eclipse" |
||
191 | echo " -basicinstall: mvn install without copy and decompress depman" |
||
192 | echo " -installplugins: install plugins" |
||
193 | echo "" |
||
194 | echo "To build a new package" |
||
195 | echo "----------------------------" |
||
196 | echo " Advisable to use: cpulimit -e java -l 50 -b " |
||
197 | echo " 1 - Check and update variables" |
||
198 | echo " 2 - Ejecutar ./gvprjutils -clean to clean projects" |
||
199 | echo " 3 - Ejecutar ./gvprjutils -update to update projects" |
||
200 | echo " 4 - Ejecutar ./gvprjutils -buildnumber to update the build numbers" |
||
201 | echo " 5 - Ejecutar ./gvprjutils -install to install in ~/.gvsig-devel.properties and package" |
||
202 | echo " 6 - (Check the instalation and the packages that have been built)" |
||
203 | echo " 7 - Ejecutar ./gvprjutils -upload to upload to URL_REPO (Run with the console maximized)" |
||
204 | echo " 8 - Ejecutar ./gvprjutils -commit to upload the buildnumber" |
||
205 | echo " 9 - Ejecutar ./gvprjutils -tags to create tags in URL_SVN" |
||
206 | echo " 10 - Ejecutar ./gvprjutils -ticket to create the file with the URLs of the indexes" |
||
207 | echo "" |
||
208 | echo "Examples:" |
||
209 | echo "---------" |
||
210 | echo " gvprjutils -clean 5 : Cleans the group 5" |
||
211 | echo " gvprjutils -all : Build all projects and upload to the server" |
||
212 | echo " gvprjutils -changeversion 2.0.16-SNAPSHOT 2.0.17-SNAPSHOT : change the number version of the parent" |
||
213 | exit |
||
214 | fi |
||
215 | |||
216 | |||
217 | #------------------------------------------------- |
||
218 | # CLEAN |
||
219 | #------------------------------------------------- |
||
220 | |||
221 | clean() { |
||
222 | echo "***********************************" |
||
223 | echo "Clean" |
||
224 | echo "***********************************" |
||
225 | |||
226 | for i in $PROJECTS_TO_BUILD |
||
227 | do |
||
228 | cd $i |
||
229 | echo "-----------------" |
||
230 | echo "Cambiando a"....$i |
||
231 | echo "Ejecutando clean" |
||
232 | mvn clean |
||
233 | cd .. |
||
234 | done |
||
235 | } |
||
236 | |||
237 | #------------------------------------------------- |
||
238 | # UPDATE |
||
239 | #------------------------------------------------- |
||
240 | |||
241 | update() { |
||
242 | for i in $PROJECTS_TO_BUILD |
||
243 | do |
||
244 | cd $i |
||
245 | echo "-----------------" |
||
246 | echo "Cambiando a"....$i |
||
247 | echo "Ejecutando svn update " |
||
248 | svn update; |
||
249 | cd .. |
||
250 | done |
||
251 | } |
||
252 | |||
253 | #------------------------------------------------- |
||
254 | # BUILDNUMBER |
||
255 | # Increase the build number for all plugins |
||
256 | #------------------------------------------------- |
||
257 | |||
258 | increaseBuildNumber() { |
||
259 | DIR_BASE=`pwd` |
||
260 | for i in $PLUGINS_TO_BUILD |
||
261 | do |
||
262 | if [ -d $i ]; then |
||
263 | cd $i |
||
264 | if [ -f buildNumber.properties ]; then |
||
265 | CURRENT_VER=`cat buildNumber.properties | grep "buildNumber=" | cut -d'=' -f2` |
||
266 | NEXT_VER=$CURRENT_VER |
||
267 | let "NEXT_VER=NEXT_VER+1"; |
||
268 | echo "Changin buildNumber "$CURRENT_VER" by "$NEXT_VER" IN "$i |
||
269 | (cat buildNumber.properties | sed -e "s/buildNumber=${CURRENT_VER}/buildNumber=${NEXT_VER}/g") > tmp |
||
270 | rm buildNumber.properties |
||
271 | mv tmp buildNumber.properties |
||
272 | fi |
||
273 | fi |
||
274 | cd $DIR_BASE |
||
275 | done |
||
276 | } |
||
277 | |||
278 | #------------------------------------------------- |
||
279 | # Copy to $PACKAGE_DIRECTORY |
||
280 | #------------------------------------------------- |
||
281 | |||
282 | copyToPackageFolder() { |
||
283 | DIR_BASE=`pwd` |
||
284 | for i in $PLUGINS_TO_BUILD |
||
285 | do |
||
286 | cd $i/target |
||
287 | echo "-----------------" |
||
288 | echo "Cambiando a"....$i/target |
||
289 | echo "Copiando "$i" a "$PACKAGE_DIRECTORY |
||
290 | COUNT_SLASHES=`grep -o "\/" <<< "$i" | wc -l` #Count the number of slashes in the path |
||
291 | if [ $COUNT_SLASHES -eq 1 ]; then |
||
292 | pad=`echo $i | cut -d/ -f2` |
||
293 | fi |
||
294 | if [ $COUNT_SLASHES -eq 2 ]; then |
||
295 | pad=`echo $i | cut -d/ -f3` |
||
296 | fi |
||
297 | mkdir $PACKAGE_DIRECTORY/$pad |
||
298 | rename 's/\.zip$//' *.gvspkg.zip #Elimina los .zip si los gvspkg están como .zip |
||
299 | cp $PACKAGE_PREFIX* $PACKAGE_DIRECTORY/$pad |
||
300 | cd $DIR_BASE |
||
301 | done |
||
302 | |||
303 | } |
||
304 | |||
305 | #------------------------------------------------- |
||
306 | # Install plugins |
||
307 | #------------------------------------------------- |
||
308 | |||
309 | installPlugins() { |
||
310 | echo "***********************************" |
||
311 | echo "Install" |
||
312 | echo "***********************************" |
||
313 | |||
314 | DIR_BASE=`pwd` |
||
315 | |||
316 | for i in $PLUGINS |
||
317 | do |
||
318 | cd $i |
||
319 | echo "-----------------" |
||
320 | echo "Cambiando a"....$i |
||
321 | |||
322 | echo "Ejecutando mvn "${INSTALL_PARAMS[0]} |
||
323 | mvn ${INSTALL_PARAMS[0]}; |
||
324 | |||
325 | cd $DIR_BASE |
||
326 | done |
||
327 | } |
||
328 | |||
329 | #------------------------------------------------- |
||
330 | # Install libraries and package plugins |
||
331 | #------------------------------------------------- |
||
332 | |||
333 | installAndPackage() { |
||
334 | echo "***********************************" |
||
335 | echo "Install" |
||
336 | echo "***********************************" |
||
337 | |||
338 | DIR_BASE=`pwd` |
||
339 | |||
340 | #------Install and Package--------- |
||
341 | |||
342 | for i in $PROJECTS_TO_BUILD |
||
343 | do |
||
344 | cd $i |
||
345 | echo "-----------------" |
||
346 | echo "Cambiando a"....$i |
||
347 | echo "Ejecutando mvn "${INSTALL_PARAMS[0]} |
||
348 | mvn ${INSTALL_PARAMS[0]}; |
||
349 | cd .. |
||
350 | done |
||
351 | |||
352 | |||
353 | for i in $PLUGINS_ARCH_DEP_TO_BUILD #Plugins architecture dependent |
||
354 | do |
||
355 | dir=`cut -d/ -f1 <<<$i` |
||
356 | cd $dir |
||
357 | echo "-----------------" |
||
358 | echo "Cambiando a"....$dir |
||
359 | |||
360 | for k in `seq 2 ${#INSTALL_PARAMS[@]}` |
||
361 | do |
||
362 | let "j=k-1"; |
||
363 | echo "Ejecutando mvn "$j ${INSTALL_PARAMS[$j]} |
||
364 | mvn ${INSTALL_PARAMS[$j]}; |
||
365 | done |
||
366 | |||
367 | cd $DIR_BASE |
||
368 | done |
||
369 | } |
||
370 | |||
371 | #------------------------------------------------- |
||
372 | # Unpack deman |
||
373 | #------------------------------------------------- |
||
374 | |||
375 | unpackDepman( ) { |
||
376 | if [ "$PLUGINS_ARCH_DEP_TO_BUILD" != "" ]; then #Si no hay plugins dependientes de la arquitectura no descomprimimos el depman |
||
377 | if [ -f $HOME"/"$LIB_PKG ]; then |
||
378 | CURRENT_DIR=`pwd` |
||
379 | cd $HOME |
||
380 | tar -xzvf $LIB_PKG |
||
381 | cd $CURRENT_DIR |
||
382 | else |
||
383 | echo "Error: No existe "$HOME"/"$LIB_PKG"!!!!" |
||
384 | exit |
||
385 | fi |
||
386 | fi |
||
387 | } |
||
388 | |||
389 | |||
390 | #---------------------------------------------------------- |
||
391 | #Gets the number of the version reading it from the pom.xml |
||
392 | #---------------------------------------------------------- |
||
393 | |||
394 | loadPluginVersion( ) { |
||
395 | CURRENT_DIR=`pwd` |
||
396 | VERSION_COUNTER=0 |
||
397 | for k in `seq 1 ${#PLUGINS[@]}` |
||
398 | do |
||
399 | let "i=k-1"; |
||
400 | for j in ${PLUGINS[$i]} |
||
401 | do |
||
402 | if [ -d $j ]; then |
||
403 | cd $j |
||
404 | if [ -f pom.xml ]; then |
||
405 | exec<pom.xml |
||
406 | while read line |
||
407 | do |
||
408 | if test "${line#*<version>}" != "$line" ; then #La linea contiene el tag <version> |
||
409 | NEW_VN=`sed -e "s/<version>//g" <<< $line` |
||
410 | NEW_VN=`sed -e "s/<\/version>//g" <<< $NEW_VN` |
||
411 | PLUGIN_VERSIONS[$VERSION_COUNTER]=${PLUGIN_VERSIONS[$VERSION_COUNTER]}" "$NEW_VN |
||
412 | let "VERSION_COUNTER=VERSION_COUNTER+1" |
||
413 | break |
||
414 | fi |
||
415 | done |
||
416 | fi |
||
417 | cd $CURRENT_DIR |
||
418 | fi |
||
419 | done |
||
420 | done |
||
421 | } |
||
422 | |||
423 | #------------------------------------------------- |
||
424 | #Loads the array of build numbers |
||
425 | #------------------------------------------------- |
||
426 | |||
427 | loadBuildNumber() { |
||
428 | CURRENT_DIR=`pwd` |
||
429 | BN_COUNTER=0 |
||
430 | for k in `seq 1 ${#PLUGINS[@]}` |
||
431 | do |
||
432 | let "i=k-1"; |
||
433 | for j in ${PLUGINS[$i]} |
||
434 | do |
||
435 | if [ -d $j ]; then |
||
436 | cd $j |
||
437 | if [ -f buildNumber.properties ]; then |
||
438 | NEW_BN=`cat buildNumber.properties | grep "buildNumber=" | cut -d'=' -f2` |
||
439 | BN[$BN_COUNTER]=${BN[$BN_COUNTER]}" "$NEW_BN |
||
440 | let "BN_COUNTER=BN_COUNTER+1" |
||
441 | fi |
||
442 | cd $CURRENT_DIR |
||
443 | fi |
||
444 | done |
||
445 | done |
||
446 | } |
||
447 | |||
448 | #------------------------------------------------- |
||
449 | #COMMIT CHANGES (BUILD NUMBERS) |
||
450 | #------------------------------------------------- |
||
451 | |||
452 | commit() { |
||
453 | CURRENT_DIR=`pwd` |
||
454 | for i in $PROJECTS_TO_BUILD |
||
455 | do |
||
456 | cd $i |
||
457 | echo "-----------------" |
||
458 | echo "Cambiando a"....$i |
||
459 | echo "Ejecutando svn commit " |
||
460 | svn commit * -m "New build number"; |
||
461 | cd $CURRENT_DIR |
||
462 | done |
||
463 | } |
||
464 | |||
465 | #------------------------------------------------- |
||
466 | # REVERT CHANGES (SOLO TEST) |
||
467 | #------------------------------------------------- |
||
468 | if [ "$1" = "-revert" ] ; then |
||
469 | for i in $PROJECTS_TO_BUILD |
||
470 | do |
||
471 | cd $i |
||
472 | echo "-----------------" |
||
473 | echo "Cambiando a"....$i |
||
474 | echo "Ejecutando svn update " |
||
475 | svn revert --recursive . |
||
476 | cd .. |
||
477 | done |
||
478 | fi |
||
479 | |||
480 | #------------------------------------------------- |
||
481 | # TICKET |
||
482 | #------------------------------------------------- |
||
483 | |||
484 | ticketGeneration() { |
||
485 | for k in `seq 1 ${#PATH_TICKET[@]}` |
||
486 | do |
||
487 | let "i=k-1"; |
||
488 | rm ${PATH_TICKET[$i]} 2> /dev/null |
||
489 | done |
||
490 | |||
491 | for k in `seq 1 ${#URL_REPO[@]}` |
||
492 | do |
||
493 | let "i=k-1"; |
||
494 | POS_INSIDE_PLUGINS=1 #Position of the plugin inside PLUGINS |
||
495 | for j in ${PLUGINS[$i]} |
||
496 | do |
||
497 | #Si se ha seleccionado algún grupo en concreto solo se añadirá este al fichero (-n está definido) |
||
498 | if [ "$PACKAGE_TO_BUILD" != "" ]; then |
||
499 | if [ -n $PACKAGE_TO_BUILD -a $i -ne $PACKAGE_TO_BUILD ] ; then |
||
500 | break |
||
501 | fi |
||
502 | fi |
||
503 | |||
504 | COUNT_SLASHES=`grep -o "\/" <<< "$j" | wc -l` #Count the number of slashes in the path |
||
505 | if [ $COUNT_SLASHES -eq 1 ]; then |
||
506 | package=`echo $j | cut -d/ -f2` |
||
507 | fi |
||
508 | if [ $COUNT_SLASHES -eq 2 ]; then |
||
509 | package=`echo $j | cut -d/ -f3` |
||
510 | fi |
||
511 | |||
512 | PLUGIN_VER=`cut -d' ' -f$POS_INSIDE_PLUGINS <<< ${PLUGIN_VERSIONS[$i]}` |
||
513 | PLUGIN_BN=`cut -d' ' -f$POS_INSIDE_PLUGINS <<< ${BN[$i]}` |
||
514 | |||
515 | if test "${ARCH_DEP_PLUGINS#*$j}" != "$ARCH_DEP_PLUGINS" |
||
516 | then |
||
517 | echo "${URL_REPO[$i]}$package/gvSIG-desktop-$GVSIG_VERSION-$package-$PLUGIN_VER-$PLUGIN_BN-$RELEASE-lin-x86-j1_5.gvspki" >> ${PATH_TICKET[$i]} |
||
518 | echo "" >> ${PATH_TICKET[$i]} |
||
519 | echo "${URL_REPO[$i]}$package/gvSIG-desktop-$GVSIG_VERSION-$package-$PLUGIN_VER-$PLUGIN_BN-$RELEASE-win-x86-j1_5.gvspki" >> ${PATH_TICKET[$i]} |
||
520 | else |
||
521 | echo "${URL_REPO[$i]}$package/gvSIG-desktop-$GVSIG_VERSION-$package-$PLUGIN_VER-$PLUGIN_BN-$RELEASE-all-all-j1_5.gvspki" >> ${PATH_TICKET[$i]} |
||
522 | fi |
||
523 | |||
524 | echo "" >> ${PATH_TICKET[$i]} |
||
525 | let "POS_INSIDE_PLUGINS=POS_INSIDE_PLUGINS+1"; |
||
526 | done |
||
527 | done |
||
528 | } |
||
529 | |||
530 | #------------------------------------------------- |
||
531 | # TAGS |
||
532 | #------------------------------------------------- |
||
533 | |||
534 | tagsGeneration() { |
||
535 | echo "***********************************" |
||
536 | echo "Creating tags" |
||
537 | echo "***********************************" |
||
538 | |||
539 | tag=`date +%d%m%Y_%H_%M` |
||
540 | |||
541 | for k in `seq 1 ${#URL_SVN[@]}` |
||
542 | do |
||
543 | let "i=k-1"; |
||
544 | for j in ${PROJECTS[$i]} |
||
545 | do |
||
546 | #Si se ha seleccionado algún grupo en concreto solo se hará el tag de estos proyectos |
||
547 | if [ "$PACKAGE_TO_BUILD" != "" ]; then |
||
548 | if [ -n $PACKAGE_TO_BUILD -a $i -ne $PACKAGE_TO_BUILD ] ; then |
||
549 | break |
||
550 | fi |
||
551 | fi |
||
552 | |||
553 | #echo "svn copy ${URL_SVN[$i]}$j/trunk ${URL_SVN[$i]}$j/tags/tagdate_$tag -m \"Tag build $tag\"" |
||
554 | svn copy ${URL_SVN[$i]}$j/trunk ${URL_SVN[$i]}$j/tags/tagdate_$tag -m "Tag build $tag" |
||
555 | done |
||
556 | done |
||
557 | } |
||
558 | |||
559 | #------------------------------------------------- |
||
560 | # CHANGE THE PROJECT VERSION |
||
561 | # Change the version of the pom parent in a project |
||
562 | #------------------------------------------------- |
||
563 | |||
564 | changeProjectVersion() { |
||
565 | CURRENT_DIR=`pwd` |
||
566 | if [ -z $1 ] ; then |
||
567 | echo "Current version number not defined" |
||
568 | exit |
||
569 | fi |
||
570 | |||
571 | if [ -z $2 ] ; then |
||
572 | echo "Next version number not defined" |
||
573 | exit |
||
574 | fi |
||
575 | |||
576 | for i in `ls` |
||
577 | do |
||
578 | if [[ "$i" == org.gvsig.* ]] ; then |
||
579 | echo $i |
||
580 | cd $i |
||
581 | (cat pom.xml | sed -e "s/<version>$1<\/version>/<version>$2<\/version>/") > tmp |
||
582 | rm pom.xml |
||
583 | mv tmp pom.xml |
||
584 | cd $CURRENT_DIR |
||
585 | fi |
||
586 | done |
||
587 | } |
||
588 | |||
589 | #------------------------------------------------- |
||
590 | # ECLIPSE .project |
||
591 | #------------------------------------------------- |
||
592 | |||
593 | eclipse() { |
||
594 | echo "***********************************" |
||
595 | echo "Eclipse:eclipse" |
||
596 | echo "***********************************" |
||
597 | |||
598 | DIR_BASE=`pwd` |
||
599 | |||
600 | for i in $PROJECTS_TO_BUILD |
||
601 | do |
||
602 | cd $i |
||
603 | echo "-----------------" |
||
604 | echo "Cambiando a"....$i |
||
605 | echo "Ejecutando mvn eclipse:eclipse" |
||
606 | mvn eclipse:eclipse; |
||
607 | cd .. |
||
608 | done |
||
609 | } |
||
610 | |||
611 | |||
612 | |||
613 | #------------------------------------------------- |
||
614 | # COMMANDS |
||
615 | #------------------------------------------------- |
||
616 | |||
617 | if [ "$1" = "-all" ] ; then |
||
618 | clean |
||
619 | update |
||
620 | increaseBuildnumber |
||
621 | unpackDepman |
||
622 | installAndPackage |
||
623 | copyToPackageFolder |
||
624 | commit |
||
625 | tagsGeneration |
||
626 | loadBuildNumber |
||
627 | loadPluginVersion |
||
628 | ticketGeneration |
||
629 | fi |
||
630 | |||
631 | if [ "$1" = "-basicinstall" ] ; then |
||
632 | installAndPackage |
||
633 | fi |
||
634 | |||
635 | if [ "$1" = "-installplugins" ] ; then |
||
636 | installPlugins |
||
637 | fi |
||
638 | |||
639 | if [ "$1" = "-install" ] ; then |
||
640 | unpackDepman |
||
641 | installAndPackage |
||
642 | copyToPackageFolder |
||
643 | fi |
||
644 | |||
645 | if [ "$1" = "-clean" ] ; then |
||
646 | clean |
||
647 | fi |
||
648 | |||
649 | if [ "$1" = "-update" ] ; then |
||
650 | update |
||
651 | fi |
||
652 | |||
653 | if [ "$1" = "-buildnumber" ] ; then |
||
654 | increaseBuildNumber |
||
655 | fi |
||
656 | |||
657 | if [ "$1" = "-commit" ] ; then |
||
658 | commit |
||
659 | fi |
||
660 | |||
661 | if [ "$1" = "-ticket" ] ; then |
||
662 | loadBuildNumber |
||
663 | loadPluginVersion |
||
664 | ticketGeneration |
||
665 | fi |
||
666 | |||
667 | if [ "$1" = "-tags" ] ; then |
||
668 | tagsGeneration |
||
669 | fi |
||
670 | |||
671 | if [ "$1" = "-changeversion" ] ; then |
||
672 | changeProjectVersion $2 $3 |
||
673 | fi |
||
674 | |||
675 | if [ "$1" = "-eclipse" ] ; then |
||
676 | eclipse |
||
677 | fi |
||
678 | |||
679 | if [ "$1" != "-upload" -a "$1" != "-all" ] ; then |
||
680 | exit |
||
681 | fi |
||
682 | |||
683 | #------------------------------------------------- |
||
684 | # UPLOAD |
||
685 | #------------------------------------------------- |
||
686 | |||
687 | echo "***********************************" |
||
688 | echo "Uploading" |
||
689 | echo "***********************************" |
||
690 | |||
691 | CURRENT_DIRECTORY=`pwd`; |
||
692 | echo "Cambiando a..."$PACKAGE_DIRECTORY |
||
693 | cd $PACKAGE_DIRECTORY |
||
694 | |||
695 | |||
696 | for k in `seq 1 ${#URL_REPO[@]}` |
||
697 | do |
||
698 | let "i=k-1"; |
||
699 | |||
700 | for j in ${PLUGINS[$i]} |
||
701 | do |
||
702 | |||
703 | #Si se ha seleccionado algún grupo en concreto solo se subiran los paquetes de este grupo |
||
704 | if [ "$PACKAGE_TO_BUILD" != "" ]; then |
||
705 | if [ -n $PACKAGE_TO_BUILD -a $i -ne $PACKAGE_TO_BUILD ] ; then |
||
706 | break |
||
707 | fi |
||
708 | fi |
||
709 | |||
710 | PKG_DIR=`echo $j | cut -d/ -f3` |
||
711 | if [ "$PKG_DIR" == "" ] ; then |
||
712 | PKG_DIR=`echo $j | cut -d/ -f2` |
||
713 | fi |
||
714 | |||
715 | expect <<EOD |
||
716 | set timeout -1 |
||
717 | spawn cadaver ${URL_REPO[$i]} |
||
718 | expect (y/n) |
||
719 | send y\r |
||
720 | expect dav:/download/projects/${REPO_NAME[$i]}/pool/> |
||
721 | send "cd $PKG_DIR\r" |
||
722 | expect $PKG_DIR/> |
||
723 | send "lcd $PKG_DIR\r" |
||
724 | expect $PKG_DIR/> |
||
725 | send "mput *.gvspki\r" |
||
726 | expect "Nombre de usuario:" |
||
727 | send $USER\r |
||
728 | expect "Contraseña:" |
||
729 | send $PASS\r |
||
730 | expect $PKG_DIR/> |
||
731 | send "mput *.gvspkg\r" |
||
732 | expect $PKG_DIR/> |
||
733 | send quit\r |
||
734 | expect "cerrada." |
||
735 | EOD |
||
736 | |||
737 | done |
||
738 | done |
||
739 | |||
740 | cd $CURRENT_DIRECTORY |