Skip to content

Commit df4b667

Browse files
authored
Merge pull request #25 from iblazhko/feat/net8
feat: Migrate to .NET 8
2 parents 102a278 + 5ed1f22 commit df4b667

File tree

9 files changed

+37
-112
lines changed

9 files changed

+37
-112
lines changed

.devcontainer/Dockerfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.166.1/containers/dotnet/.devcontainer/base.Dockerfile
2-
3-
# [Choice] .NET version: 5.0, 3.1, 2.1
4-
ARG VARIANT="5.0"
5-
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:${VARIANT}
1+
ARG SDK_VERSION="8.0"
2+
FROM mcr.microsoft.com/dotnet/sdk:${SDK_VERSION}
63

74
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
85
&& apt-get -y install --no-install-recommends pdftk

.devcontainer/devcontainer.json

Lines changed: 8 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,16 @@
1-
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2-
// https://github.com/microsoft/vscode-dev-containers/tree/v0.166.1/containers/dotnet
31
{
42
"name": "C# (.NET)",
53
"build": {
64
"dockerfile": "Dockerfile",
75
"args": {
8-
"VARIANT": "5.0",
6+
"SDK_VERSION": "8.0",
97
}
108
},
11-
12-
// Set *default* container specific settings.json values on container create.
13-
"settings": {
14-
"terminal.integrated.shell.linux": "/bin/bash"
15-
},
16-
17-
// Add the IDs of extensions you want installed when the container is created.
18-
"extensions": [
19-
"ms-dotnettools.csharp"
20-
],
21-
22-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
23-
// "forwardPorts": [5000, 5001],
24-
25-
// [Optional] To reuse of your local HTTPS dev cert:
26-
//
27-
// 1. Export it locally using this command:
28-
// * Windows PowerShell:
29-
// dotnet dev-certs https --trust; dotnet dev-certs https -ep "$env:USERPROFILE/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere"
30-
// * macOS/Linux terminal:
31-
// dotnet dev-certs https --trust; dotnet dev-certs https -ep "${HOME}/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere"
32-
//
33-
// 2. Uncomment these 'remoteEnv' lines:
34-
// "remoteEnv": {
35-
// "ASPNETCORE_Kestrel__Certificates__Default__Password": "SecurePwdGoesHere",
36-
// "ASPNETCORE_Kestrel__Certificates__Default__Path": "/home/vscode/.aspnet/https/aspnetapp.pfx",
37-
// },
38-
//
39-
// 3. Do one of the following depending on your scenario:
40-
// * When using GitHub Codespaces and/or Remote - Containers:
41-
// 1. Start the container
42-
// 2. Drag ~/.aspnet/https/aspnetapp.pfx into the root of the file explorer
43-
// 3. Open a terminal in VS Code and run "mkdir -p /home/vscode/.aspnet/https && mv aspnetapp.pfx /home/vscode/.aspnet/https"
44-
//
45-
// * If only using Remote - Containers with a local container, uncomment this line instead:
46-
// "mounts": [ "source=${env:HOME}${env:USERPROFILE}/.aspnet/https,target=/home/vscode/.aspnet/https,type=bind" ],
47-
48-
// Use 'postCreateCommand' to run commands after the container is created.
49-
// "postCreateCommand": "dotnet restore",
50-
51-
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
52-
"remoteUser": "vscode"
9+
"customizations": {
10+
"vscode": {
11+
"extensions": [
12+
"ms-dotnettools.csdevkit"
13+
]
14+
}
15+
}
5316
}

