2021-05-06 10:35:57 +00:00
|
|
|
#original author: Kang Lin(kl222@126.com)
|
2018-11-14 08:55:44 +00:00
|
|
|
|
2021-05-06 10:35:57 +00:00
|
|
|
version: "3.0.a.5.{build}"
|
2018-11-14 08:55:44 +00:00
|
|
|
|
|
|
|
configuration:
|
2021-05-06 10:35:57 +00:00
|
|
|
- Release
|
|
|
|
- Debug
|
2018-11-14 08:55:44 +00:00
|
|
|
|
|
|
|
environment:
|
|
|
|
matrix:
|
2021-05-06 10:35:57 +00:00
|
|
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
|
|
|
GENERATORS: "Visual Studio 14 2015"
|
|
|
|
QT_ROOT: C:/Qt/5.6/msvc2015
|
|
|
|
|
|
|
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
|
|
|
GENERATORS: "Visual Studio 14 2015 Win64"
|
|
|
|
QT_ROOT: C:/Qt/5.9/msvc2015_64
|
|
|
|
|
|
|
|
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
|
|
|
GENERATORS: "Visual Studio 15 2017 Win64"
|
|
|
|
QT_ROOT: C:/Qt/5.12/msvc2017_64
|
|
|
|
|
2018-11-14 08:55:44 +00:00
|
|
|
init:
|
|
|
|
|
|
|
|
install:
|
|
|
|
- for /f "delims=" %%i in ('git describe --tags') do (set BUILD_VERSION=%%i)
|
2021-05-06 10:35:57 +00:00
|
|
|
- if "%BUILD_VERSION%" == "" for /f "delims=" %%i in ('git rev-parse HEAD') do (set BUILD_VERSION=%%i)
|
2018-11-14 08:55:44 +00:00
|
|
|
- echo BUILD_VERSION=%BUILD_VERSION%
|
|
|
|
- if NOT "%QT_ROOT%" == "NO" for /f "delims=" %%i in ('%QT_ROOT%/bin/qmake -query QT_VERSION') do (set QT_VERSION=%%i)
|
|
|
|
- echo "QT_VERSION:%QT_VERSION"
|
|
|
|
- if NOT "%QT_ROOT%" == "NO" for /f "delims=" %%i in ('%QT_ROOT%/bin/qmake -query QMAKE_XSPEC') do (set QMAKE_XSPEC=%%i)
|
|
|
|
- echo "QMAKE_XSPEC=%QMAKE_XSPEC%"
|
|
|
|
- set TOOLCHAIN_VERSION=""
|
|
|
|
- ps: >-
|
2021-05-06 10:35:57 +00:00
|
|
|
if (($env:QMAKE_XSPEC).Contains("msvc"))
|
|
|
|
{
|
|
|
|
$env:MAKE="nmake"
|
|
|
|
if (($env:QT_ROOT).Contains("_64"))
|
|
|
|
{
|
|
|
|
$env:varch="amd64"
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$env:varch="x86"
|
|
|
|
}
|
|
|
|
if (($env:QT_ROOT).Contains("2017"))
|
|
|
|
{
|
|
|
|
$env:TOOLCHAIN_VERSION="15"
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (($env:QT_ROOT).Contains("2015"))
|
|
|
|
{
|
|
|
|
$env:TOOLCHAIN_VERSION="14"
|
|
|
|
}elseif (($env:QT_ROOT).Contains("2013"))
|
|
|
|
{
|
|
|
|
$env:TOOLCHAIN_VERSION="12"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$env:MAKE="mingw32-make"
|
|
|
|
$env:PATH="C:\Qt\Tools\mingw530_32;$env:PATH"
|
|
|
|
}
|
2018-11-14 08:55:44 +00:00
|
|
|
|
|
|
|
- if NOT "%TOOLCHAIN_VERSION%"=="" if %TOOLCHAIN_VERSION% LSS 15 (call "C:/Program Files (x86)/Microsoft Visual Studio %TOOLCHAIN_VERSION%.0/VC/vcvarsall.bat" %varch%) else (call "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Auxiliary/Build/vcvarsall.bat" %varch%)
|
|
|
|
- echo "cl "
|
|
|
|
- cl
|
|
|
|
|
|
|
|
build_script:
|
2021-05-06 10:35:57 +00:00
|
|
|
# Test qmake
|
|
|
|
- mkdir "%APPVEYOR_BUILD_FOLDER%/build_qmake"
|
|
|
|
- cd "%APPVEYOR_BUILD_FOLDER%/build_qmake"
|
|
|
|
- call "%QT_ROOT%/bin/qmake.exe" CONFIG+=%Configuration% PREFIX="%APPVEYOR_BUILD_FOLDER%/install_qmake" "%APPVEYOR_BUILD_FOLDER%/src"
|
2018-11-14 08:55:44 +00:00
|
|
|
- call %MAKE%
|
2021-05-06 10:35:57 +00:00
|
|
|
- call %MAKE% install
|
|
|
|
|
|
|
|
# Test cmake (deactivated for now)
|
|
|
|
# - mkdir "%APPVEYOR_BUILD_FOLDER%/build_cmake"
|
|
|
|
# - cd "%APPVEYOR_BUILD_FOLDER%/build_cmake"
|
|
|
|
# - cmake.exe -G"%GENERATORS%" -DCMAKE_INSTALL_PREFIX="%APPVEYOR_BUILD_FOLDER%/install_cmake" -DQt5_DIR="%QT_ROOT%/lib/cmake/Qt5" "%APPVEYOR_BUILD_FOLDER%/src"
|
|
|
|
# - cmake --build . --config %Configuration%
|
|
|
|
# - cmake --build . --config %Configuration% --target install
|
2018-11-14 08:55:44 +00:00
|
|
|
|
|
|
|
test_script:
|
2021-05-06 10:35:57 +00:00
|
|
|
|
2018-11-14 08:55:44 +00:00
|
|
|
artifacts:
|
2021-05-06 10:35:57 +00:00
|
|
|
- path: install_qmake
|
|
|
|
name: QZXing_$(QMAKE_XSPEC)$(TOOLCHAIN_VERSION)_$(CONFIGURATION)_Qt$(QT_VERSION)_$(BUILD_VERSION)
|
2018-11-14 08:55:44 +00:00
|
|
|
type: zip
|
|
|
|
|
|
|
|
# whitelist branches to avoid testing feature branches twice (as branch and as pull request)
|
|
|
|
branches:
|
|
|
|
only:
|
|
|
|
- master
|
|
|
|
|
2021-08-08 10:35:12 +00:00
|
|
|
# deploy:
|
|
|
|
# provider: GitHub
|
|
|
|
# #token: https://github.com/settings/tokens encode token: https://ci.appveyor.com/tools/encrypt
|
|
|
|
# auth_token:
|
|
|
|
# secure: #TODO: set your token
|
|
|
|
# on:
|
|
|
|
# appveyor_repo_tag: true # deploy on tag push only
|