forked from moneymanagerex/moneymanagerex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
216 lines (203 loc) · 7.33 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
215
216
version: '{build}'
clone_depth: 10 # to allow queued build jobs
image:
- Visual Studio 2017
configuration:
- Release
# - Debug
platform:
- x64
- Win32
matrix:
fast_finish: true
exclude:
# not installed
- { comp: 110, image: Visual Studio 2017 }
- { comp: 120, image: Visual Studio 2017 }
allow_failures:
- configuration: Debug
environment:
# use cache with 7z compression
APPVEYOR_CACHE_ENTRY_ZIP_ARGS: -t7z -m0=lzma -mx=9
# Use cygwin embeded gettext tools
path: '%path%;C:\cygwin64\bin'
# clcache config
clcVer: 4.1.0
# libcurl config
curlVer: 7_82_0
curldir: C:\curl-$(curlVer)
curlStatic: ON
# wxWidgets config
wxVer: 3.2.1
wxwin: C:\wxWidgets-$(wxVer)-$(configuration)
wxShared: 0
wxURL: https://github.com/wxWidgets/wxWidgets/releases/download/v$(wxVer)
# Microsoft compiler options
CL: /MP
# Python version to use
pythonDir: C:\Python38-x64
matrix:
# - comp: 141
- { comp: 141, wxShared: 1 }
# - { comp: 141, xp: _xp }
# - { comp: 141, xp: _xp, wxShared: 1 }
# - comp: 140
# - { comp: 140, wxShared: 1 }
# - { comp: 140, xp: _xp }
# - { comp: 140, xp: _xp, wxShared: 1 }
# - comp: 120
# - { comp: 120, wxShared: 1 }
# - { comp: 120, xp: _xp }
- { comp: 120, xp: _xp, wxShared: 1 }
# v110 not working so far - see issue #1307 on GitHub
# - comp: 110
# - { comp: 110, wxShared: 1 }
# - { comp: 110, xp: _xp }
# - { comp: 110, xp: _xp, wxShared: 1 }
init:
# AppVeyor missing paths
- if "%VS150COMNTOOLS%"=="" set "VS150COMNTOOLS=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\Common7\Tools\"
Set python path
- cmd: set PATH=%pythonDir%;%pythonDir%\Scripts;%PATH%
# Set developer command prompt
- if %platform:~-2%==64 (set arch=amd64) else (set arch=amd64_x86)
- if %comp% LSS 120 if %platform:~-2%==64 (set arch=x86_amd64) else (set arch=x86)
- call set "vcvarsall=%%VS%comp%COMNTOOLS%%..\..\VC\vcvarsall.bat"
- if %comp%==141 set "vcvarsall=%VS150COMNTOOLS%..\..\VC\Auxiliary\Build\vcvarsall.bat"
- call "%vcvarsall%" %arch%
# detect MSVC compiler version
- for /f "tokens=1,2 delims=." %%a in ('cl 2^>^&1 ^| findstr /r "\<[0-9][0-9]*\.[0-9][0-9]*\."') do (
for %%c in (%%a%%b) do set "clver=%%c"
)
- echo %clver% > ..\MSVC_ver.txt
# Set wxWidgets library paths
- if %platform:~-2%==64 set wxSuff=_x64
- set "wxLibFolder=%wxwin%\lib\vc%comp%%xp%%wxSuff%"
- if %wxShared%==0 (set wxLibFolder=%wxLibFolder%_lib)
else (set wxLibFolder=%wxLibFolder%_dll)
# Set curl library paths
- set "curlLibFolder=%curldir%\vc%comp%%xp%%wxSuff%_%configuration%"
- if %curlStatic%==ON (set curlLibFolder=%curlLibFolder%_lib)
else (set curlLibFolder=%curlLibFolder%_dll)
# Print some info
- echo %APPVEYOR_BUILD_WORKER_IMAGE% %platform% v%comp%%xp% %configuration% %arch%
# clcache unique directory
- set "CLCACHE_DIR=C:\clcache-%APPVEYOR_BUILD_WORKER_IMAGE%-%platform%-v%comp%%xp%"
# prepare cmake options
- if %comp%==110 (set "gen=11 2012" & set "tool=v%comp%%xp%")
- if %comp%==120 (set "gen=12 2013" & set "tool=v%comp%%xp%,host=x64")
- if %comp%==140 (set "gen=14 2015" & set "tool=v%comp%%xp%,host=x64")
- if %comp%==141 (set "gen=15 2017" & set "tool=v%comp%%xp%,host=x64")
- if %platform:~-2%==64 set "gen=%gen% Win64"
cache:
- '%wxwin%\lib -> ..\MSVC_ver.txt'
- '%curlLibFolder%'
- '%CLCACHE_DIR% -> ..\MSVC_ver.txt'
install:
# setup clcache
- nuget install clcache -Version %clcVer% -ExcludeVersion -Verbosity quiet
- copy clcache\clcache-%clcVer%\clcache.exe clcache\clcache-%clcVer%\cl.exe
- if exist %APPVEYOR_BUILD_FOLDER%\clcache\clcache-%clcVer%\cl.exe set "PATH=%APPVEYOR_BUILD_FOLDER%\clcache\clcache-%clcVer%;%PATH%"
- clcache -s
# Patch CMake
- for /d %%d in ("%ProgramFiles(x86)%\CMake\share\cmake-*") do (
type util\FindwxWidgets.cmake-SupportMSVC1911.patch 2>nul | patch -Nf -d "%%d\Modules"
)
# wxWidgets, try to download pre-compiled version first
- if %wxShared%==1 (
curl -fsL --fail-early
-O %wxURL%/wxMSW-%wxVer%_vc%comp%%xp%%wxSuff%_Dev.7z
-O %wxURL%/wxWidgets-%wxVer%-headers.7z &&
if %configuration%==Release
curl -fsL -O %wxURL%/wxMSW-%wxVer%_vc%comp%%xp%%wxSuff%_ReleaseDLL.7z
) || exit 0
- if not exist wxMSW-%wxVer%_vc%comp%%xp%%wxSuff%_Dev.7z
curl -fsSL -O %wxURL%/wxWidgets-%wxVer%.7z
- 7z x -y "-o%wxwin%" wx*-%wxVer%*.7z
# wxWidgets, build script from build/tools/msvs/officialbuild.bat
- if %configuration%==Release set "wxConf=BUILD=release"
- if not %platform:~-2%==64 set "wxFlags=CPPFLAGS=/arch:SSE CFLAGS=/arch:SSE"
- if not exist "%wxLibFolder%" (
echo Building wxWidgets %wxVer% &
cd %wxwin%\build\msw &&
nmake /nologo /s /f makefile.vc %wxConf% COMPILER_VERSION=%comp%%xp%
TARGET_CPU=%platform% DEBUG_INFO=default SHARED=%wxShared% VENDOR=mmex %wxFlags%
wxUSE_UNSAFE_WXSTRING_CONV=0
)
# libcurl
- if %configuration%==Debug (
set "curlConf=-DENABLE_DEBUG=ON" &&
set "curlFlags=/Z7"
)
- if not exist "%curlLibFolder%" (
echo Building libcurl %curlVer% &
git clone -q --depth=1 -b curl-%curlVer% --single-branch https://github.com/curl/curl.git %curldir%-src &&
mkdir %curldir%-src\build && cd %curldir%-src\build &&
cmake -T %tool% -G "Visual Studio %gen%" %curlConf%
-DBUILD_CURL_EXE=OFF
-DCURL_STATICLIB=%curlStatic%
-DHTTP_ONLY=ON
-DENABLE_MANUAL=OFF
-DCURL_USE_SCHANNEL=ON
-DBUILD_TESTING=OFF
-DCMAKE_INSTALL_PREFIX=%curlLibFolder%
.. &&
cmake --build . --target install --config %configuration%
-- /maxcpucount /verbosity:minimal /nologo /p:PreferredToolArchitecture=x64 %curlFlags%
)
before_build:
- cd %APPVEYOR_BUILD_FOLDER%
- git submodule update -q --init
# regenerate database files
- cd src\db &&
python ..\..\util\sqlite2cpp.py ..\..\database\tables.sql &&
python ..\..\util\sqliteupgrade2cpp.py ..\..\database\incremental_upgrade &&
del *.mmdbg sql*.sql
- cd %APPVEYOR_BUILD_FOLDER%
build_script:
- mkdir build & cd build
- if %configuration%==Debug
set "cmake_def=-DCMAKE_INSTALL_DEBUG_LIBRARIES=ON -DCMAKE_INSTALL_DEBUG_LIBRARIES_ONLY=ON"
- set "cmake_def=%cmake_def% -DCMAKE_PREFIX_PATH=%curlLibFolder%"
- cmake --graphviz=mmex.dot -T %tool% -G "Visual Studio %gen%" %cmake_def% ..
- cmake --build . --target package --config %configuration%
-- /maxcpucount /verbosity:minimal /nologo /p:PreferredToolArchitecture=x64
after_build:
- clcache -s
# rename and move
- if %configuration%==Debug set "pkgsuff=-debug"
- for %%f in (*.exe *.zip) do
if /i %%~xf==.exe (move "%%f" "..\%%~nf%xp%%pkgsuff%.exe")
else ( mkdir "%%~nf%xp%%pkgsuff%" &&
fsutil file createnew "%%~nf%xp%%pkgsuff%\mmexini.db3" 0 &&
7z a "%%f" "%%~nf%xp%%pkgsuff%\mmexini.db3" &&
move "%%f" "..\%%~nf%xp%%pkgsuff%-portable.zip")
test: off
on_success:
# don't cache downloaded wxWidgets binaries
- if %wxShared%==1 (
if exist wxMSW-%wxVer%_vc%comp%%xp%%wxSuff%_Dev.7z
rmdir /s /q "%wxLibFolder%"
)
artifacts:
- path: '*.exe'
name: installer
- path: '*.zip'
name: portable
- path: build\mmex.dot
name: build dependency graph
deploy:
description: 'release created by AppVeyor CI'
provider: GitHub
auth_token: '%GitHub_auth_token%'
artifact: installer,portable
draft: true
prerelease: true
on:
appveyor_repo_tag: true # deploy on tag push only
configuration: Release # Debug contains non-redist MS DLLs
#notifications:
#- provider: Slack
# auth_token:
# secure: kBl9BlxvRMr9liHmnBs14A==
# channel: '#appveyor'