From 3ff6333b6a0ba9e55bf876c8d587a48d73426f44 Mon Sep 17 00:00:00 2001 From: Gitii Date: Sun, 12 Feb 2023 21:54:19 +0100 Subject: [PATCH] Upgrade all dependencies (#2) --- .config/dotnet-tools.json | 12 +-- .github/workflows/ci.yml | 4 +- .github/workflows/release.yml | 2 +- .my-config/bootstrap.ps1 | 77 +++++++++++++++++++ .my-config/update.ps1 | 16 ++++ .onsaveconfig | 4 + ...soft.Extensions.DependencyInjection.csproj | 6 +- .../Community.Sextant.WinUI.Splat.csproj | 8 +- .../Community.Sextant.WinUI.Tests.csproj | 16 ++-- .../Community.Sextant.WinUI.csproj | 4 +- Directory.Build.props | 52 ++++++------- SextantSample.Core/SextantSample.WinUI.csproj | 4 +- .../SextantSample.WinUI.FrameOnly.csproj | 8 +- ...ample.WinUI.FrameWithNavigationView.csproj | 8 +- 14 files changed, 158 insertions(+), 63 deletions(-) create mode 100644 .my-config/bootstrap.ps1 create mode 100644 .my-config/update.ps1 diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index dd29515..c0c170f 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,16 +3,12 @@ "isRoot": true, "tools": { "csharpier": { - "version": "0.14.0", - "commands": [ - "dotnet-csharpier" - ] + "version": "0.16.0", + "commands": ["dotnet-csharpier"] }, "packedprettier": { "version": "2.5.1.10", - "commands": [ - "pprettier" - ] + "commands": ["pprettier"] } } -} \ No newline at end of file +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5597ad..2f938fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,8 +3,6 @@ on: branches: - main pull_request: - branches: - - main jobs: build: @@ -16,8 +14,8 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: | - 5.0.x 6.0.x + 7.0.x - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1.1 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d38e57b..2fcb8b8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,8 +20,8 @@ jobs: uses: actions/setup-dotnet@v1 with: dotnet-version: | - 5.0.x 6.0.x + 7.0.x include-prerelease: true - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1.1 diff --git a/.my-config/bootstrap.ps1 b/.my-config/bootstrap.ps1 new file mode 100644 index 0000000..c2baefc --- /dev/null +++ b/.my-config/bootstrap.ps1 @@ -0,0 +1,77 @@ +function Get-ScriptFolder() { + $fp = $PSScriptRoot + + if ($fp) { + return $fp + } + + return $(split-path -parent $MyInvocation.MyCommand.Definition) +} + +function New-TemporaryDirectory { + $parent = [System.IO.Path]::GetTempPath() + [string] $name = [System.Guid]::NewGuid() + [string] $path = Join-Path $parent $name + New-Item -ItemType Directory -Path $path | Out-Null + + return $path +} + +function Extract-Zip($ArchivePath, $TargetDirectory) { + Add-Type -Assembly "System.IO.Compression.Filesystem" + $ar = [System.IO.Compression.ZipFile]::OpenRead($tempFile.FullName) + + $ar.Entries | ? { $_.Name -ne "" } | % { + $entry = $_ + + $directory = Split-Path $entry.FullName + $fullTargetDirectory = Join-Path $TargetDirectory $directory + + New-Item -ItemType Directory $fullTargetDirectory -Force | Out-Null + + $fullTargetFilePath = Join-Path $fullTargetDirectory $entry.Name + + Write-Debug "Extracting $($entry.Name) to $fullTargetFilePath" + + $stream = New-Object -TypeName System.IO.FileStream -ArgumentList @($fullTargetFilePath, [System.IO.FileMode]::OpenOrCreate) + + $entryStream = $entry.Open() + + $entryStream.CopyTo($stream) + + $stream.Close() + $entryStream.Close() + } + + $ar.Dispose() + +} + +function Extract-Config($TargetDirectory) { + $tempFile = New-TemporaryFile + $tempFolder = New-TemporaryDirectory + + try { + $url = 'https://github.com/Gitii/config/archive/refs/heads/main.zip' + + Write-Host "Downloading..." + Invoke-WebRequest -Uri $url -OutFile $tempFile.FullName + + Write-Host "Extracting to $tempFolder..." + Extract-Zip -ArchivePath $tempFile.FullName -TargetDirectory $tempFolder + + $templateFolder = Join-Path $tempFolder "config-main" "templates" + + Write-Host "Copying templates to $TargetDirectory" + Get-ChildItem -Path $templateFolder -Force | Copy-Item -Recurse -Destination $TargetDirectory -Force + + } finally { + $tempFile.Delete() + + Remove-Item $tempFolder -Recurse -Force + } +} + +$targetDir = Get-Location + +Extract-Config -TargetDirectory $targetDir diff --git a/.my-config/update.ps1 b/.my-config/update.ps1 new file mode 100644 index 0000000..4aad329 --- /dev/null +++ b/.my-config/update.ps1 @@ -0,0 +1,16 @@ +function Get-ScriptFolder() { + $fp = $PSScriptRoot + + if ($fp) { + return $fp + } + + return $(split-path -parent $MyInvocation.MyCommand.Definition) +} + +$currDir = Get-ScriptFolder + +& "$currDir/bootstrap.ps1" + + + diff --git a/.onsaveconfig b/.onsaveconfig index a084029..fba8841 100644 --- a/.onsaveconfig +++ b/.onsaveconfig @@ -1,15 +1,19 @@ [*.cs] command = dotnet arguments = csharpier "{file}" +always_run = true [*.{js,ts,css,less,scss,vue,json,gql,md,yml,yaml,html,htm}] command = dotnet arguments = pprettier --write "{file}" +always_run = true [*.{xml,csproj,xaml,appxmanifest,props,wapproj}] command = dotnet arguments = pprettier --write "{file}" --plugin "/@prettier/plugin-xml" --parser "xml" --print-width 120 --xml-whitespace-sensitivity "ignore" --tab-width 4 +always_run = true [*.sh] command = dotnet arguments = pprettier --write "{file}" --plugin "/prettier-plugin-sh" +always_run = true diff --git a/Community.Sextant.WinUI.Microsoft.Extensions.DependencyInjection/Community.Sextant.WinUI.Microsoft.Extensions.DependencyInjection.csproj b/Community.Sextant.WinUI.Microsoft.Extensions.DependencyInjection/Community.Sextant.WinUI.Microsoft.Extensions.DependencyInjection.csproj index 60667e6..d855777 100644 --- a/Community.Sextant.WinUI.Microsoft.Extensions.DependencyInjection/Community.Sextant.WinUI.Microsoft.Extensions.DependencyInjection.csproj +++ b/Community.Sextant.WinUI.Microsoft.Extensions.DependencyInjection/Community.Sextant.WinUI.Microsoft.Extensions.DependencyInjection.csproj @@ -1,6 +1,6 @@ - net6.0-windows10.0.19041.0;net5.0-windows10.0.19041.0 + net6.0-windows10.0.19041.0;net7.0-windows10.0.19041.0 10.0.19041.0 Community.Sextant.WinUI.Microsoft.Extensions.DependencyInjection win10-x86;win10-x64;win10-arm64 @@ -17,8 +17,8 @@ - - + + diff --git a/Community.Sextant.WinUI.Splat/Community.Sextant.WinUI.Splat.csproj b/Community.Sextant.WinUI.Splat/Community.Sextant.WinUI.Splat.csproj index bdb8e35..c189e9e 100644 --- a/Community.Sextant.WinUI.Splat/Community.Sextant.WinUI.Splat.csproj +++ b/Community.Sextant.WinUI.Splat/Community.Sextant.WinUI.Splat.csproj @@ -1,6 +1,6 @@ - net6.0-windows10.0.19041.0;net5.0-windows10.0.19041.0 + net6.0-windows10.0.19041.0;net7.0-windows10.0.19041.0 10.0.19041.0 Community.Sextant.WinUI.Splat win10-x86;win10-x64;win10-arm64 @@ -17,9 +17,9 @@ - - - + + + diff --git a/Community.Sextant.WinUI.Tests/Community.Sextant.WinUI.Tests.csproj b/Community.Sextant.WinUI.Tests/Community.Sextant.WinUI.Tests.csproj index f1b9d9e..12789d9 100644 --- a/Community.Sextant.WinUI.Tests/Community.Sextant.WinUI.Tests.csproj +++ b/Community.Sextant.WinUI.Tests/Community.Sextant.WinUI.Tests.csproj @@ -1,18 +1,22 @@ net6.0-windows10.0.20348.0 + win10-x86;win10-x64;win10-arm64 enable false - - - - - - + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/Community.Sextant.WinUI/Community.Sextant.WinUI.csproj b/Community.Sextant.WinUI/Community.Sextant.WinUI.csproj index f873891..cd65ec7 100644 --- a/Community.Sextant.WinUI/Community.Sextant.WinUI.csproj +++ b/Community.Sextant.WinUI/Community.Sextant.WinUI.csproj @@ -1,6 +1,6 @@ - net6.0-windows10.0.19041.0;net5.0-windows10.0.19041.0 + net6.0-windows10.0.19041.0;net7.0-windows10.0.19041.0 10.0.19041.0 Community.Sextant.WinUI win10-x86;win10-x64;win10-arm64 @@ -17,7 +17,7 @@ - + diff --git a/Directory.Build.props b/Directory.Build.props index 672568c..c1fc8da 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,28 +1,28 @@ - - latest - enable - True - True - latest - false - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - all - runtime; build; native; contentfiles; analyzers - - - all - runtime; build; native; contentfiles; analyzers - - + + latest + enable + True + True + latest + false + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers + + + all + runtime; build; native; contentfiles; analyzers + + diff --git a/SextantSample.Core/SextantSample.WinUI.csproj b/SextantSample.Core/SextantSample.WinUI.csproj index fdc7c87..be7f4ef 100644 --- a/SextantSample.Core/SextantSample.WinUI.csproj +++ b/SextantSample.Core/SextantSample.WinUI.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/SextantSample.WinUI.FrameOnly/SextantSample.WinUI.FrameOnly.csproj b/SextantSample.WinUI.FrameOnly/SextantSample.WinUI.FrameOnly.csproj index 9c01dd3..c097dfe 100644 --- a/SextantSample.WinUI.FrameOnly/SextantSample.WinUI.FrameOnly.csproj +++ b/SextantSample.WinUI.FrameOnly/SextantSample.WinUI.FrameOnly.csproj @@ -23,10 +23,10 @@ - - - - + + + + diff --git a/SextantSample.WinUI.FrameWithNavigationView/SextantSample.WinUI.FrameWithNavigationView.csproj b/SextantSample.WinUI.FrameWithNavigationView/SextantSample.WinUI.FrameWithNavigationView.csproj index 0cbd840..a9b5e36 100644 --- a/SextantSample.WinUI.FrameWithNavigationView/SextantSample.WinUI.FrameWithNavigationView.csproj +++ b/SextantSample.WinUI.FrameWithNavigationView/SextantSample.WinUI.FrameWithNavigationView.csproj @@ -29,11 +29,11 @@ - - - + + + - +