From 9691c1e41ae0de5ac70d911320a9a3c96e6fcbd1 Mon Sep 17 00:00:00 2001 From: Nicolas Hake Date: Thu, 27 Sep 2018 19:58:55 +0200 Subject: [PATCH] Appveyor: Build on Visual Studio 2017 x64 only There is no pre-built binary package of Qt for 32 bit Visual Studio 2017, so we'll drop it for now. --- appveyor.yml | 13 ++++++++++--- tools/ci/appv-AfterBuild.ps1 | 13 +++---------- tools/ci/appv-BeforeBuild.ps1 | 10 +++------- tools/ci/appv-Install.ps1 | 4 ++-- tools/ci/appv-Test.ps1 | 2 +- 5 files changed, 19 insertions(+), 23 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index f5ed9efc4..602d395d5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,9 +5,9 @@ shallow_clone: true cache: ..\openclonk-cache +image: Visual Studio 2017 configuration: RelWithDebInfo platform: - - Win32 - x64 install: @@ -16,10 +16,17 @@ before_build: - ps: "& $env:APPVEYOR_BUILD_FOLDER\\tools\\ci\\appv-BeforeBuild.ps1" build: project: ../openclonk-build/openclonk.sln + parallel: true verbosity: minimal + +# The after_build and test_script scripts need to be called in a real +# powershell instance because they call into the MSBuild API, which has issues +# finding its data files when called from AppVeyor's powershell host, because +# it attempts to read the application config instead of the registry to find +# them (starting with MSBuild 15, which ships with Visual Studio 2017). after_build: - - ps: "& $env:APPVEYOR_BUILD_FOLDER\\tools\\ci\\appv-AfterBuild.ps1" + - cmd: powershell -NoLogo -NoProfile -ExecutionPolicy Unrestricted -Command "& $env:APPVEYOR_BUILD_FOLDER\\tools\\ci\\appv-AfterBuild.ps1" test_script: - - ps: "& $env:APPVEYOR_BUILD_FOLDER\\tools\\ci\\appv-Test.ps1" + - cmd: powershell -NoLogo -NoProfile -ExecutionPolicy Unrestricted -Command "& $env:APPVEYOR_BUILD_FOLDER\\tools\\ci\\appv-Test.ps1" deploy: off diff --git a/tools/ci/appv-AfterBuild.ps1 b/tools/ci/appv-AfterBuild.ps1 index 6667a82e8..df16bfd48 100644 --- a/tools/ci/appv-AfterBuild.ps1 +++ b/tools/ci/appv-AfterBuild.ps1 @@ -1,7 +1,7 @@ pushd $env:BUILD_TARGET_FOLDER trap {popd} -[void]([System.Reflection.Assembly]::LoadWithPartialName('Microsoft.Build')) +Add-Type -Path "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Build.dll" $projects = New-Object Microsoft.Build.Evaluation.ProjectCollection $projects.SetGlobalProperty('Configuration', $env:CONFIGURATION) @@ -92,13 +92,6 @@ SRCSRV: source files --------------------------------------- } } -if (-not $env:APPVEYOR) { - function Push-AppveyorArtifact { - param([string]$Path) - "Uploading $Path.... (dry run)" - } -} - Get-Item *.vcxproj | %{ $p = $projects.LoadProject($_.FullName) if ($p.GetPropertyValue('ConfigurationType') -eq 'Application') { @@ -106,12 +99,12 @@ Get-Item *.vcxproj | %{ $binary = $p.GetPropertyValue('TargetPath') if (Test-Path $binary) { # Upload the executable itself as an artifact - Push-AppveyorArtifact $binary + appveyor PushArtifact $binary $pdb = $p.ItemDefinitions['Link'].GetMetadataValue('ProgramDataBaseFile') if (Test-Path $pdb) { # If we generated a .pdb file, add source server information Add-SourceServerData $pdb - Push-AppveyorArtifact $pdb + appveyor PushArtifact $pdb } } } diff --git a/tools/ci/appv-BeforeBuild.ps1 b/tools/ci/appv-BeforeBuild.ps1 index fcd6c4ae8..043f2c191 100644 --- a/tools/ci/appv-BeforeBuild.ps1 +++ b/tools/ci/appv-BeforeBuild.ps1 @@ -1,13 +1,9 @@ $ErrorActionPreference='Stop' switch ($env:PLATFORM) { - 'Win32' { - $cmake_generator = 'Visual Studio 14 2015' - $qt = 'C:\Qt\5.7\msvc2015' - } 'x64' { - $cmake_generator = 'Visual Studio 14 2015 Win64' - $qt = 'C:\Qt\5.7\msvc2015_64' + $cmake_generator = 'Visual Studio 15 2017 Win64' + $qt = 'C:\Qt\5.11.1\msvc2017_64' } } @@ -15,7 +11,7 @@ pushd $env:BUILD_TARGET_FOLDER try { $(cmake --version)[0] $ErrorActionPreference='SilentlyContinue' - cmake -G $cmake_generator -DCMAKE_PREFIX_PATH:PATH="$env:BUILD_DEPS_FOLDER\$env:PLATFORM;$qt_path" $env:APPVEYOR_BUILD_FOLDER 2>&1 + cmake -G $cmake_generator -DCMAKE_PREFIX_PATH:PATH="$env:BUILD_DEPS_FOLDER\$env:PLATFORM;$qt" $env:APPVEYOR_BUILD_FOLDER 2>&1 $ErrorActionPreference='Stop' if ($LASTEXITCODE -ne 0) { if (Test-Path CMakeFiles\CMakeOutput.log) { diff --git a/tools/ci/appv-Install.ps1 b/tools/ci/appv-Install.ps1 index 70eddd17c..05c9c4e16 100644 --- a/tools/ci/appv-Install.ps1 +++ b/tools/ci/appv-Install.ps1 @@ -92,8 +92,8 @@ pushd $deps_path try { # If you want to use the build dependencies for yourself, please note that # this archive is a tarbomb, i.e. it doesn't contain a single root directory - Update-BuildCache 'https://autobuild.openclonk.org/static/binaries/appveyor-deps.tar.xz' + Update-BuildCache 'https://www.nosebud.de/~nh/openclonk/appveyor-deps.tar.xz' cmake -E tar xJ $cache_path\appveyor-deps.tar.xz } finally { popd -} \ No newline at end of file +} diff --git a/tools/ci/appv-Test.ps1 b/tools/ci/appv-Test.ps1 index ee174b15c..fd1062451 100644 --- a/tools/ci/appv-Test.ps1 +++ b/tools/ci/appv-Test.ps1 @@ -1,7 +1,7 @@ pushd $env:BUILD_TARGET_FOLDER trap {popd} -[void]([System.Reflection.Assembly]::LoadWithPartialName('Microsoft.Build')) +Add-Type -Path "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Build.dll" $projects = New-Object Microsoft.Build.Evaluation.ProjectCollection $projects.SetGlobalProperty('Configuration', $env:CONFIGURATION)