Merge latest Library.Template by AArnott · Pull Request #1640 · MessagePack-CSharp/MessagePack-CSharp · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
fb2395d
Add dotnet CLI tools
AArnott Feb 27, 2023
ea48c8e
Updated SDK installer script to be able to find 7.0.200
AArnott Mar 13, 2023
2987b44
Bump SDK version to 7.0.201
AArnott Mar 13, 2023
08114e6
Merge pull request #196 from AArnott/installerUpdate
AArnott Mar 13, 2023
99df818
Move `dotnet-coverage` to repo-level tool
AArnott Mar 28, 2023
1469941
Move `nbgv` into dotnet-tools.json
AArnott Mar 28, 2023
3f1e858
Install tools except when `-NoToolRestore` is specified
AArnott Mar 28, 2023
99e9481
Merge pull request #197 from AArnott/dotnetCliTools
AArnott Mar 28, 2023
2381c72
Fix ARM64 detection on Windows Powershell
AArnott Apr 15, 2023
b3e9f4e
Bump up SDK and tools versions
AArnott Apr 16, 2023
0c36c87
Copy the .config file when applying the template
AArnott Apr 17, 2023
591d64e
Upgrade `actions/checkout` GitHub action to v3
AArnott Apr 25, 2023
e458487
Elevate CA1062 for shipping code
AArnott Apr 29, 2023
c3c23f7
Bump Nerdbank.GitVersioning to 3.6.128
AArnott May 1, 2023
e90465a
Update Dockerfile
AArnott May 2, 2023
46b4f56
Fix placement of $RestoreArguments construction
AArnott May 2, 2023
4d4c330
Switch from `MSBuildTreatWarningsAsErrors` to `-warnaserror`
AArnott May 11, 2023
aefd199
Bump .NET SDK to 7.0.302
AArnott May 17, 2023
354b522
Bump NB.GV to 3.6.132
AArnott May 20, 2023
4f2a6d8
Bump CSharpIsNullAnalyzer from 0.1.329 to 0.1.495 (#204)
dependabot[bot] May 20, 2023
119ce07
Bump Microsoft.NET.Test.Sdk from 17.5.0 to 17.6.0 (#202)
dependabot[bot] May 20, 2023
0991fe9
Bump dotnet-coverage from 17.7.0 to 17.7.1 (#205)
dependabot[bot] May 20, 2023
e50278a
Bump Nerdbank.GitVersioning to 3.6.133
AArnott May 27, 2023
1579bba
Bump Microsoft.NET.Test.Sdk to 17.6.1
AArnott Jun 5, 2023
e22efe9
Bump Microsoft.NET.Test.Sdk to 17.6.2
AArnott Jun 7, 2023
0d4ffb5
Merge remote-tracking branch 'libtemplate/main' into libtemplate
AArnott Jun 11, 2023
6bda499
Suppress warnings about input validation
AArnott Jun 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .config/dotnet-tools.json
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Refer to https://hub.docker.com/_/microsoft-dotnet-sdk for available versions
FROM mcr.microsoft.com/dotnet/sdk:7.0.101-jammy
FROM mcr.microsoft.com/dotnet/sdk:7.0.302-jammy

# Installing mono makes `dotnet test` work without errors even for net472.
# But installing it takes a long time, so it's excluded by default.
Expand Down
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ dotnet_diagnostic.DOC108.severity = warning
dotnet_diagnostic.DOC200.severity = warning
dotnet_diagnostic.DOC202.severity = warning

# CA1062: Validate arguments of public methods
dotnet_diagnostic.CA1062.severity = suggestion

# CS1591: Missing XML comment for publicly visible type or member
dotnet_diagnostic.CS1591.severity = suggestion

Expand Down
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: nuget
directory: /
schedule:
interval: monthly
interval: weekly
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"omnisharp.enableEditorConfigSupport": true,
"omnisharp.enableImportCompletion": true,
"omnisharp.enableRoslynAnalyzers": true
"omnisharp.enableRoslynAnalyzers": true,
"dotnet.completion.showCompletionItemsFromUnimportedNamespaces": true,
"dotnet.defaultSolution": "MessagePack.sln"
}
6 changes: 3 additions & 3 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<PackageVersion Include="Microsoft.CodeAnalysis.VisualBasic.Workspaces" version="$(MicrosoftCodeAnalysisVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="$(MicrosoftCodeAnalysisVersion)" />
<PackageVersion Include="Microsoft.NET.StringTools" Version="17.4.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
<PackageVersion Include="Microsoft.NETCore.Portable.Compatibility" Version="1.0.1" />
<PackageVersion Include="Moq" Version="4.18.4" />
<PackageVersion Include="MsgPack.Cli" Version="1.0.1" />
Expand Down Expand Up @@ -80,9 +80,9 @@
<PackageVersion Update="System.Text.Json" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<GlobalPackageReference Include="CSharpIsNullAnalyzer" Version="0.1.329" />
<GlobalPackageReference Include="CSharpIsNullAnalyzer" Version="0.1.495" />
<GlobalPackageReference Include="DotNetAnalyzers.DocumentationAnalyzers" Version="1.0.0-beta.59" />
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.6.128" />
<GlobalPackageReference Include="Nerdbank.GitVersioning" Version="3.6.133" />
<GlobalPackageReference Include="Nullable" Version="1.3.1" />
<GlobalPackageReference Include="StyleCop.Analyzers.Unstable" Version="1.2.0.435" />
</ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ parameters:
default: true

variables:
MSBuildTreatWarningsAsErrors: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
BuildConfiguration: Release
ci_feed: https://pkgs.dev.azure.com/ils0086/MessagePack-CSharp/_packaging/MessagePack-CI/nuget/v3/index.json
Expand Down
24 changes: 0 additions & 24 deletions azure-pipelines/Get-nbgv.ps1

This file was deleted.

46 changes: 23 additions & 23 deletions azure-pipelines/Merge-CodeCoverage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,32 @@ Param(
)

$RepoRoot = [string](Resolve-Path $PSScriptRoot/..)

if (!(Test-Path $RepoRoot/obj/dotnet-coverage*)) {
dotnet tool install --tool-path $RepoRoot/obj dotnet-coverage --version 17.4.3 --configfile $PSScriptRoot/justnugetorg.nuget.config
}

Write-Verbose "Searching $Path for *.cobertura.xml files"
$reports = Get-ChildItem -Recurse $Path -Filter *.cobertura.xml

if ($reports) {
$reports |% { $_.FullName } |% {
# In addition to replacing {reporoot}, we also normalize on one kind of slash so that the report aggregates data for a file whether data was collected on Windows or not.
$xml = [xml](Get-Content -Path $_)
$xml.coverage.packages.package.classes.class |? { $_.filename} |% {
$_.filename = $_.filename.Replace('{reporoot}', $RepoRoot).Replace([IO.Path]::AltDirectorySeparatorChar, [IO.Path]::DirectorySeparatorChar)
Push-Location $RepoRoot
try {
Write-Verbose "Searching $Path for *.cobertura.xml files"
$reports = Get-ChildItem -Recurse $Path -Filter *.cobertura.xml

if ($reports) {
$reports |% { $_.FullName } |% {
# In addition to replacing {reporoot}, we also normalize on one kind of slash so that the report aggregates data for a file whether data was collected on Windows or not.
$xml = [xml](Get-Content -Path $_)
$xml.coverage.packages.package.classes.class |? { $_.filename} |% {
$_.filename = $_.filename.Replace('{reporoot}', $RepoRoot).Replace([IO.Path]::AltDirectorySeparatorChar, [IO.Path]::DirectorySeparatorChar)
}

$xml.Save($_)
}

$xml.Save($_)
}
$Inputs = $reports |% { Resolve-Path -relative $_.FullName }

$Inputs = $reports |% { Resolve-Path -relative $_.FullName }
if ((Split-Path $OutputFile) -and -not (Test-Path (Split-Path $OutputFile))) {
New-Item -Type Directory -Path (Split-Path $OutputFile) | Out-Null
}

if ((Split-Path $OutputFile) -and -not (Test-Path (Split-Path $OutputFile))) {
New-Item -Type Directory -Path (Split-Path $OutputFile) | Out-Null
& dotnet tool run dotnet-coverage merge $Inputs -o $OutputFile -f cobertura
} else {
Write-Error "No reports found to merge."
}

& "$RepoRoot/obj/dotnet-coverage" merge $Inputs -o $OutputFile -f cobertura
} else {
Write-Error "No reports found to merge."
} finally {
Pop-Location
}
2 changes: 1 addition & 1 deletion azure-pipelines/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
clean: true
- template: install-dependencies.yml

- powershell: '& (./azure-pipelines/Get-nbgv.ps1) cloud -c'
- script: dotnet tool run nbgv cloud -c
displayName: ⚙ Set build number

- template: dotnet.yml
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ parameters:

steps:

- script: dotnet build -t:build,pack --no-restore -c $(BuildConfiguration) /bl:"$(Build.ArtifactStagingDirectory)/build_logs/build.binlog"
- script: dotnet build -t:build,pack --no-restore -c $(BuildConfiguration) -warnaserror /bl:"$(Build.ArtifactStagingDirectory)/build_logs/build.binlog"
displayName: 🛠 dotnet build

- powershell: azure-pipelines/dotnet-test-cloud.ps1 -Configuration $(BuildConfiguration) -Agent $(Agent.JobName) -PublishResults
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.101",
"version": "7.0.302",
"rollForward": "patch",
"allowPrerelease": false
}
Expand Down
23 changes: 17 additions & 6 deletions init.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
No effect if -NoPrerequisites is specified.
.PARAMETER NoRestore
Skips the package restore step.
.PARAMETER NoToolRestore
Skips the dotnet tool restore step.
.PARAMETER AccessToken
An optional access token for authenticating to Azure Artifacts authenticated feeds.
.PARAMETER Interactive
Expand All @@ -46,6 +48,8 @@ Param (
[Parameter()]
[switch]$NoRestore,
[Parameter()]
[switch]$NoToolRestore,
[Parameter()]
[string]$AccessToken,
[Parameter()]
[switch]$Interactive
Expand Down Expand Up @@ -79,20 +83,27 @@ Push-Location $PSScriptRoot
try {
$HeaderColor = 'Green'

if (!$NoRestore -and $PSCmdlet.ShouldProcess("NuGet packages", "Restore")) {
$RestoreArguments = @()
if ($Interactive)
{
$RestoreArguments += '--interactive'
}
$RestoreArguments = @()
if ($Interactive)
{
$RestoreArguments += '--interactive'
}

if (!$NoRestore -and $PSCmdlet.ShouldProcess("NuGet packages", "Restore")) {
Write-Host "Restoring NuGet packages" -ForegroundColor $HeaderColor
dotnet restore @RestoreArguments
if ($lastexitcode -ne 0) {
throw "Failure while restoring packages."
}
}

if (!$NoToolRestore -and $PSCmdlet.ShouldProcess("dotnet tool", "restore")) {
dotnet tool restore @RestoreArguments
if ($lastexitcode -ne 0) {
throw "Failure while restoring dotnet CLI tools."
}
}

& "$PSScriptRoot/tools/Set-EnvVars.ps1" -Variables $EnvVars -PrependPath $PrependPath | Out-Null
}
catch {
Expand Down
4 changes: 4 additions & 0 deletions sandbox/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[*.cs]

# CA1062: Validate arguments of public methods
dotnet_diagnostic.CA1062.severity = silent
4 changes: 4 additions & 0 deletions src/MessagePack.Analyzers/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[*.cs]

# CA1062: Validate arguments of public methods
dotnet_diagnostic.CA1062.severity = silent
3 changes: 3 additions & 0 deletions src/MessagePack.SourceGenerator/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@

# VSTHRD111: Use ConfigureAwait(bool)
dotnet_diagnostic.VSTHRD111.severity = none

# CA1062: Validate arguments of public methods
dotnet_diagnostic.CA1062.severity = silent
11 changes: 10 additions & 1 deletion tools/Install-DotNetSdk.ps1