Skip to content

Commit

Permalink
Upgrade .NET and packages.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
n3wjack committed May 20, 2024
1 parent 71bbd9d commit aadf204
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 13 deletions.
12 changes: 6 additions & 6 deletions ImapCleanup.Tests/ImapCleanup.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.8.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="3.1.2">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
7 changes: 4 additions & 3 deletions ImapCleanup/ImapCleanup.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<FileVersion></FileVersion>
<Version>2.0.0.0</Version>
<Version>2.0.1.0</Version>
<PublishTrimmed>False</PublishTrimmed>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MailKit" Version="2.7.0" />
<PackageReference Include="MailKit" Version="4.6.0" />
<PackageReference Include="System.CommandLine.DragonFruit" Version="0.4.0-alpha.22272.1" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
42 changes: 39 additions & 3 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -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 $_ . }

0 comments on commit aadf204

Please sign in to comment.