Skip to content

Commit e8f077f

Browse files
committedJan 26, 2018
update package*.cmd for GRASS 7.4
1 parent f392a71 commit e8f077f

File tree

2 files changed

+36
-12
lines changed

2 files changed

+36
-12
lines changed
 

‎ms-windows/osgeo4w/package-nightly.cmd

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,15 @@ set CMAKE_OPT=^
9090
-D CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS=TRUE
9191

9292
:devenv
93-
for /f "usebackq tokens=1" %%a in (`%OSGEO4W_ROOT%\bin\grass72 --config path`) do set GRASS72_PATH=%%a
94-
for %%i in ("%GRASS72_PATH%") do set GRASS72_VERSION=%%~nxi
95-
set GRASS72_VERSION=%GRASS72_VERSION:grass-=%
96-
set GRASS_VERSIONS=%GRASS6_VERSION% %GRASS72_VERSION%
93+
set GRASS7=
94+
if exist %OSGEO4W_ROOT%\bin\grass72.bat set GRASS7=%OSGEO4W_ROOT%\bin\grass72.bat
95+
if exist %OSGEO4W_ROOT%\bin\grass74.bat set GRASS7=%OSGEO4W_ROOT%\bin\grass74.bat
96+
if "%GRASS7%"=="" (echo GRASS7 not found & goto error)
97+
98+
for /f "usebackq tokens=1" %%a in (`%GRASS7% --config path`) do set GRASS7_PATH=%%a
99+
for %%i in ("%GRASS7_PATH%") do set GRASS7_VERSION=%%~nxi
100+
set GRASS7_VERSION=%GRASS7_VERSION:grass-=%
101+
set GRASS_VERSIONS=%GRASS6_VERSION% %GRASS7_VERSION%
97102

98103
set PYTHONPATH=
99104
path %PF86%\CMake\bin;%PATH%;c:\cygwin\bin
@@ -164,7 +169,7 @@ cmake %CMAKE_OPT% ^
164169
-D WITH_GRASS6=TRUE ^
165170
-D WITH_GRASS7=TRUE ^
166171
-D GRASS_PREFIX=%O4W_ROOT%/apps/grass/grass-%GRASS6_VERSION% ^
167-
-D GRASS_PREFIX7=%GRASS72_PATH:\=/% ^
172+
-D GRASS_PREFIX7=%GRASS7_PATH:\=/% ^
168173
-D WITH_GLOBE=TRUE ^
169174
-D WITH_TOUCH=TRUE ^
170175
-D WITH_ORACLE=TRUE ^
@@ -235,6 +240,7 @@ set TMP=%oldtmp%
235240
PATH %oldpath%
236241

237242
:skiptests
243+
:package
238244

