diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index b4673116..191eceac 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -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" ] diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index b680b1db..34e56908 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -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. diff --git a/.prettierrc.yaml b/.prettierrc.yaml new file mode 100644 index 00000000..e69de29b diff --git a/.vscode/extensions.json b/.vscode/extensions.json index ca3a2aa9..acaf0213 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -7,6 +7,7 @@ "ms-dotnettools.csharp", "k--kato.docomment", "editorconfig.editorconfig", + "esbenp.prettier-vscode", "pflannery.vscode-versionlens", "davidanson.vscode-markdownlint", "dotjoshjohnson.xml", diff --git a/.vscode/settings.json b/.vscode/settings.json index da9476e8..a209d5ea 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -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 + }, } diff --git a/Directory.Packages.props b/Directory.Packages.props index 2e998334..8ad82f5b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -15,7 +15,7 @@ - + @@ -28,11 +28,11 @@ - + - + - + diff --git a/azure-pipelines/artifacts/_pipelines.ps1 b/azure-pipelines/artifacts/_pipelines.ps1 index 2d3338b2..47321ed5 100644 --- a/azure-pipelines/artifacts/_pipelines.ps1 +++ b/azure-pipelines/artifacts/_pipelines.ps1 @@ -7,7 +7,8 @@ [CmdletBinding()] param ( [string]$ArtifactNameSuffix, - [switch]$StageOnly + [switch]$StageOnly, + [switch]$AvoidSymbolicLinks ) Function Set-PipelineVariable($name, $value) { @@ -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' diff --git a/azure-pipelines/artifacts/_stage_all.ps1 b/azure-pipelines/artifacts/_stage_all.ps1 index b077931c..74d7a38d 100644 --- a/azure-pipelines/artifacts/_stage_all.ps1 +++ b/azure-pipelines/artifacts/_stage_all.ps1 @@ -7,7 +7,8 @@ [CmdletBinding()] param ( - [string]$ArtifactNameSuffix + [string]$ArtifactNameSuffix, + [switch]$AvoidSymbolicLinks ) $ArtifactStagingFolder = & "$PSScriptRoot/../Get-ArtifactsStagingDirectory.ps1" -CleanIfLocal @@ -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 + } } } diff --git a/azure-pipelines/build.yml b/azure-pipelines/build.yml index cda6b91b..8e82a1c6 100644 --- a/azure-pipelines/build.yml +++ b/azure-pipelines/build.yml @@ -4,6 +4,7 @@ parameters: default: vmImage: windows-2022 - name: includeMacOS + type: boolean - name: RunTests type: boolean default: true diff --git a/global.json b/global.json index d24a9b70..2565f236 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.100", + "version": "8.0.201", "rollForward": "patch", "allowPrerelease": false } diff --git a/init.ps1 b/init.ps1 index 00a9589b..e2849855 100755 --- a/init.ps1 +++ b/init.ps1 @@ -84,8 +84,7 @@ try { $HeaderColor = 'Green' $RestoreArguments = @() - if ($Interactive) - { + if ($Interactive) { $RestoreArguments += '--interactive' } @@ -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