From 91614fd4dc8e20a916b6e4f339fc5ae2d4c61f2a Mon Sep 17 00:00:00 2001 From: Vitaliy Kryvosheiev Date: Wed, 27 Oct 2021 22:35:24 -0400 Subject: [PATCH 1/2] Upgrade to .NET 5 Closes --- .build/definitions.cake | 18 ++++++++---------- .build/tasks.cake | 10 +++++++--- appveyor.yml | 3 --- src/Directory.Build.props | 4 ++-- src/dotnet-readbin/dotnet-readbin.csproj | 8 ++++---- src/tests/ReadBin.Tests/ReadBin.Tests.csproj | 14 +++++++------- 6 files changed, 28 insertions(+), 29 deletions(-) diff --git a/.build/definitions.cake b/.build/definitions.cake index 86028b6..deada4e 100644 --- a/.build/definitions.cake +++ b/.build/definitions.cake @@ -1,23 +1,21 @@ // ADDINS -#addin nuget:?package=Cake.Coveralls&version=0.10.1 -#addin nuget:?package=Cake.FileHelpers&version=3.2.1 -#addin nuget:?package=Cake.Incubator&version=5.1.0 -#addin nuget:?package=Cake.Issues&version=0.8.1 -#addin nuget:?package=Cake.AppVeyor&version=4.0.0 +#addin nuget:?package=Cake.Coveralls&version=1.1.0 +#addin nuget:?package=Cake.FileHelpers&version=4.0.1 +#addin nuget:?package=Cake.AppVeyor&version=5.0.1 // TOOLS -#tool nuget:?package=GitReleaseManager&version=0.10.3 -#tool nuget:?package=GitVersion.CommandLine&version=5.1.3 +#tool nuget:?package=GitReleaseManager&version=0.12.1 +#tool nuget:?package=GitVersion.CommandLine&version=5.7.0 #tool nuget:?package=coveralls.io&version=1.4.2 -#tool nuget:?package=OpenCover&version=4.7.922 -#tool nuget:?package=ReportGenerator&version=4.5.0 +#tool nuget:?package=OpenCover&version=4.7.1221 +#tool nuget:?package=ReportGenerator&version=4.8.13 public class CodeCoverageSettings { public string ExcludeByFile { get; set; } = "*/*Designer.cs"; public string ExcludeByAttribute { get; set; } = "*.ExcludeFromCodeCoverage*"; - public string ExcludeFilter { get; set; } = "-[Tests*]*"; + public string ExcludeFilter { get; set; } = "-[Tests*]*;-[*]Microsoft.CodeAnalysis*;-[*]System.Runtime.CompilerServices.*"; public string IncludeFilter { get; set; } } diff --git a/.build/tasks.cake b/.build/tasks.cake index 8ef604e..43b7b69 100644 --- a/.build/tasks.cake +++ b/.build/tasks.cake @@ -103,14 +103,18 @@ Task("CleanPreviousTestResults") DeleteFile(build.Paths.TestCoverageOutputFile); DeleteFiles(build.Paths.ArtifactsDir + "/*.trx"); if (DirectoryExists(build.Paths.TestCoverageReportDir)) - DeleteDirectory(build.Paths.TestCoverageReportDir, recursive: true); + DeleteDirectory(build.Paths.TestCoverageReportDir, new DeleteDirectorySettings + { + Force = true, + Recursive = true + }); }); Task("GenerateCoverageReport") .WithCriteria((ctx, build) => build.IsLocal) .Does(build => { - ReportGenerator(build.Paths.TestCoverageOutputFile, build.Paths.TestCoverageReportDir); + ReportGenerator((FilePath)build.Paths.TestCoverageOutputFile, build.Paths.TestCoverageReportDir); }); Task("UploadCoverage") @@ -152,7 +156,7 @@ Task("Build") .Does(build => { if (build.IsRelease) { - Information("Running {0} build for code coverage", "Debug"); + Information("Running {0} build to calculate code coverage", "Debug"); // need Debug build for code coverage DotNetCoreBuild(build.Paths.SrcDir, new DotNetCoreBuildSettings { NoRestore = true, diff --git a/appveyor.yml b/appveyor.yml index 8aaefc9..a2a1d5e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,9 +20,6 @@ environment: GITHUB_TOKEN: secure: SakrMxbclSjNzFQxv8sA35OhulfvNm9VqHBEOgQrebPaF/Bv7AmZRsT8/YEfSQED -install: - - ps: ./dotnet-install.ps1 -Version 3.1.102 -InstallDir "C:\Program Files\dotnet" - build_script: - ps: ./build.ps1 diff --git a/src/Directory.Build.props b/src/Directory.Build.props index a11058c..ce098af 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -1,7 +1,7 @@  - netcoreapp3.1 + net5.0 True false true @@ -23,7 +23,7 @@ (c) Alphacloud MIT https://github.com/alphacloud/dotnet-readbin - https://github.com/alphacloud/dotnet-readbin/releases/tag/1.0.0 + https://github.com/alphacloud/dotnet-readbin/releases/tag/5.0.0 dotnet-cli bson messagepack alphacloud git https://github.com/alphacloud/dotnet-readbin diff --git a/src/dotnet-readbin/dotnet-readbin.csproj b/src/dotnet-readbin/dotnet-readbin.csproj index ff5fa90..3e7cec5 100644 --- a/src/dotnet-readbin/dotnet-readbin.csproj +++ b/src/dotnet-readbin/dotnet-readbin.csproj @@ -19,10 +19,10 @@ - - - - + + + + diff --git a/src/tests/ReadBin.Tests/ReadBin.Tests.csproj b/src/tests/ReadBin.Tests/ReadBin.Tests.csproj index 9d00284..9124afd 100644 --- a/src/tests/ReadBin.Tests/ReadBin.Tests.csproj +++ b/src/tests/ReadBin.Tests/ReadBin.Tests.csproj @@ -11,17 +11,17 @@ - - + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + From 552efdd92967e2f42c4c9904bae89217734d29d2 Mon Sep 17 00:00:00 2001 From: Vitaliy Kryvosheiev Date: Thu, 28 Oct 2021 22:06:01 -0400 Subject: [PATCH 2/2] Update nuget token --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index a2a1d5e..29c3705 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -33,7 +33,7 @@ deploy: - provider: NuGet name: Pre release api_key: - secure: 6mTfswrYx6hJYzdwupTCsUUjXg+I50iqf81rGl6Zly7XlJtjT+KshLk7pNmT3TCN + secure: aotSklcEg4wlJFSwi2b374XONmm/GqWbvVtNuwJV8bChfnXDHF3/hhPIiblxiUKV on: branch: - develop @@ -44,6 +44,6 @@ deploy: - provider: NuGet name: Tagged release api_key: - secure: 6mTfswrYx6hJYzdwupTCsUUjXg+I50iqf81rGl6Zly7XlJtjT+KshLk7pNmT3TCN + secure: aotSklcEg4wlJFSwi2b374XONmm/GqWbvVtNuwJV8bChfnXDHF3/hhPIiblxiUKV on: appveyor_repo_tag: true