-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathAppVeyorBuild.bat
More file actions
352 lines (244 loc) · 11.9 KB
/
AppVeyorBuild.bat
File metadata and controls
352 lines (244 loc) · 11.9 KB
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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
echo on
rem This script is used by AppVeyor to build the project.
set initial_path=%path%
set version=%APPVEYOR_BUILD_VERSION:~0,-5%
set NPACKD_CL=C:\Program Files\NpackdCL
set onecmd="%npackd_cl%\ncl.exe" path -p com.advancedinstaller.AdvancedInstallerFreeware -r [10,100)
for /f "usebackq delims=" %%x in (`%%onecmd%%`) do set ai=%%x
set onecmd="%npackd_cl%\ncl.exe" path -p org.7-zip.SevenZIP -r [9,100)
for /f "usebackq delims=" %%x in (`%%onecmd%%`) do set SEVENZIP=%%x
set onecmd="%npackd_cl%\ncl.exe" path -p exeproxy -r [0.2,1)
for /f "usebackq delims=" %%x in (`%%onecmd%%`) do set EXEPROXY=%%x
if %bits% equ 64 (call :setvars64) else (call :setvars32)
set path=%mingw%\bin;C:\msys64\mingw64\bin\
mkdir c:\builds
if %static% equ ON (call :buildquazip)
if %errorlevel% neq 0 exit /b %errorlevel%
if %static% equ ON (set extra="-DQUAZIP_INCLUDE_DIRS=quazip\quazip" "-DQUAZIP_LIBRARIES=c:\builds\quazip\quazip\libquazip1-qt5.a")
if %prg% equ npackdcl (call :buildnpackdcl)
if %errorlevel% neq 0 exit /b %errorlevel%
if %prg% equ clu (call :buildclu)
if %errorlevel% neq 0 exit /b %errorlevel%
if %prg% equ npackd (call :buildnpackd)
if %errorlevel% neq 0 exit /b %errorlevel%
goto :eof
rem ---------------------------------------------------------------------------
:setvars32
set mingw_libs=i686-w64-mingw32
set mingw=C:\msys64\mingw32
set onecmd="%npackd_cl%\ncl.exe" path -p drmingw -v 0.7.7
for /f "usebackq delims=" %%x in (`%%onecmd%%`) do set drmingw=%%x
exit /b
rem ---------------------------------------------------------------------------
:setvars64
set mingw_libs=x86_64-w64-mingw32
set mingw=C:\msys64\mingw64
set onecmd="%npackd_cl%\ncl.exe" path -p drmingw64 -v 0.7.7
for /f "usebackq delims=" %%x in (`%%onecmd%%`) do set drmingw=%%x
exit /b
rem ---------------------------------------------------------------------------
:buildquazip
cmake.exe -GNinja -S quazip -B c:\builds\quazip -DCMAKE_BUILD_TYPE=Release -DQUAZIP_QT_MAJOR_VERSION=5 -DQUAZIP_FETCH_LIBS=OFF -DQUAZIP_BZIP2=OFF -DBUILD_SHARED_LIBS:BOOL=OFF -DZLIB_LIBRARY_RELEASE=%mingw%\lib\libz.a -DCMAKE_PREFIX_PATH=C:\msys64\mingw64\qt5-static\lib\cmake
if %errorlevel% neq 0 exit /b %errorlevel%
cmake.exe --build c:\builds\quazip
if %errorlevel% neq 0 exit /b %errorlevel%
exit /b
rem ---------------------------------------------------------------------------
:buildnpackd
set path=%mingw%\bin;%ai%\bin\x86;%sevenzip%;C:\msys64\mingw64\bin
set CMAKE_PREFIX_PATH=%mingw%\%mingw_libs%
set where=c:\builds\npackdg
cmake -GNinja -S npackdg -B %where% -DCMAKE_BUILD_TYPE=MinSizeRel -DNPACKD_FORCE_STATIC:BOOL=%STATIC% %extra%
if %errorlevel% neq 0 exit /b %errorlevel%
cmake.exe --build %where%
if %errorlevel% neq 0 exit /b %errorlevel%
mkdir %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy %where%\npackdg.exe %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy CrystalIcons_LICENSE.txt %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy LICENSE.txt %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
if %static% equ OFF (
"%mingw%\bin\windeployqt.exe" --libdir %where%\install --dir %where%\install --compiler-runtime --pdb %where%\install\npackdg.exe
)
if %errorlevel% neq 0 exit /b %errorlevel%
copy "%EXEPROXY%\exeproxy.exe" %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
if %static% equ OFF (
copy %mingw%\bin\libquazip1-qt5.dll %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy %mingw%\bin\libiconv-2.dll %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy %mingw%\bin\libzstd.dll %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy %mingw%\bin\libintl-8.dll %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy %mingw%\bin\libbrotlidec.dll %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy %mingw%\bin\libbrotlicommon.dll %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy %mingw%\bin\libfreetype-6.dll %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy %mingw%\bin\libgraphite2.dll %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy %mingw%\bin\libglib-2.0-0.dll %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy %mingw%\bin\libpng16-16.dll %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy %mingw%\bin\libicudt72.dll %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy %mingw%\bin\libharfbuzz-0.dll %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy %mingw%\bin\libmd4c.dll %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy %mingw%\bin\libbz2-1.dll %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy %mingw%\bin\zlib1.dll %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy %mingw%\bin\libpcre2-16-0.dll %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy %mingw%\bin\libpcre2-8-0.dll %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy %mingw%\bin\libdouble-conversion.dll %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy %mingw%\bin\libicuin72.dll %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy %mingw%\bin\libicuuc72.dll %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy %mingw%\bin\libsqlite3-0.dll %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
)
C:\Windows\System32\xcopy.exe %where%\install %where%\install-debug /E /I /H /Y
if %errorlevel% neq 0 exit /b %errorlevel%
%mingw%\bin\strip %where%\install\npackdg.exe
if %errorlevel% neq 0 exit /b %errorlevel%
copy %where%\npackdg.map %where%\install-debug
if %errorlevel% neq 0 exit /b %errorlevel%
copy "%DRMINGW%\bin\exchndl.dll" %where%\install-debug
if %errorlevel% neq 0 exit /b %errorlevel%
copy "%DRMINGW%\bin\mgwhelp.dll" %where%\install-debug
if %errorlevel% neq 0 exit /b %errorlevel%
copy "%DRMINGW%\bin\dbghelp.dll" %where%\install-debug
if %errorlevel% neq 0 exit /b %errorlevel%
copy "%DRMINGW%\bin\symsrv.dll" %where%\install-debug
if %errorlevel% neq 0 exit /b %errorlevel%
copy "%DRMINGW%\bin\symsrv.yes" %where%\install-debug
if %errorlevel% neq 0 exit /b %errorlevel%
pushd %where%\install-debug
7z a %where%\Npackd%bits%-debug-%version%.zip * -mx9
if %errorlevel% neq 0 exit /b %errorlevel%
popd
pushd %where%\install
7z a %where%\Npackd%bits%-%version%.zip * -mx9
if %errorlevel% neq 0 exit /b %errorlevel%
popd
copy npackdg\src\npackdg%bits%.aip %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy npackdg\src\app.ico %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
if %static% equ ON (AdvancedInstaller.com /edit %where%\install\npackdg%bits%.aip /SetVersion %version%)
if %errorlevel% neq 0 exit /b %errorlevel%
if %static% equ ON (AdvancedInstaller.com /build %where%\install\npackdg%bits%.aip)
if %errorlevel% neq 0 exit /b %errorlevel%
set path=%initial_path%
appveyor PushArtifact %where%\Npackd%bits%-%version%.zip
if %errorlevel% neq 0 exit /b %errorlevel%
appveyor PushArtifact %where%\Npackd%bits%-debug-%version%.zip
if %errorlevel% neq 0 exit /b %errorlevel%
if %static% equ ON (appveyor PushArtifact %where%\install\Npackd%bits%-%version%.msi)
if %errorlevel% neq 0 exit /b %errorlevel%
exit /b
rem ---------------------------------------------------------------------------
:buildnpackdcl
set path=%mingw%\bin;%ai%\bin\x86;%sevenzip%;C:\msys64\mingw64\bin
set CMAKE_PREFIX_PATH=%mingw%\%mingw_libs%
set where=c:\builds\npackdcl
cmake -GNinja -S npackdcl -B %where% -DCMAKE_BUILD_TYPE=MinSizeRel -DNPACKD_FORCE_STATIC:BOOL=%STATIC% %extra%
if %errorlevel% neq 0 exit /b %errorlevel%
cmake.exe --build %where%
if %errorlevel% neq 0 exit /b %errorlevel%
mkdir %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy %where%\npackdcl.exe %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
"%EXEPROXY%\exeproxy.exe" exeproxy-copy %where%\install\ncl.exe npackdcl.exe
if %errorlevel% neq 0 exit /b %errorlevel%
copy CrystalIcons_LICENSE.txt %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy LICENSE.txt %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
C:\Windows\System32\xcopy.exe %where%\install %where%\install-debug /E /I /H /Y
if %errorlevel% neq 0 exit /b %errorlevel%
%mingw%\bin\strip %where%\install\npackdcl.exe
if %errorlevel% neq 0 exit /b %errorlevel%
copy %where%\npackdcl.map %where%\install-debug
if %errorlevel% neq 0 exit /b %errorlevel%
copy "%DRMINGW%\bin\exchndl.dll" %where%\install-debug
if %errorlevel% neq 0 exit /b %errorlevel%
copy "%DRMINGW%\bin\mgwhelp.dll" %where%\install-debug
if %errorlevel% neq 0 exit /b %errorlevel%
copy "%DRMINGW%\bin\dbghelp.dll" %where%\install-debug
if %errorlevel% neq 0 exit /b %errorlevel%
copy "%DRMINGW%\bin\symsrv.dll" %where%\install-debug
if %errorlevel% neq 0 exit /b %errorlevel%
copy "%DRMINGW%\bin\symsrv.yes" %where%\install-debug
if %errorlevel% neq 0 exit /b %errorlevel%
pushd %where%\install-debug
7z a %where%\NpackdCL%bits%-debug-%version%.zip * -mx9
if %errorlevel% neq 0 exit /b %errorlevel%
popd
pushd %where%\install
7z a %where%\NpackdCL%bits%-%version%.zip * -mx9
if %errorlevel% neq 0 exit /b %errorlevel%
popd
copy npackdcl\src\NpackdCL%bits%.aip %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
copy npackdcl\src\app.ico %where%\install
if %errorlevel% neq 0 exit /b %errorlevel%
if %static% equ ON (AdvancedInstaller.com /edit %where%\install\NpackdCL%bits%.aip /SetVersion %version%)
if %errorlevel% neq 0 exit /b %errorlevel%
if %static% equ ON (AdvancedInstaller.com /build %where%\install\NpackdCL%bits%.aip)
if %errorlevel% neq 0 exit /b %errorlevel%
set path=%initial_path%
appveyor PushArtifact %where%\NpackdCL%bits%-%version%.zip
if %errorlevel% neq 0 exit /b %errorlevel%
appveyor PushArtifact %where%\NpackdCL%bits%-debug-%version%.zip
if %errorlevel% neq 0 exit /b %errorlevel%
if %static% equ ON (appveyor PushArtifact %where%\install\NpackdCL%bits%-%version%.msi)
if %errorlevel% neq 0 exit /b %errorlevel%
exit /b
rem ---------------------------------------------------------------------------
:buildclu
set path=%mingw%\bin;%ai%\bin\x86;%sevenzip%;C:\msys64\mingw64\bin
set CMAKE_PREFIX_PATH=%mingw%\%mingw_libs%
set where=c:\builds\clu
cmake -GNinja -S clu -B %where% -DCMAKE_INSTALL_PREFIX=..\install -DNPACKD_FORCE_STATIC:BOOL=%STATIC% %extra%
if %errorlevel% neq 0 exit /b %errorlevel%
cmake.exe --build %where%
if %errorlevel% neq 0 exit /b %errorlevel%
strip %where%\clu.exe
if %errorlevel% neq 0 exit /b %errorlevel%
pushd %where%
7z a CLU%bits%-%version%.zip * -mx9
if %errorlevel% neq 0 exit /b %errorlevel%
popd
set path=%initial_path%
appveyor PushArtifact %where%\CLU%bits%-%version%.zip
if %errorlevel% neq 0 exit /b %errorlevel%
exit /b
rem ---------------------------------------------------------------------------
:coverity
rem Coverity build is too slow
set path=%mingw%\bin;%ai%\bin\x86;%sevenzip%;C:\msys64\mingw64\bin
set CMAKE_PREFIX_PATH=%mingw%\%mingw_libs%
mingw32-make.exe clean
"..\..\cov-analysis\bin\cov-configure.exe" --comptype gcc --compiler C:\PROGRA~2\MINGW-~1\bin\G__~1.EXE -- -std=gnu++11
"..\..\cov-analysis\bin\cov-build.exe" --dir ..\..\cov-int mingw32-make.exe install
rem type C:\projects\Npackd\cov-int\build-log.txt
7z a cov-int.zip cov-int
if %errorlevel% neq 0 exit /b %errorlevel%
"C:\Program Files (x86)\Gow\bin\curl" --form token=%covtoken% --form email=tim.lebedkov@gmail.com -k --form file=@cov-int.zip --form version="Version" --form description="Description" https://scan.coverity.com/builds?project=Npackd
if %errorlevel% neq 0 exit /b %errorlevel%
exit /b