1 version: '{branch}-{build}'
3 # Do not build on tags (GitHub only)
6 image: Visual Studio 2017
13 REPO_DIR: &REPO_DIR c:\qbittorrent
14 CACHE_DIR: &CACHE_DIR c:\qbt_cache
16 QBT_VER_URL: https://builds.shiki.hu/appveyor/version
17 QBT_LIB_URL: https://builds.shiki.hu/appveyor/qbt_libraries.7z
20 clone_folder: *REPO_DIR
22 # cache size should < 100MB (after compressing with fastest option):
23 # see: https://www.appveyor.com/docs/build-cache#save-update-cache-before-build-finishes
30 # check if library needs update
31 - appveyor DownloadFile "%QBT_VER_URL%" -FileName "c:\version_new" && SET /P newVersion=<"c:\version_new"
32 - IF EXIST "%CACHE_DIR%\version" (SET /P oldVersion=<"%CACHE_DIR%\version")
33 - IF NOT EXIST "%CACHE_DIR%\version" (SET updateCache=1)
34 - IF NOT "%oldVersion%" == "%newVersion%" (SET updateCache=1)
36 - IF "%updateCache%" == "1" (ECHO "--- Will redownload libraries ---" &&
37 RMDIR /S /Q "%CACHE_DIR%" & MKDIR "%CACHE_DIR%" &&
38 appveyor DownloadFile "%QBT_LIB_URL%" -FileName "c:\qbt_lib.7z" && 7z x "c:\qbt_lib.7z" -o"%CACHE_DIR%" > nul &&
39 COPY "c:\version_new" "%CACHE_DIR%\version")
40 # Qt stay compressed in cache
41 - 7z x "%CACHE_DIR%\qt5_32.7z" -o"c:\qbt" > nul
45 - CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"
46 - SET PATH=%PATH%;c:\qbt\qt5_32\bin;%CACHE_DIR%\jom;
48 - COPY /Y "%CACHE_DIR%\conf.pri" "%REPO_DIR%"
50 - MKLINK /J "c:\qbt\base" "%CACHE_DIR%\base"
54 # scan only as lupdate is prone to hang
55 - lupdate -extensions c,cpp,h,hpp,ui .
56 - qmake qbittorrent.pro && cd src && qmake src.pro
57 - jom -j2 -f Makefile.Release