239245
if exist "%PKGDIR%" (
240246
echo REMOVE: %DATE% %TIME%
@@ -324,11 +330,12 @@ goto end
324330
:usage
325331
echo usage: %0 version package packagename arch [sha [site]]
326332
echo sample: %0 2.11.0 38 qgis-dev x86_64 339dbf1 qgis.org
327-
exit
333+
exit /b 1
328334

329335
:error
330336
echo BUILD ERROR %ERRORLEVEL%: %DATE% %TIME%
331337
if exist %PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2 del %PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2
338+
exit /b 1
332339

333340
:end
334341
echo FINISHED: %DATE% %TIME%

‎ms-windows/osgeo4w/package.cmd

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,15 @@ set CMAKE_OPT=^
8686
-D CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS=TRUE
8787

8888
:devenv
89-
for /f "usebackq tokens=1" %%a in (`%OSGEO4W_ROOT%\bin\grass72 --config path`) do set GRASS72_PATH=%%a
90-
for %%i in ("%GRASS72_PATH%") do set GRASS72_VERSION=%%~nxi
91-
set GRASS72_VERSION=%GRASS72_VERSION:grass-=%
92-
set GRASS_VERSIONS=%GRASS6_VERSION% %GRASS72_VERSION%
89+
set GRASS7=
90+
if exist %OSGEO4W_ROOT%\bin\grass72.bat set GRASS7=%OSGEO4W_ROOT%\bin\grass72.bat
91+
if exist %OSGEO4W_ROOT%\bin\grass74.bat set GRASS7=%OSGEO4W_ROOT%\bin\grass74.bat
92+
if "%GRASS7%"=="" (echo GRASS7 not found & goto error)
93+
94+
for /f "usebackq tokens=1" %%a in (`%GRASS7% --config path`) do set GRASS7_PATH=%%a
95+
for %%i in ("%GRASS7_PATH%") do set GRASS7_VERSION=%%~nxi
96+
set GRASS7_VERSION=%GRASS7_VERSION:grass-=%
97+
set GRASS_VERSIONS=%GRASS6_VERSION% %GRASS7_VERSION%
9398

9499
set PYTHONPATH=
95100
path %PF86%\CMake\bin;%PATH%;c:\cygwin\bin
@@ -160,7 +165,7 @@ cmake %CMAKE_OPT% ^
160165
-D WITH_GRASS6=TRUE ^
161166
-D WITH_GRASS7=TRUE ^
162167
-D GRASS_PREFIX=%O4W_ROOT%/apps/grass/grass-%GRASS6_VERSION% ^
163-
-D GRASS_PREFIX7=%GRASS72_PATH:\=/% ^
168+
-D GRASS_PREFIX7=%GRASS7_PATH:\=/% ^
164169
-D WITH_GLOBE=TRUE ^
165170
-D WITH_TOUCH=TRUE ^
166171
-D WITH_ORACLE=TRUE ^
@@ -209,7 +214,15 @@ if exist ..\skiptests goto skiptests
209214

210215
echo RUN_TESTS: %DATE% %TIME%
211216

217+
set oldtemp=%TEMP%
218+
set oldtmp=%TMP%
212219
set oldpath=%PATH%
220+
221+
set TEMP=%TEMP%\%PACKAGENAME%-%ARCH%
222+
set TMP=%TEMP%
223+
if exist "%TEMP%" rmdir /s /q "%TEMP%"
224+
mkdir "%TEMP%"
225+
213226
for %%g IN (%GRASS_VERSIONS%) do (
214227
set path=!path!;%OSGEO4W_ROOT%\apps\grass\grass-%%g\lib
215228
set GISBASE=%OSGEO4W_ROOT%\apps\grass\grass-%%g
@@ -219,6 +232,8 @@ PATH %path%;%BUILDDIR%\output\plugins\%BUILDCONF%
219232
cmake --build %BUILDDIR% --target Experimental --config %BUILDCONF%
220233
if errorlevel 1 echo TESTS WERE NOT SUCCESSFUL.
221234

235+
set TEMP=%oldtemp%
236+
set TMP=%oldtmp%
222237
PATH %oldpath%
223238

224239
:skiptests
@@ -233,6 +248,7 @@ echo INSTALL: %DATE% %TIME%
233248
cmake --build %BUILDDIR% --target INSTALL --config %BUILDCONF%
234249
if errorlevel 1 (echo INSTALL failed & goto error)
235250

251+
:package
236252
echo PACKAGE: %DATE% %TIME%
237253

238254
cd ..
@@ -475,13 +491,14 @@ goto end
475491
:usage
476492
echo usage: %0 version package packagename arch [sha [site]]
477493
echo sample: %0 2.0.1 3 qgis x86 f802808
478-
exit
494+
exit /b 1
479495

480496
:error
481497
echo BUILD ERROR %ERRORLEVEL%: %DATE% %TIME%
482498
for %%i in ("" "-common" "-server" "-devel" "-grass-plugin" "-globe-plugin" "-oracle-provider") do (
483499
if exist %ARCH%\release\qgis\%PACKAGENAME%%%i\%PACKAGENAME%%%i-%VERSION%-%PACKAGE%.tar.bz2 del %ARCH%\release\qgis\%PACKAGENAME%%%i\%PACKAGENAME%%%i-%VERSION%-%PACKAGE%.tar.bz2
484500
)
501+
exit /b 1
485502

486503
:end
487504
echo FINISHED: %DATE% %TIME%

0 commit comments

Comments
 (0)
Please sign in to comment.