From 3d80847367a183cea3305f45a818b2c8891a8942 Mon Sep 17 00:00:00 2001 From: Atif Aziz Date: Fri, 19 Jul 2019 15:46:45 +0200 Subject: [PATCH] Update to allow use of C# 8 (#604) --- .travis.yml | 7 +++---- MoreLinq.sln | 4 ++-- MoreLinq/MoreLinq.csproj | 2 +- global.json | 2 +- msbuild.cmd | 13 +++++-------- 5 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 094d6c580..07d62e9e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,16 +5,16 @@ os: osx_image: xcode8.3 solution: MoreLinq.sln mono: 5.0.1 -dist: trusty +dist: xenial sudo: required -dotnet: 2.1.500 +dotnet: 2.2.203 env: - CONFIGURATION=Debug - CONFIGURATION=Release addons: apt: sources: - - sourceline: 'deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-trusty-prod trusty main' + - sourceline: 'deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main' key_url: 'https://packages.microsoft.com/keys/microsoft.asc' packages: - dotnet-hostfxr-1.0.1 @@ -22,7 +22,6 @@ addons: before_install: - dotnet --info - - msbuild /version - | if [ "$TRAVIS_OS_NAME" == "osx" ] || [ `uname` == "Darwin" ]; then # Handle too many files on OS X diff --git a/MoreLinq.sln b/MoreLinq.sln index d0e5a44bc..7d4944e58 100644 --- a/MoreLinq.sln +++ b/MoreLinq.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27130.0 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29102.190 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{835F8FFA-471F-4322-B721-A897F27872FA}" ProjectSection(SolutionItems) = preProject diff --git a/MoreLinq/MoreLinq.csproj b/MoreLinq/MoreLinq.csproj index b93e0eff3..c77bea0c7 100644 --- a/MoreLinq/MoreLinq.csproj +++ b/MoreLinq/MoreLinq.csproj @@ -115,7 +115,7 @@ 3.3.0 MoreLINQ Developers. net451;netstandard1.0;netstandard2.0 - 7.3 + 8 true portable true diff --git a/global.json b/global.json index c8f9e01ca..a9571de35 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "2.1.500" + "version": "2.2.200" } } diff --git a/msbuild.cmd b/msbuild.cmd index 3763315de..f24ead479 100644 --- a/msbuild.cmd +++ b/msbuild.cmd @@ -3,8 +3,8 @@ setlocal if "%PROCESSOR_ARCHITECTURE%"=="x86" set PROGRAMS=%ProgramFiles% if defined ProgramFiles(x86) set PROGRAMS=%ProgramFiles(x86)% for %%e in (Community Professional Enterprise) do ( - if exist "%PROGRAMS%\Microsoft Visual Studio\2017\%%e\MSBuild\15.0\Bin\MSBuild.exe" ( - set "MSBUILD=%PROGRAMS%\Microsoft Visual Studio\2017\%%e\MSBuild\15.0\Bin\MSBuild.exe" + if exist "%PROGRAMS%\Microsoft Visual Studio\2019\%%e\MSBuild\Current\Bin\MSBuild.exe" ( + set "MSBUILD=%PROGRAMS%\Microsoft Visual Studio\2019\%%e\MSBuild\Current\Bin\MSBuild.exe" ) ) if exist "%MSBUILD%" goto :build @@ -15,19 +15,16 @@ set MSBUILD_VERSION_MAJOR= set MSBUILD_VERSION_MINOR= for /f "delims=. tokens=1,2,3,4" %%m in ('msbuild /version /nologo') do ( set MSBUILD_VERSION_MAJOR=%%m - set MSBUILD_VERSION_MINOR=%%n ) if not defined MSBUILD_VERSION_MAJOR goto :nomsbuild -if not defined MSBUILD_VERSION_MINOR goto :nomsbuild -if %MSBUILD_VERSION_MAJOR% lss 15 goto :nomsbuild -if %MSBUILD_VERSION_MINOR% lss 1 goto :nomsbuild +if %MSBUILD_VERSION_MAJOR% lss 16 goto :nomsbuild :build "%MSBUILD%" %* goto :EOF :nomsbuild -echo>&2 Microsoft Build Engine 15.1 is required to build the solution. For -echo>&2 installation instructions, see: +echo>&2 Microsoft Build Engine 16.0 or a later version is required to build +echo>&2 the solution. For installation instructions, see: echo>&2 https://docs.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio echo>&2 At the very least, you will want to install the MSBuilt Tool workload echo>&2 that has the identifier "Microsoft.VisualStudio.Workload.MSBuildTools":