-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
122 lines (94 loc) · 3.62 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
# Notes:
# - Minimal appveyor.yml file is an empty file. All sections are optional.
# - Indent each level of configuration with 2 spaces. Do not use tabs!
# - All section names are case-sensitive.
# - Section names should be unique on each level.
#---------------------------------#
# general configuration #
#---------------------------------#
# version format
version: '{branch}-{build}'
# Do not build on tags (GitHub only)
skip_tags: true
# avoid malicious attempt via pull requests
branches:
only:
- master
#---------------------------------#
# environment configuration #
#---------------------------------#
# environment variables
# build system info: http://www.appveyor.com/docs/installed-software
os: Visual Studio 2015
environment:
PROJECT_DIR: &PROJECT_DIR c:\project
SQLITE_DIR: c:\sqlite
SQLITE_VERSION: 3.12.2
SQLITE_URL: https://www.sqlite.org/2016/sqlite-amalgamation-3120200.zip
CMAKE_GEN_X86: Visual Studio 14 2015
SOL_LIBCHEWING_FILE: INSTALL.vcxproj
MSBUILD_LIBCHEWING_X86: /m /p:Configuration=Release;Platform=Win32
SOL_CHEWINGEDITOR_FILE: chewing-editor.sln
MSBUILD_CHEWINGEDITOR_X86: /m /p:Configuration=Release;Platform=Win32 /t:chewing-editor
# clone directory
clone_folder: *PROJECT_DIR
# set clone depth
clone_depth: 1
#---------------------------------#
# build configuration #
#---------------------------------#
# scripts to run before build
before_build:
# git submodules
- cd "%PROJECT_DIR%"
- git submodule update --init --remote --recursive
# update sqlite-amalgamation
- cd \
- appveyor DownloadFile "%SQLITE_URL%" -FileName "sqlite.zip"
- 7z e "sqlite.zip" -o"%SQLITE_DIR%"
- copy /Y "%SQLITE_DIR%\*" "%PROJECT_DIR%\libchewing\thirdparty\sqlite-amalgamation"
# patch libchewing
- copy "%PROJECT_DIR%\src\libchewing\*.patch" "%PROJECT_DIR%\libchewing"
- cd "%PROJECT_DIR%\libchewing"
- git apply "0001-Use-static-linking-to-libraries.patch"
# build libchewing
- cd "%PROJECT_DIR%\libchewing"
- mkdir "build" && cd "build"
- cmake -G "%CMAKE_GEN_X86%" "../"
- msbuild %SOL_LIBCHEWING_FILE% %MSBUILD_LIBCHEWING_X86%
- move "%PROGRAMFILES(x86)%\libchewing" "%PROJECT_DIR%\chewing-editor\libchewing"
# some .lib files are left not installed
- copy /Y "%PROJECT_DIR%\libchewing\build\Release\*" "%PROJECT_DIR%\chewing-editor\libchewing\lib"
# prepare Qt
- 7z x "%PROJECT_DIR%\src\chewing-editor\libs.7z" -o"c:\" > nul
- set PATH=%PATH%;c:\qt5_32\bin;
# to run your custom scripts instead of automatic MSBuild
build_script:
# patch chewing-editor
- copy "%PROJECT_DIR%\src\chewing-editor\*.patch" "%PROJECT_DIR%\chewing-editor"
- cd "%PROJECT_DIR%\chewing-editor"
- git apply "0001-Add-path-to-libs.patch" "0002-zlib-doesn-t-have-have-SAFESEH.patch"
# build
- cd "%PROJECT_DIR%\chewing-editor"
- mkdir "build" && cd "build"
- cmake -G "%CMAKE_GEN_X86%" "../"
- msbuild %SOL_CHEWINGEDITOR_FILE% %MSBUILD_CHEWINGEDITOR_X86%
# scripts to run before deployment
after_build:
# prepare for artifacts packaging
- cd "%PROJECT_DIR%"
- copy "chewing-editor\build\Release\chewing-editor.exe" "%PROJECT_DIR%" # the artifact must reside at the source repo root
- 'powershell -Command "& { (Get-FileHash -Algorithm SHA1 "chewing-editor.exe").hash; }" > "chewing-editor.sha1"'
#---------------------------------#
# tests configuration #
#---------------------------------#
# to disable automatic tests
test: off
#---------------------------------#
# artifacts configuration #
#---------------------------------#
artifacts:
- path: chewing-editor.exe
name: executable
- path: chewing-editor.sha1
name: checksum