/
githubmirror
/
nettle
Обзор
Документация
Войти
/
githubmirror
/
nettle
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
SMP/appveyor.yml
152 строки
6 KB
Matt Oliver
project: Add appveyor VS2022 support.
13 фев 2022, 13:09
13 фев 2022, 13:09
aba0727
Код
Авторство
О чём код?
version: '{build}' branches: only: - master skip_non_tags: true clone_depth: 10 configuration: Release+ReleaseDLLStaticDeps platform: x86+x64 environment: GITHUBTOKEN: secure: c9Sads7Y16h7FP+LrR3IjVygYAgh8GByE8TtazxDg7jpPVxc+XDV81z7MoUc2Ada matrix: - MSVC_VER: 14 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - MSVC_VER: 15 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - MSVC_VER: 16 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - MSVC_VER: 17 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022 install: # Install GitLink - cmd: nuget install gitlink -Version 2.4.0 - cmd: for /f "tokens=*" %%f in ('dir /s /b gitlink.exe') do copy /b %%f .\ before_build: # Backup platform so it is not affected by vcvars - cmd: SET PLATFORMBACK=%PLATFORM% # Setup msvc environment for required compiler version (specified by MSVC_VER) - ps: >- if ($env:MSVC_VER -eq 17) { $env:VCVARS="C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" } elseif ($env:MSVC_VER -eq 16) { $env:VCVARS="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" } elseif ($env:MSVC_VER -eq 15) { $env:VCVARS="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" } else { $env:VSCOMNTOOLS=(Get-Content ("env:VS" + "$env:MSVC_VER" + "0COMNTOOLS")) $env:VCVARS="%VSCOMNTOOLS%\..\..\VC\vcvarsall.bat" } - cmd: call "%VCVARS%" amd64 # Detect latest available windows sdk version - ps: >- if ($env:MSVC_VER -eq 12) { $env:WindowsSDKVersion=8.1 } else { $env:WindowsSDKVersion=$env:WindowsSDKVersion.TrimEnd('\') } # Reset platform - cmd: SET PLATFORM=%PLATFORMBACK% # Create build project to compile all configurations and platforms at once - ps: >- $script = @' <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="GitLink" ToolsVersion="APPVEYOR_MSVC_VER.0"> <ItemGroup> <ConfigurationList Condition="'@(ConfigurationList)' == '' and $(Configuration) != ''" Include="$(Configuration.Split('+'))" /> <ConfigurationList Condition="'@(ConfigurationList)' == ''" Include="Release" /> <PlatformList Condition="'@(PlatformList)' == '' and $(Platform) != ''" Include="$(Platform.Split('+'))" /> <PlatformList Condition="'@(PlatformList)' == ''" Include="x64;x86" /> </ItemGroup> <Target Name="List" Outputs="%(PlatformList.Identity)"> <PropertyGroup> <CurrentPlatform>%(PlatformList.Identity)</CurrentPlatform> </PropertyGroup> <ItemGroup> <ProjectToBuild Include="SMP/APPVEYOR_PROJECT_NAME.sln"> <Properties>Configuration=%(ConfigurationList.Identity);Platform=$(CurrentPlatform);OutDir=$(MSBuildThisFileDirectory)build_out\;WindowsTargetPlatformVersion=SDK_VER</Properties> </ProjectToBuild> </ItemGroup> </Target> <Target Name="Build" DependsOnTargets="List"> <MSBuild Projects="@(ProjectToBuild)" BuildInParallel="false" /> </Target> <Target Name="GitLink" DependsOnTargets="Build" Outputs="%(PlatformList.Identity)"> <PropertyGroup> <CurrentPlatform>%(PlatformList.Identity)</CurrentPlatform> </PropertyGroup> <Exec Command="GitLink . -f SMP/APPVEYOR_PROJECT_NAME.sln -c %(ConfigurationList.Identity) -p $(CurrentPlatform) -d $(MSBuildThisFileDirectory)build_out\lib\$(CurrentPlatform) -u https://github.com/APPVEYOR_REPO_NAME.git -s APPVEYOR_REPO_COMMIT -errorsaswarnings"/> </Target> </Project> '@ $script = $script -replace "APPVEYOR_PROJECT_NAME", "$env:APPVEYOR_PROJECT_NAME" $script = $script -replace "APPVEYOR_REPO_NAME", "$env:APPVEYOR_REPO_NAME" $script = $script -replace "APPVEYOR_REPO_COMMIT", "$env:APPVEYOR_REPO_COMMIT" $script = $script -replace "APPVEYOR_MSVC_VER", "$env:MSVC_VER" $script = $script -replace "SDK_VER", "$env:WindowsSDKVersion" $script | Out-File build.vcxproj # Set Targets path so that gitlink works correctly - ps: $env:MSBUILDDIR=((Get-Command msbuild.exe).Path | Split-Path -parent) - ps: >- if ($env:MSVC_VER -eq 17) { $env:VCTargetsPath="$env:MSBUILDDIR\..\..\..\Microsoft\VC\v170\" } elseif ($env:MSVC_VER -eq 16) { $env:VCTargetsPath="$env:MSBUILDDIR\..\..\Microsoft\VC\v160\" } elseif ($env:MSVC_VER -eq 15) { $env:VCTargetsPath="$env:MSBUILDDIR\..\..\..\Common7\IDE\VC\VCTargets" } else { $env:VCTargetsPath="$env:MSBUILDDIR\..\..\..\Microsoft.Cpp\v4.0\V${env:MSVC_VER}0" } # Download and install yasm integration - ps: (New-Object Net.WebClient).DownloadFile('https://github.com/ShiftMediaProject/VSYASM/releases/download/0.7/VSYASM.zip', "$pwd\yasm.zip") - ps: Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory("$pwd\yasm.zip", "$pwd\TempYASMUnpack") - cmd: call ".\TempYASMUnpack\install_script.bat" # Additional yasm location in order to fix gitlink error - ps: if ($env:MSVC_VER -lt 15) { Copy-Item -Force "TempYASMUnpack\*.*" "$env:VCTargetsPath\..\BuildCustomizations" } # Use project supplied script to download all required dependency libraries - cmd: call "%APPVEYOR_BUILD_FOLDER%\SMP\project_get_dependencies.bat" build: project: build.vcxproj parallel: true verbosity: minimal after_build: # Copy licenses for dependencies - cmd: copy /y %APPVEYOR_BUILD_FOLDER%\..\prebuilt\licenses\*.* %APPVEYOR_BUILD_FOLDER%\build_out\licenses\ artifacts: - path: build_out name: $(APPVEYOR_PROJECT_NAME)_$(APPVEYOR_REPO_TAG_NAME)_msvc$(MSVC_VER) type: zip deploy: - provider: GitHub tag: $(APPVEYOR_REPO_TAG_NAME) description: Pre-built static and shared libraries in 32b and 64b for $(APPVEYOR_PROJECT_NAME) $(APPVEYOR_REPO_TAG_NAME) auth_token: secure: c9Sads7Y16h7FP+LrR3IjVygYAgh8GByE8TtazxDg7jpPVxc+XDV81z7MoUc2Ada artifact: $(APPVEYOR_PROJECT_NAME)_$(APPVEYOR_REPO_TAG_NAME)_msvc$(MSVC_VER) force_update: true