forked from moneymanagerex/moneymanagerex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.appveyor.yml
193 lines (181 loc) · 6.85 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
version: '{build}'
image:
- Visual Studio 2019
- Visual Studio 2017
# - Visual Studio 2015
configuration:
- Release
# - Debug
platform:
- x64
- x86
matrix:
fast_finish: true
exclude:
# not installed
- { comp: 142, image: Visual Studio 2017 }
- { comp: 142, image: Visual Studio 2015 }
- { comp: 141, image: Visual Studio 2015 }
- { xp: _xp, image: Visual Studio 2019 }
# duplicated - select only one
- { comp: 120, image: Visual Studio 2019 }
- { comp: 120, image: Visual Studio 2017 }
- { comp: 140, image: Visual Studio 2017 }
- { comp: 140, image: Visual Studio 2019 }
allow_failures:
- configuration: Debug
environment:
# use cache with 7z compression
APPVEYOR_CACHE_ENTRY_ZIP_ARGS: -t7z -m0=lzma -mx=9
APPVEYOR_SAVE_CACHE_ON_ERROR: true
# Use cygwin embedded gettext tools and Python 3.8
path: 'C:\Python38-x64;C:\Python38-x64\Scripts;%path%;C:\cygwin64\bin'
# clcache config
clcVer: 4.1.0
# wxWidgets config
wxVer: 3.1.3
wxwin: C:\wxWidgets-$(wxver)-$(configuration)
wxShared: 0
wxURL: https://github.com/wxWidgets/wxWidgets/releases/download/v$(wxver)
# Microsoft compiler options
CL: /MP
matrix:
# - comp: 142
- { comp: 142, wxShared: 1 }
# - 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 }
init:
# AppVeyor missing paths
- if "%VS160COMNTOOLS%"=="" if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2019 Preview" set "VS160COMNTOOLS=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Preview\Common7\Tools\"
- if "%VS160COMNTOOLS%"=="" if "%APPVEYOR_BUILD_WORKER_IMAGE:~0,18%"=="Visual Studio 2019" set "VS160COMNTOOLS=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\Common7\Tools\"
- if "%VS150COMNTOOLS%"=="" if "%APPVEYOR_BUILD_WORKER_IMAGE:~0,18%"=="Visual Studio 2017" set "VS150COMNTOOLS=%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\Common7\Tools\"
# Set developer command prompt
- if /i %platform%==x64 (set arch=amd64) else (set arch=amd64_x86)
- if %comp% LSS 141 call set "vcvarsall=%%VS%comp%COMNTOOLS%%..\..\VC\vcvarsall.bat"
- if %comp%==141 set "vcvarsall=%VS150COMNTOOLS%..\..\VC\Auxiliary\Build\vcvarsall.bat"
- if %comp%==142 set "vcvarsall=%VS160COMNTOOLS%..\..\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 /i %platform%==x64 set wxSuff=_x64
- set "wxcomp=%comp%"
- if %comp:~0,2%==14 (if %wxVer%==3.1.3 set wxcomp=14x)
- set "wxLibFolder=%wxwin%\lib\vc%wxcomp%%xp%%wxSuff%"
- if %wxShared%==0 (set wxLibFolder=%wxLibFolder%_lib)
else (set wxLibFolder=%wxLibFolder%_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 /i %platform%==x64 (set "cmake_platf=x64") else (set "cmake_platf=Win32")
- if %comp%==120 set "gen=12 2013"
- if %comp%==140 set "gen=14 2015"
- if %comp%==141 set "gen=15 2017"
- if %comp%==142 (set "gen=16 2019" & set "cmake_plat=-A %cmake_platf%")
- if %comp% LSS 142 if /i %platform%==x64 set "gen=%gen% Win64"
# Microsoft compiler debug symbols option
- if /i %configuration%==Debug (set "CL=%CL% /Z7")
# vcpkg config
- set VCPKG_ROOT=C:\Tools\vcpkg
- set VCPKG_DEFAULT_TRIPLET=%platform%-windows
cache:
- '%wxwin%\lib -> ..\MSVC_ver.txt'
- '%CLCACHE_DIR% -> ..\MSVC_ver.txt'
- '%VCPKG_ROOT%\installed'
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
# setup vcpkg
- vcpkg integrate install
- vcpkg list
- vcpkg upgrade --no-dry-run
- vcpkg install curl lua[cpp] rapidjson
# wxWidgets, try to download pre-compiled version first
- if %wxShared%==1 (
curl -fsL --fail-early
-O %wxURL%/wxMSW-%wxVer%_vc%wxcomp%%xp%%wxSuff%_Dev.7z
-O %wxURL%/wxWidgets-%wxVer%-headers.7z &&
if /i %configuration%==Release
curl -fsL -O %wxURL%/wxMSW-%wxVer%_vc%wxcomp%%xp%%wxSuff%_ReleaseDLL.7z
) || exit 0
- if not exist wxMSW-%wxVer%_vc%wxcomp%%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 /i %configuration%==Release set "wxConf=BUILD=release"
- if /i %platform%==x86 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=%wxcomp%%xp%
TARGET_CPU=%platform% DEBUG_INFO=default SHARED=%wxShared% VENDOR=mmex %wxFlags%
wxUSE_UNSAFE_WXSTRING_CONV=0
)
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 /i %configuration%==Debug
set "cmake_def=-DCMAKE_INSTALL_DEBUG_LIBRARIES=ON -DCMAKE_INSTALL_DEBUG_LIBRARIES_ONLY=ON"
- cmake --graphviz=mmex.dot -T v%comp%%xp%,host=x64 -G "Visual Studio %gen%" %cmake_plat% %cmake_def% ..
- cmake --build . --target package --config %configuration%
-- /maxcpucount /verbosity:minimal /nologo
/p:PreferredToolArchitecture=x64 /p:XPDeprecationWarning=false
after_build:
- clcache -s
- vcpkg list
# rename and move
- if /i %configuration%==Debug set "pkgsuff=-debug"
- for %%f in (*.exe *.zip) do
if /i %%~xf==.exe (move "%%f" "..\%%~nf%xp%%pkgsuff%.exe")
else (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%wxcomp%%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
force_update: true
on:
appveyor_repo_tag: true # deploy on tag push only
configuration: Release # Debug contains non-redist MS DLLs