From aadf2049c28ce0d0717f0f06a7a6eb2de2689595 Mon Sep 17 00:00:00 2001 From: n3wjack Date: Mon, 20 May 2024 20:53:49 +0200 Subject: [PATCH] Upgrade .NET and packages. Upgrade to .NET 8 and upgraded the MailKit package. Extended the build script to do both builds, create the zip packages, and fix an issue with trimming and the DragonFruit package. --- ImapCleanup.Tests/ImapCleanup.Tests.csproj | 12 +++---- ImapCleanup/ImapCleanup.csproj | 7 ++-- Readme.md | 2 +- build.ps1 | 42 ++++++++++++++++++++-- 4 files changed, 50 insertions(+), 13 deletions(-) diff --git a/ImapCleanup.Tests/ImapCleanup.Tests.csproj b/ImapCleanup.Tests/ImapCleanup.Tests.csproj index 56ab95c..83ccdc0 100644 --- a/ImapCleanup.Tests/ImapCleanup.Tests.csproj +++ b/ImapCleanup.Tests/ImapCleanup.Tests.csproj @@ -1,7 +1,7 @@ - + - net6.0 + net8.0 enable enable @@ -9,13 +9,13 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/ImapCleanup/ImapCleanup.csproj b/ImapCleanup/ImapCleanup.csproj index 9613c9d..1691a6d 100644 --- a/ImapCleanup/ImapCleanup.csproj +++ b/ImapCleanup/ImapCleanup.csproj @@ -2,13 +2,14 @@ Exe - net6.0 + net8.0 - 2.0.0.0 + 2.0.1.0 + False - + diff --git a/Readme.md b/Readme.md index c6a3437..e4094d6 100644 --- a/Readme.md +++ b/Readme.md @@ -37,7 +37,7 @@ For help with one of the subcommands, use `.\ImapCleanup.exe count` or `.\ImapCl See [releases](https://github.com/n3wjack/ImapCleanup/releases) -- ImapCleanup-2.0.zip: framework dependent version. You need to have the .NET Core 6.0 framework installed to run this. This runs on any platform. +- ImapCleanup-2.0.zip: framework dependent version. You need to have the .NET Core 8.0 framework installed to run this. This runs on any platform. - ImapCleanup-2.0-Windowsx64-self-contained.zip: a self-contained release for Windows x64 only. This runs without any dependencies. ## Building diff --git a/build.ps1 b/build.ps1 index f53200c..36e9dc6 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,8 +1,44 @@ +$version = "2.0.1" + Write-Host "`n*** Building self-contained winx64 exectable. ***`n" -ForegroundColor Cyan +pushd + cd ImapCleanup -dotnet publish -p:PublishSingleFile=true -r win-x64 -c Release --self-contained true -p:PublishTrimmed=true -cd bin\Release\net6.0\win-x64\publish +Write-Host "Run regular build...." -ForegroundColor Cyan +dotnet publish + +Write-Host "Run self-contained build..." -ForegroundColor Cyan +dotnet publish -p:PublishSingleFile=true -r win-x64 -c Release --self-contained true -p:PublishTrimmed=true -p:TrimMode=partial + + +Write-Host "Create archive regular build..." -ForegroundColor Cyan +pushd +cd bin\Release\net8.0\publish\ +7z a "ImapCleanup-$version.zip" *.* + +Write-Host "Smoke test" -ForegroundColor Cyan + +# Run the exe, see if it shows the help info. +.\ImapCleanup.exe /? +.\ImapCleanup.exe --version + +popd + +Write-Host "Create archive for self contained build..." -ForegroundColor Cyan +pushd +cd bin\Release\net8.0\win-x64\publish +7z a "ImapCleanup-$version-Windowsx64-self-contained.zip" ImapCleanup.exe + +Write-Host "Smoke test" -ForegroundColor Cyan + +# Run the exe, see if it shows the help info. +.\ImapCleanup.exe /? +.\ImapCleanup.exe --version + +popd -ls *.exe +popd +Write-Host "Moving archives to current directory..." -ForegroundColor Cyan +ls *.zip -r | % { move $_ . }