Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge latest Library.Template #742

Merged
merged 18 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"isRoot": true,
"tools": {
"powershell": {
"version": "7.4.0",
"version": "7.4.1",
"commands": [
"pwsh"
]
},
"dotnet-coverage": {
"version": "17.9.6",
"version": "17.10.4",
"commands": [
"dotnet-coverage"
]
Expand Down
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:8.0.100-jammy
FROM mcr.microsoft.com/dotnet/sdk:8.0.201-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
Empty file added .prettierrc.yaml
Empty file.
1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"ms-dotnettools.csharp",
"k--kato.docomment",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"pflannery.vscode-versionlens",
"davidanson.vscode-markdownlint",
"dotjoshjohnson.xml",
Expand Down
12 changes: 11 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,15 @@
"[xml]": {
"editor.wordWrap": "off"
},
"dotnet.defaultSolution": "Nerdbank.Streams.sln"
// Treat these files as Azure Pipelines files
"files.associations": {
"**/azure-pipelines/**/*.yml": "azure-pipelines",
"azure-pipelines.yml": "azure-pipelines"
},
// Use Prettier as the default formatter for Azure Pipelines files.
// Needs to be explicitly configured: https://github.com/Microsoft/azure-pipelines-vscode#document-formatting
"[azure-pipelines]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": false // enable this when they conform
},
}
8 changes: 4 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PackageVersion Include="Microsoft.AspNetCore" Version="$(AspNetCoreVersion)" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="7.0.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="$(VSThreadingVersion)" />
<PackageVersion Include="Microsoft.VisualStudio.Threading" Version="$(VSThreadingVersion)" />
<PackageVersion Include="Microsoft.VisualStudio.Validation" Version="17.6.11" />
Expand All @@ -28,11 +28,11 @@
<PackageVersion Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageVersion Include="xunit.abstractions" Version="2.0.3" />
<PackageVersion Include="xunit.combinatorial" Version="1.6.24" />
<PackageVersion Include="xunit.extensibility.core" Version="2.6.4" />
<PackageVersion Include="xunit.extensibility.core" Version="2.7.0" />
<PackageVersion Include="xunit.runner.console" Version="2.6.4" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.6" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.7" />
<PackageVersion Include="xunit.skippablefact" Version="1.4.13" />
<PackageVersion Include="xunit" Version="2.6.4" />
<PackageVersion Include="xunit" Version="2.7.0" />
</ItemGroup>
<ItemGroup>
<GlobalPackageReference Include="CSharpIsNullAnalyzer" Version="0.1.495" />
Expand Down
5 changes: 3 additions & 2 deletions azure-pipelines/artifacts/_pipelines.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
[CmdletBinding()]
param (
[string]$ArtifactNameSuffix,
[switch]$StageOnly
[switch]$StageOnly,
[switch]$AvoidSymbolicLinks
)

Function Set-PipelineVariable($name, $value) {
Expand All @@ -24,7 +25,7 @@ Function Test-ArtifactUploaded($artifactName) {
Test-Path "env:$varName"
}

& "$PSScriptRoot/_stage_all.ps1" -ArtifactNameSuffix $ArtifactNameSuffix |% {
& "$PSScriptRoot/_stage_all.ps1" -ArtifactNameSuffix $ArtifactNameSuffix -AvoidSymbolicLinks:$AvoidSymbolicLinks |% {
# Set a variable which will out-live this script so that a subsequent attempt to collect and upload artifacts
# will skip this one from a check in the _all.ps1 script.
Set-PipelineVariable "ARTIFACTSTAGED_$($_.Name.ToUpper())" 'true'
Expand Down
10 changes: 8 additions & 2 deletions azure-pipelines/artifacts/_stage_all.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

[CmdletBinding()]
param (
[string]$ArtifactNameSuffix
[string]$ArtifactNameSuffix,
[switch]$AvoidSymbolicLinks
)

$ArtifactStagingFolder = & "$PSScriptRoot/../Get-ArtifactsStagingDirectory.ps1" -CleanIfLocal
Expand Down Expand Up @@ -48,7 +49,12 @@ $Artifacts |% {

if (-not (Test-Path $DestinationFolder)) { New-Item -ItemType Directory -Path $DestinationFolder | Out-Null }
if (Test-Path -PathType Leaf $_.Source) { # skip folders
Create-SymbolicLink -Link (Join-Path $DestinationFolder $Name) -Target $_.Source
$TargetPath = Join-Path $DestinationFolder $Name
if ($AvoidSymbolicLinks) {
Copy-Item -Path $_.Source -Destination $TargetPath
} else {
Create-SymbolicLink -Link $TargetPath -Target $_.Source
}
}
}

Expand Down
1 change: 1 addition & 0 deletions azure-pipelines/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ parameters:
default:
vmImage: windows-2022
- name: includeMacOS
type: boolean
- name: RunTests
type: boolean
default: true
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": "8.0.100",
"version": "8.0.201",
"rollForward": "patch",
"allowPrerelease": false
}
Expand Down
11 changes: 5 additions & 6 deletions init.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ try {
$HeaderColor = 'Green'

$RestoreArguments = @()
if ($Interactive)
{
if ($Interactive) {
$RestoreArguments += '--interactive'
}

Expand All @@ -98,10 +97,10 @@ try {
}

if (!$NoToolRestore -and $PSCmdlet.ShouldProcess("dotnet tool", "restore")) {
dotnet tool restore @RestoreArguments
if ($lastexitcode -ne 0) {
throw "Failure while restoring dotnet CLI tools."
}
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
Expand Down
Loading