-
Notifications
You must be signed in to change notification settings - Fork 7
/
package.bat
46 lines (34 loc) · 947 Bytes
/
package.bat
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
@echo off
SETLOCAL
SET EL=0
SET MAPNIKGYPDIR=%CD%
echo ------ packaging mapnik sdk -----
cd ..
FOR /F "tokens=*" %%i in ('git describe') do SET GITVERSION=%%i
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
CD %MAPNIKGYPDIR%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO mapnik %GITVERSION%
if %TARGET_ARCH% EQU 32 (
SET ARCH=x86
) ELSE (
SET ARCH=x64
)
SET PKGNAME=mapnik-win-sdk-%GITVERSION%-%ARCH%-%TOOLS_VERSION%.7z
ECHO packaging to %PKGNAME%
IF EXIST %PKGNAME% DEL %PKGNAME%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
7z a -mx9 %PKGNAME% mapnik-sdk | %windir%\system32\FIND /v "Compressing"
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
IF EXIST %ROOTDIR%\bin\%PKGNAME% DEL /Q %ROOTDIR%\bin\%PKGNAME%
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
COPY %PKGNAME% %ROOTDIR%\bin\
IF %ERRORLEVEL% NEQ 0 GOTO ERROR
ECHO mapnik package copied to %ROOTDIR%\bin\%PKGNAME%
GOTO DONE
:ERROR
SET EL=%ERRORLEVEL%
echo ----------ERROR NODE_MAPNIK --------------
:DONE
CD %MAPNIKGYPDIR%
EXIT /b %EL%