forked from OSGeo/gdal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
215 lines (202 loc) · 9.79 KB
/
appveyor.yml
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
branches:
except:
- /(cherry-pick-)?backport-\d+-to-/
# build will be skipped if all of the files match any of
# the file patterns below
skip_commits:
files:
- doc/**/*
environment:
matrix:
#- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
# VS_VERSION: Visual Studio 16
# VS_VER: 2019
# SDK: release-1911 # gisinternals SDK version still to 2017
# MSVC_VER: 1920
# platform: x86
# PROJ_BRANCH: 7.0
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
VS_VERSION: Visual Studio 14
VS_VER: 2015
SDK: release-1900-x64 # gisinternals SDK version
MSVC_VER: 1900
platform: x64
PROJ_BRANCH: 6.3
shallow_clone: true
cache:
- downloads -> appveyor.yml
- '%LOCALAPPDATA%\pip\Cache'
- C:\ProgramData\chocolatey\bin -> appveyor.yml
- C:\ProgramData\chocolatey\lib -> appveyor.yml
init:
- ps: |
if($env:platform -eq "x86")
{
$env:PATH="c:\Python36;c:\Python36\Scripts;$env:PATH"
$env:ARCHITECTURE="x86"
$env:WIN64_ARG=""
$env:CMAKE_ARCHITECTURE="Win32"
}
else
{
$env:PATH="c:\Python36-x64;c:\Python36-x64\Scripts;$env:PATH"
$env:ARCHITECTURE="amd64"
$env:WIN64_ARG="WIN64=YES"
$env:CMAKE_ARCHITECTURE="x64"
}
function exec
{
param ( [ScriptBlock] $ScriptBlock )
& $ScriptBlock 2>&1 | ForEach-Object -Process { "$_" }
if ($LastExitCode -ne 0) { exit $LastExitCode }
}
## Accessing build worker via Remote Desktop for debug purpose
## During the build you have full "administrator" access
## to that VM and can access it via Remote Desktop (RDP).
## You need to set password in a setup page.
## https://www.appveyor.com/docs/how-to/rdp-to-build-worker/
#
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
## If you need to investigate worker on build finish uncomment here instead of above.
## It pauses the build until a special "lock" file on VM desktop is deleted
#
# on_failure:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
install:
- if "%VS_VER%" == "2019" CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat" -arch=%ARCHITECTURE%
- python --version
- git clone https://github.com/microsoft/vcpkg
- cd vcpkg
# Workaround https://github.com/microsoft/vcpkg/issues/11666
- if "%VS_VER%" == "2015" git checkout a64dc07690bc8806e717e190f62eb58e198b599c
- bootstrap-vcpkg.bat
- set PATH=%CD%;%PATH%
- cd ..
- ps: |
Install-PackageProvider NuGet -Force
Import-PackageProvider NuGet -Force
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Install-Module Pscx -AllowClobber
Install-Module VSSetup -Scope CurrentUser
# Install SWIG by Choco
cinst -y --no-progress --version 3.0.12 --force swig
if($env:VS_VER -eq "2019")
{
}
else
{
Import-VisualStudioVars -VisualStudioVersion $env:VS_VER -Architecture $env:ARCHITECTURE
}
exec { pip install numpy }
$env:SDK_ZIP="$env:SDK"+"-dev.zip"
$env:SDK_URL="http://download.gisinternals.com/sdk/downloads/$env:SDK_ZIP"
if(-Not (Test-Path -Path downloads)) { mkdir downloads }
cd downloads
if(-Not (Test-Path -Path $env:SDK_ZIP )) { appveyor DownloadFile "$env:SDK_URL" }
cd ..
mkdir sdk
cd sdk
exec { 7z x ..\downloads\$env:SDK_ZIP }
$env:SDK_PREFIX="$env:APPVEYOR_BUILD_FOLDER\sdk\$env:SDK"
$env:SDK_INC="$env:SDK_PREFIX\include"
$env:SDK_LIB="$env:SDK_PREFIX\lib"
$env:SDK_BIN="$env:SDK_PREFIX\bin"
$env:NMAKE_LOCAL= "GEOS_CFLAGS=-I`$(SDK_INC) -DHAVE_GEOS`n"
$env:NMAKE_LOCAL+="GEOS_LIB=`$(SDK_LIB)\geos_c.lib`n"
$env:NMAKE_LOCAL+="PG_INC_DIR=`$(SDK_INC)`n"
$env:NMAKE_LOCAL+="PG_LIB=`$(SDK_LIB)\libpqdll.lib wsock32.lib`n"
$env:NMAKE_LOCAL+="CURL_DIR=bla`n"
$env:NMAKE_LOCAL+="CURL_INC=-I`$(SDK_INC)`n"
$env:NMAKE_LOCAL+="CURL_LIB=`$(SDK_LIB)\libcurl_imp.lib wsock32.lib wldap32.lib winmm.lib`n"
$env:NMAKE_LOCAL+="SQLITE_INC=-I`$(SDK_INC) -DHAVE_SPATIALITE -DSPATIALITE_AMALGAMATION`n"
$env:NMAKE_LOCAL+="SQLITE_LIB=`$(SDK_LIB)\spatialite_i.lib `$(SDK_LIB)\sqlite3_i.lib`n"
$env:NMAKE_LOCAL+="KMLSUPEROVERLAY_SUPPORTED = YES`n"
$env:NMAKE_LOCAL+="MINIZIP_INCLUDE = -I`$(SDK_INC)`n"
$env:NMAKE_LOCAL+="MINIZIP_LIBRARY = `$(SDK_LIB)\minizip.lib`n"
$env:NMAKE_LOCAL+="MYSQL_INC_DIR=`$(SDK_INC)`n"
$env:NMAKE_LOCAL+="MYSQL_LIB=`$(SDK_LIB)\libmysql.lib advapi32.lib`n"
$env:NMAKE_LOCAL+="XERCES_DIR=bla`n"
$env:NMAKE_LOCAL+="XERCES_INCLUDE=-I`$(SDK_INC) -I`$(SDK_INC)\xercesc`n"
$env:NMAKE_LOCAL+="XERCES_LIB=`$(SDK_LIB)\xerces-c_3.lib`n"
$env:NMAKE_LOCAL+="ILI_ENABLED = YES`n"
$env:NMAKE_LOCAL+="EXPAT_DIR=bla`n"
$env:NMAKE_LOCAL+="EXPAT_INCLUDE=-I`$(SDK_INC)`n"
$env:NMAKE_LOCAL+="EXPAT_LIB=`$(SDK_LIB)\expat.lib`n"
$env:NMAKE_LOCAL+="LIBKML_DIR=bla`n"
$env:NMAKE_LOCAL+="LIBKML_INCLUDE=-I`$(SDK_INC)`n"
$env:NMAKE_LOCAL+="LIBKML_LIBS=`$(SDK_LIB)\libkmlbase.lib `$(SDK_LIB)\libkmlconvenience.lib `$(SDK_LIB)\libkmldom.lib `$(SDK_LIB)\libkmlengine.lib `$(SDK_LIB)\libkmlregionator.lib `$(SDK_LIB)\libkmlxsd.lib `$(SDK_LIB)\expat.lib `$(SDK_LIB)\zdll.lib`n"
$env:NMAKE_LOCAL+="POPPLER_ENABLED = YES`n"
$env:NMAKE_LOCAL+="POPPLER_CFLAGS = -I`$(SDK_INC) -I`$(SDK_INC)\poppler`n"
$env:NMAKE_LOCAL+="POPPLER_MAJOR_VERSION = 0`n"
$env:NMAKE_LOCAL+="POPPLER_MINOR_VERSION = 30`n"
$env:NMAKE_LOCAL+="POPPLER_LIBS = `$(SDK_LIB)\poppler.lib `$(SDK_LIB)\freetype.lib `$(SDK_LIB)\harfbuzz.lib advapi32.lib gdi32.lib`n"
$env:NMAKE_LOCAL+="OPENJPEG_ENABLED = YES`n"
$env:NMAKE_LOCAL+="OPENJPEG_CFLAGS = -I`$(SDK_INC)\openjpeg-2.1`n"
$env:NMAKE_LOCAL+="OPENJPEG_LIB = `$(SDK_LIB)\openjp2.lib`n"
$env:NMAKE_LOCAL+="ECWDIR=bla`n"
$env:NMAKE_LOCAL+="ECWLIB=`$(SDK_LIB)\libecwj2.lib`n"
$env:NMAKE_LOCAL+="ECWFLAGS=-DECWSDK_VERSION=33 -I`$(SDK_INC) /D_MBCS /D_UNICODE /DUNICODE /D_WINDOWS /DLIBECWJ2 /DWIN32 /D_WINDLL -DNO_X86_MMI`n"
$env:NMAKE_LOCAL+="HDF5_DIR = `$(SDK_PREFIX)`n"
$env:NMAKE_LOCAL+="HDF5_LIB = `$(SDK_LIB)\hdf5.lib`n"
$env:NMAKE_LOCAL+="KEA_CFLAGS = -I`$(SDK_INC)`n"
$env:NMAKE_LOCAL+="KEA_LIB = `$(SDK_LIB)\libkea.lib `$(SDK_LIB)\hdf5_cpp.lib`n"
$env:NMAKE_LOCAL+="NETCDF_SETTING=yes`n"
$env:NMAKE_LOCAL+="NETCDF_LIB=`$(SDK_LIB)\netcdf.lib`n"
$env:NMAKE_LOCAL+="NETCDF_INC_DIR=`$(SDK_INC)`n"
$env:NMAKE_LOCAL+="NETCDF_HAS_NC4 = yes`n"
$env:NMAKE_LOCAL+="PROJ_INCLUDE=-I$env:APPVEYOR_BUILD_FOLDER\install-proj\include`n"
$env:NMAKE_LOCAL+="PROJ_LIBRARY=$env:APPVEYOR_BUILD_FOLDER\install-proj\lib\proj.lib`n"
$env:NMAKE_LOCAL | Set-Content "$env:APPVEYOR_BUILD_FOLDER\nmake.local"
#
cd $env:APPVEYOR_BUILD_FOLDER
exec { git clone --depth=1 -b $env:PROJ_BRANCH https://github.com/OSGeo/PROJ proj }
cd proj
exec { mkdir build }
cd build
$env:VCPKG_PLATFORM="$env:platform"+"-windows"
exec { vcpkg install sqlite3:$env:VCPKG_PLATFORM }
appveyor DownloadFile https://sqlite.org/2018/sqlite-tools-win32-x86-3250100.zip
exec { 7z x sqlite-tools-win32-x86-3250100.zip }
exec { copy sqlite-tools-win32-x86-3250100/sqlite3.exe $env:APPVEYOR_BUILD_FOLDER }
$env:PATH="$env:APPVEYOR_BUILD_FOLDER;$env:PATH"
$env:PROJ_INSTALL_DIR="$env:APPVEYOR_BUILD_FOLDER"+"\install-proj"
$env:CMAKE_INSTALL_PREFIX="-DCMAKE_INSTALL_PREFIX=" + $env:PROJ_INSTALL_DIR
exec { cmake -G $env:VS_VERSION -A $env:CMAKE_ARCHITECTURE .. $env:CMAKE_INSTALL_PREFIX -DPROJ_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_LIBPROJ_SHARED=ON -DCMAKE_TOOLCHAIN_FILE=c:/projects/gdal/vcpkg/scripts/buildsystems/vcpkg.cmake -DBUILD_SHARED_LIBS=ON -DENABLE_CURL=OFF -DENABLE_TIFF=OFF -DBUILD_PROJSYNC=OFF }
exec { cmake --build . --config Release --target install }
cd $env:APPVEYOR_BUILD_FOLDER\install-proj\share\proj
appveyor DownloadFile http://download.osgeo.org/proj/proj-datumgrid-1.8.zip
exec { 7z x proj-datumgrid-1.8.zip -aoa }
#
cd $env:APPVEYOR_BUILD_FOLDER
exec { copy $env:APPVEYOR_BUILD_FOLDER\install-proj\bin\*.dll . }
exec { nmake /f makefile.vc MSVC_VER=$env:MSVC_VER $env:WIN64_ARG USER_DEFS=/WX }
cd apps
exec { nmake /f makefile.vc test_ogrsf.exe MSVC_VER=$env:MSVC_VER $env:WIN64_ARG USER_DEFS=/WX }
$env:DISTUTILS_USE_SDK=1
$env:MSSdk=1
cd $env:APPVEYOR_BUILD_FOLDER\swig\python
exec { python setup.py build }
exec { python setup.py install }
cd $env:APPVEYOR_BUILD_FOLDER\swig\csharp
exec { nmake /f makefile.vc interface}
exec { nmake /f makefile.vc all $env:WIN64_ARG}
cd $env:APPVEYOR_BUILD_FOLDER\autotest\cpp
exec { nmake /f makefile.vc MSVC_VER=$env:MSVC_VER $env:WIN64_ARG }
build: off
test_script:
- ps: |
$env:PATH="$env:APPVEYOR_BUILD_FOLDER;$env:APPVEYOR_BUILD_FOLDER\apps;$env:SDK_BIN;$env:PATH"
$env:GDAL_DATA="$env:APPVEYOR_BUILD_FOLDER\data"
# $env:PROJ_LIB="$env:APPVEYOR_BUILD_FOLDER\install-proj\share"
$env:DO_NOT_FAIL_ON_RECODE_ERRORS="YES"
# The ca-bundle.crt file which we could point to is invalid in the current SDK
# See https://github.com/gisinternals/buildsystem/issues/104
$env:GDAL_HTTP_UNSAFESSL="YES"
cd $env:APPVEYOR_BUILD_FOLDER\autotest\cpp
exec { nmake /f makefile.vc check MSVC_VER=$env:MSVC_VER $env:WIN64_ARG }
cd $env:APPVEYOR_BUILD_FOLDER\autotest
exec { pip install -Ur requirements.txt }
exec { pytest -vv }
cd $env:APPVEYOR_BUILD_FOLDER\swig\csharp
exec { nmake /f makefile.vc test}
deploy: off