.devcontainer/library-scripts/azcli-debian.sh

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/continuous-integration-workflow.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ jobs:
1717
run: sudo apt-get install pdftk
1818
- name: Install PDFtk Server CLI
1919
if: ${{ matrix.os == 'windows-latest' }}
20-
run: |
20+
run: |
21+
Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
2122
choco install pdftk-server
22-
refreshenv
2323
echo "C:\Program Files (x86)\PDFtk Server\bin\" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
24-
- uses: actions/checkout@v2
25-
- name: Setup .NET Core 3.1
26-
uses: actions/setup-dotnet@v1
27-
with:
28-
dotnet-version: 3.1.x
24+
- uses: actions/checkout@v4
2925
- name: Setup .NET 6
30-
uses: actions/setup-dotnet@v1
26+
uses: actions/setup-dotnet@v4
3127
with:
3228
dotnet-version: 6.0.x
29+
- name: Setup .NET 8
30+
uses: actions/setup-dotnet@v4
31+
with:
32+
dotnet-version: 8.0.x
3333
- name: Restore dependencies
3434
run: dotnet restore
3535
- name: Build
@@ -44,7 +44,7 @@ jobs:
4444
dotnet nuget push ./artifacts/*.nupkg --source NuGet.org --api-key ${{ secrets.NUGET_API_KEY }}
4545
- name: Upload Release Asset
4646
if: ${{ fromJSON(env.RUN_DEPLOY) }}
47-
uses: softprops/action-gh-release@v1
47+
uses: softprops/action-gh-release@v2
4848
env:
4949
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5050
with:

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "6.0.101",
3+
"version": "8.0.100",
44
"rollForward": "latestFeature"
55
}
66
}

samples/WebApplicationFillForm/WebApplicationFillForm.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net5.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<UserSecretsId>58e1799c-a4c0-41aa-9399-ac70ecee6ba2</UserSecretsId>
66
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
77
<DockerfileContext>..\..</DockerfileContext>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.13" />
12-
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.2" />
11+
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.6" />
12+
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.2" />
1313
</ItemGroup>
1414

1515
<ItemGroup>

src/Kevsoft.PDFtk/Kevsoft.PDFtk.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks>
4+
<TargetFrameworks>netstandard2.0;netstandard2.1;net6.0;net8.0</TargetFrameworks>
55
</PropertyGroup>
66

77
<PropertyGroup>

test/Kevsoft.PDFtk.Tests/FillFormTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public async Task ShouldFillPdfForm_ForInputFileAsBytes()
2727

2828
result.Success.Should().BeTrue();
2929
var dumpDataFields = await _pdFtk.GetDataFieldsAsync(result.Result);
30-
dumpDataFields.Result.Where(x => FieldData.Keys.Contains(x.FieldName))
30+
dumpDataFields.Result.Where(x => FieldData.Keys.Contains(x.FieldName ?? string.Empty))
3131
.ToDictionary(x => x.FieldName!, field => field.FieldValue)
3232
.Should()
3333
.BeEquivalentTo(FieldData);
@@ -42,7 +42,7 @@ public async Task ShouldFillPdfForm_ForInputFileAsStream()
4242

4343
result.Success.Should().BeTrue();
4444
var dumpDataFields = await _pdFtk.GetDataFieldsAsync(result.Result);
45-
dumpDataFields.Result.Where(x => FieldData.Keys.Contains(x.FieldName))
45+
dumpDataFields.Result.Where(x => FieldData.Keys.Contains(x.FieldName ?? string.Empty))
4646
.ToDictionary(x => x.FieldName!, field => field.FieldValue)
4747
.Should()
4848
.BeEquivalentTo(FieldData);
@@ -55,7 +55,7 @@ public async Task ShouldFillPdfForm_ForInputFileAsFilePath()
5555

5656
result.Success.Should().BeTrue();
5757
var dumpDataFields = await _pdFtk.GetDataFieldsAsync(result.Result);
58-
dumpDataFields.Result.Where(x => FieldData.Keys.Contains(x.FieldName))
58+
dumpDataFields.Result.Where(x => FieldData.Keys.Contains(x.FieldName ?? string.Empty))
5959
.ToDictionary(x => x.FieldName!, field => field.FieldValue)
6060
.Should()
6161
.BeEquivalentTo(FieldData);

test/Kevsoft.PDFtk.Tests/Kevsoft.PDFtk.Tests.csproj

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
5-
4+
<TargetFramework>net8.0</TargetFramework>
65
<IsPackable>false</IsPackable>
76
</PropertyGroup>
87

98
<ItemGroup>
10-
<PackageReference Include="FluentAssertions" Version="5.10.3" />
11-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
12-
<PackageReference Include="xunit" Version="2.4.1" />
13-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
9+
<PackageReference Include="FluentAssertions" Version="6.12.0" />
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
11+
<PackageReference Include="xunit" Version="2.7.0" />
12+
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
1413
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1514
<PrivateAssets>all</PrivateAssets>
1615
</PackageReference>
17-
<PackageReference Include="coverlet.collector" Version="1.3.0">
16+
<PackageReference Include="coverlet.collector" Version="6.0.2">
1817
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1918
<PrivateAssets>all</PrivateAssets>
2019
</PackageReference>
2120
</ItemGroup>
2221

22+
<ItemGroup>
23+
<ProjectReference Include="..\..\src\Kevsoft.PDFtk\Kevsoft.PDFtk.csproj" />
24+
</ItemGroup>
25+
2326
<ItemGroup>
2427
<None Update="TestFiles\TestFile1.pdf">
2528
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -41,8 +44,4 @@
4144
</None>
4245
</ItemGroup>
4346

44-
<ItemGroup>
45-
<ProjectReference Include="..\..\src\Kevsoft.PDFtk\Kevsoft.PDFtk.csproj" />
46-
</ItemGroup>
47-
4847
</Project>

0 commit comments

Comments
 (0)