Skip to content

Commit 5356a3b

Browse files
authored
feat: bump versions to .net 9 (#132)
* feat: bump versions to .net 9 * build: update build tools * ci: update to .net 9 * fix: update all packages and change Serilog.Sinks.Elasticsearch to Elastic.Serilog.Sinks. Remove Dynatrace. * fix: add .net support * fix: allow custom dataSet and namespace name
1 parent 533a54f commit 5356a3b

24 files changed

+180
-252
lines changed

.github/workflows/compile.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
- uses: actions/checkout@v4
1818
with:
1919
fetch-depth: 0
20-
- name: Setup .NET 8
20+
- name: Setup .NET 9
2121
uses: actions/setup-dotnet@v4
2222
with:
23-
dotnet-version: '8.0.x'
23+
dotnet-version: '9.0.x'
2424
- name: Build with Nuke
2525
run: ./build.sh compile
2626
shell: bash

.github/workflows/publish.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
with:
1616
fetch-depth: 0
1717

18-
- name: Setup .NET 8
18+
- name: Setup .NET 9
1919
uses: actions/setup-dotnet@v4
2020
with:
21-
dotnet-version: 8.0.*
21+
dotnet-version: 9.0.*
2222

2323
- name: Publish to NuGet with Nuke
2424
run: ./build.sh push --nuget-api-key ${{ secrets.NUGET_API_KEY }}

.nuke/build.schema.json

+73-64
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,48 @@
11
{
22
"$schema": "http://json-schema.org/draft-04/schema#",
3-
"$ref": "#/definitions/build",
4-
"title": "Build Schema",
53
"definitions": {
6-
"build": {
7-
"type": "object",
4+
"Host": {
5+
"type": "string",
6+
"enum": [
7+
"AppVeyor",
8+
"AzurePipelines",
9+
"Bamboo",
10+
"Bitbucket",
11+
"Bitrise",
12+
"GitHubActions",
13+
"GitLab",
14+
"Jenkins",
15+
"Rider",
16+
"SpaceAutomation",
17+
"TeamCity",
18+
"Terminal",
19+
"TravisCI",
20+
"VisualStudio",
21+
"VSCode"
22+
]
23+
},
24+
"ExecutableTarget": {
25+
"type": "string",
26+
"enum": [
27+
"Clean",
28+
"Compile",
29+
"Pack",
30+
"Push",
31+
"Restore"
32+
]
33+
},
34+
"Verbosity": {
35+
"type": "string",
36+
"description": "",
37+
"enum": [
38+
"Verbose",
39+
"Normal",
40+
"Minimal",
41+
"Quiet"
42+
]
43+
},
44+
"NukeBuild": {
845
"properties": {
9-
"Configuration": {
10-
"type": "string",
11-
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
12-
"enum": [
13-
"Debug",
14-
"Release"
15-
]
16-
},
1746
"Continue": {
1847
"type": "boolean",
1948
"description": "Indicates to continue a previously failed build attempt"
@@ -23,38 +52,13 @@
2352
"description": "Shows the help text for this build assembly"
2453
},
2554
"Host": {
26-
"type": "string",
2755
"description": "Host for execution. Default is 'automatic'",
28-
"enum": [
29-
"AppVeyor",
30-
"AzurePipelines",
31-
"Bamboo",
32-
"Bitbucket",
33-
"Bitrise",
34-
"GitHubActions",
35-
"GitLab",
36-
"Jenkins",
37-
"Rider",
38-
"SpaceAutomation",
39-
"TeamCity",
40-
"Terminal",
41-
"TravisCI",
42-
"VisualStudio",
43-
"VSCode"
44-
]
56+
"$ref": "#/definitions/Host"
4557
},
4658
"NoLogo": {
4759
"type": "boolean",
4860
"description": "Disables displaying the NUKE logo"
4961
},
50-
"NugetApiKey": {
51-
"type": "string",
52-
"description": "Api key to use when pushing the package"
53-
},
54-
"PackageSource": {
55-
"type": "string",
56-
"description": "NuGet artifact target uri - Defaults to https://api.nuget.org/v3/index.json"
57-
},
5862
"Partition": {
5963
"type": "string",
6064
"description": "Partition to use on CI"
@@ -78,45 +82,50 @@
7882
"type": "array",
7983
"description": "List of targets to be skipped. Empty list skips all dependencies",
8084
"items": {
81-
"type": "string",
82-
"enum": [
83-
"Clean",
84-
"Compile",
85-
"Pack",
86-
"Push",
87-
"Restore"
88-
]
85+
"$ref": "#/definitions/ExecutableTarget"
8986
}
9087
},
91-
"Solution": {
92-
"type": "string",
93-
"description": "Path to a solution file that is automatically loaded"
94-
},
9588
"Target": {
9689
"type": "array",
9790
"description": "List of targets to be invoked. Default is '{default_target}'",
9891
"items": {
99-
"type": "string",
100-
"enum": [
101-
"Clean",
102-
"Compile",
103-
"Pack",
104-
"Push",
105-
"Restore"
106-
]
92+
"$ref": "#/definitions/ExecutableTarget"
10793
}
10894
},
10995
"Verbosity": {
110-
"type": "string",
11196
"description": "Logging verbosity during build execution. Default is 'Normal'",
97+
"$ref": "#/definitions/Verbosity"
98+
}
99+
}
100+
}
101+
},
102+
"allOf": [
103+
{
104+
"properties": {
105+
"Configuration": {
106+
"type": "string",
107+
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
112108
"enum": [
113-
"Minimal",
114-
"Normal",
115-
"Quiet",
116-
"Verbose"
109+
"Debug",
110+
"Release"
117111
]
112+
},
113+
"NugetApiKey": {
114+
"type": "string",
115+
"description": "Api key to use when pushing the package"
116+
},
117+
"PackageSource": {
118+
"type": "string",
119+
"description": "NuGet artifact target uri - Defaults to https://api.nuget.org/v3/index.json"
120+
},
121+
"Solution": {
122+
"type": "string",
123+
"description": "Path to a solution file that is automatically loaded"
118124
}
119125
}
126+
},
127+
{
128+
"$ref": "#/definitions/NukeBuild"
120129
}
121-
}
130+
]
122131
}

.nuke/parameters.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"$schema": "./build.schema.json",
33
"Solution": "Intility.Logging.sln"
4-
}
4+
}

Intility.Logging.sln

-15
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkerSample", "samples\Wor
2424
EndProject
2525
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MinimalApiSample", "samples\MinimalApiSample\MinimalApiSample.csproj", "{B647AC70-7210-462A-A43C-6EB4AFCB7ED4}"
2626
EndProject
27-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Intility.Extensions.Logging.Dynatrace", "src\Intility.Extensions.Logging.Dynatrace\Intility.Extensions.Logging.Dynatrace.csproj", "{B94B9317-E255-4851-9110-0366906EA8A8}"
28-
EndProject
2927
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{FEC7C612-B49E-41BD-B29A-9EFC84E92F42}"
3028
EndProject
3129
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "build\_build.csproj", "{B27B120C-6614-4A6D-816F-F8B22DBFE789}"
@@ -124,18 +122,6 @@ Global
124122
{B647AC70-7210-462A-A43C-6EB4AFCB7ED4}.Release|x64.Build.0 = Release|Any CPU
125123
{B647AC70-7210-462A-A43C-6EB4AFCB7ED4}.Release|x86.ActiveCfg = Release|Any CPU
126124
{B647AC70-7210-462A-A43C-6EB4AFCB7ED4}.Release|x86.Build.0 = Release|Any CPU
127-
{B94B9317-E255-4851-9110-0366906EA8A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
128-
{B94B9317-E255-4851-9110-0366906EA8A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
129-
{B94B9317-E255-4851-9110-0366906EA8A8}.Debug|x64.ActiveCfg = Debug|Any CPU
130-
{B94B9317-E255-4851-9110-0366906EA8A8}.Debug|x64.Build.0 = Debug|Any CPU
131-
{B94B9317-E255-4851-9110-0366906EA8A8}.Debug|x86.ActiveCfg = Debug|Any CPU
132-
{B94B9317-E255-4851-9110-0366906EA8A8}.Debug|x86.Build.0 = Debug|Any CPU
133-
{B94B9317-E255-4851-9110-0366906EA8A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
134-
{B94B9317-E255-4851-9110-0366906EA8A8}.Release|Any CPU.Build.0 = Release|Any CPU
135-
{B94B9317-E255-4851-9110-0366906EA8A8}.Release|x64.ActiveCfg = Release|Any CPU
136-
{B94B9317-E255-4851-9110-0366906EA8A8}.Release|x64.Build.0 = Release|Any CPU
137-
{B94B9317-E255-4851-9110-0366906EA8A8}.Release|x86.ActiveCfg = Release|Any CPU
138-
{B94B9317-E255-4851-9110-0366906EA8A8}.Release|x86.Build.0 = Release|Any CPU
139125
{B27B120C-6614-4A6D-816F-F8B22DBFE789}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
140126
{B27B120C-6614-4A6D-816F-F8B22DBFE789}.Debug|x64.ActiveCfg = Debug|Any CPU
141127
{B27B120C-6614-4A6D-816F-F8B22DBFE789}.Debug|x86.ActiveCfg = Debug|Any CPU
@@ -154,7 +140,6 @@ Global
154140
{2C7C52E9-835F-4051-9A5E-7D985545A795} = {A5767C5D-9A48-4485-8D5E-686F34B2B766}
155141
{25312E6A-4BA3-4FDF-AA7C-CF2A10CDA2AA} = {A5767C5D-9A48-4485-8D5E-686F34B2B766}
156142
{B647AC70-7210-462A-A43C-6EB4AFCB7ED4} = {A5767C5D-9A48-4485-8D5E-686F34B2B766}
157-
{B94B9317-E255-4851-9110-0366906EA8A8} = {4073E5F4-CD63-4DAA-864D-83A76827807E}
158143
{B27B120C-6614-4A6D-816F-F8B22DBFE789} = {FEC7C612-B49E-41BD-B29A-9EFC84E92F42}
159144
EndGlobalSection
160145
GlobalSection(ExtensibilityGlobals) = postSolution

build.ps1

+11-6
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ $TempDirectory = "$PSScriptRoot\\.nuke\temp"
1818

1919
$DotNetGlobalFile = "$PSScriptRoot\\global.json"
2020
$DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1"
21-
$DotNetChannel = "Current"
21+
$DotNetChannel = "STS"
2222

23-
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
2423
$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1
25-
$env:DOTNET_MULTILEVEL_LOOKUP = 0
24+
$env:DOTNET_NOLOGO = 1
2625

2726
###########################################################################
2827
# EXECUTION
@@ -56,14 +55,20 @@ else {
5655
# Install by channel or version
5756
$DotNetDirectory = "$TempDirectory\dotnet-win"
5857
if (!(Test-Path variable:DotNetVersion)) {
59-
ExecSafe { & $DotNetInstallFile -InstallDir $DotNetDirectory -Channel $DotNetChannel -NoPath }
58+
ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Channel $DotNetChannel -NoPath }
6059
} else {
61-
ExecSafe { & $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath }
60+
ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath }
6261
}
6362
$env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe"
63+
$env:PATH = "$DotNetDirectory;$env:PATH"
6464
}
6565

66-
Write-Output "Microsoft (R) .NET Core SDK version $(& $env:DOTNET_EXE --version)"
66+
Write-Output "Microsoft (R) .NET SDK version $(& $env:DOTNET_EXE --version)"
67+
68+
if (Test-Path env:NUKE_ENTERPRISE_TOKEN) {
69+
& $env:DOTNET_EXE nuget remove source "nuke-enterprise" > $null
70+
& $env:DOTNET_EXE nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password $env:NUKE_ENTERPRISE_TOKEN > $null
71+
}
6772

6873
ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet }
6974
ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile --no-build -- $BuildArguments }

build.sh

+9-4
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ TEMP_DIRECTORY="$SCRIPT_DIR//.nuke/temp"
1414

1515
DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json"
1616
DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh"
17-
DOTNET_CHANNEL="Current"
17+
DOTNET_CHANNEL="STS"
1818

1919
export DOTNET_CLI_TELEMETRY_OPTOUT=1
20-
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
21-
export DOTNET_MULTILEVEL_LOOKUP=0
20+
export DOTNET_NOLOGO=1
2221

2322
###########################################################################
2423
# EXECUTION
@@ -54,9 +53,15 @@ else
5453
"$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "$DOTNET_VERSION" --no-path
5554
fi
5655
export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet"
56+
export PATH="$DOTNET_DIRECTORY:$PATH"
5757
fi
5858

59-
echo "Microsoft (R) .NET Core SDK version $("$DOTNET_EXE" --version)"
59+
echo "Microsoft (R) .NET SDK version $("$DOTNET_EXE" --version)"
60+
61+
if [[ ! -z ${NUKE_ENTERPRISE_TOKEN+x} && "$NUKE_ENTERPRISE_TOKEN" != "" ]]; then
62+
"$DOTNET_EXE" nuget remove source "nuke-enterprise" &>/dev/null || true
63+
"$DOTNET_EXE" nuget add source "https://f.feedz.io/nuke/enterprise/nuget" --name "nuke-enterprise" --username "PAT" --password "$NUKE_ENTERPRISE_TOKEN" --store-password-in-clear-text &>/dev/null || true
64+
fi
6065

6166
"$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet
6267
"$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" --no-build -- "$@"

build/Build.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Build : NukeBuild
2424
/// - Microsoft VisualStudio https://nuke.build/visualstudio
2525
/// - Microsoft VSCode https://nuke.build/vscode
2626

27-
public static int Main () => Execute<Build>(x => x.Compile);
27+
public static int Main() => Execute<Build>(x => x.Compile);
2828

2929
[Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")]
3030
readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;
@@ -37,7 +37,7 @@ class Build : NukeBuild
3737

3838
[Solution] readonly Solution Solution;
3939
[GitRepository] readonly GitRepository GitRepository;
40-
[GitVersion(NoFetch = true, Framework = "net6.0")] readonly GitVersion GitVersion;
40+
[GitVersion(NoFetch = true, Framework = "net9.0")] readonly GitVersion GitVersion;
4141

4242
AbsolutePath SourceDirectory => RootDirectory / "src";
4343
AbsolutePath TestsDirectory => RootDirectory / "tests";
@@ -90,7 +90,7 @@ class Build : NukeBuild
9090
.DependsOn(Pack)
9191
.Requires(() => NugetApiKey)
9292
.Requires(() => PackageSource)
93-
.Executes(() =>
93+
.Executes(() =>
9494
{
9595
DotNetNuGetPush(s => s
9696
.SetTargetPath(OutputDirectory / $"*.nupkg")

build/_build.csproj

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFramework>net9.0</TargetFramework>
66
<RootNamespace></RootNamespace>
7-
<NoWarn>CS0649;CS0169</NoWarn>
7+
<NoWarn>CS0649;CS0169;CA1050;CA1822;CA2211;IDE1006</NoWarn>
88
<NukeRootDirectory>..</NukeRootDirectory>
99
<NukeScriptDirectory>..</NukeScriptDirectory>
1010
<NukeTelemetryVersion>1</NukeTelemetryVersion>
11+
<IsPackable>false</IsPackable>
1112
</PropertyGroup>
1213

1314
<ItemGroup>
14-
<PackageReference Include="Nuke.Common" Version="8.0.0" />
15-
<PackageDownload Include="GitVersion.Tool" Version="[5.8.1]" />
15+
<PackageReference Include="Nuke.Common" Version="9.0.1" />
16+
</ItemGroup>
17+
<ItemGroup>
18+
<PackageDownload Include="GitVersion.Tool" Version="[6.0.5]" />
1619
</ItemGroup>
17-
1820
</Project>

build/_build.csproj.DotSettings

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=VariableHidesOuterVariable/@EntryIndexedValue">DO_NOT_SHOW</s:String>
44
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ClassNeverInstantiated_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
55
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MemberCanBeMadeStatic_002ELocal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
6+
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=InterpolatedStringExpressionIsNotIFormattable/@EntryIndexedValue">DO_NOT_SHOW</s:String>
67
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/DEFAULT_INTERNAL_MODIFIER/@EntryValue">Implicit</s:String>
78
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/DEFAULT_PRIVATE_MODIFIER/@EntryValue">Implicit</s:String>
89
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/METHOD_OR_OPERATOR_BODY/@EntryValue">ExpressionBody</s:String>

samples/MinimalApiSample/MinimalApiSample.csproj

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
11-
<ProjectReference Include="..\..\src\Intility.Extensions.Logging.Dynatrace\Intility.Extensions.Logging.Dynatrace.csproj" />
10+
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.0.0" />
1211
<ProjectReference Include="..\..\src\Intility.Extensions.Logging.Elasticsearch\Intility.Extensions.Logging.Elasticsearch.csproj" />
1312
<ProjectReference Include="..\..\src\Intility.Extensions.Logging.Sentry\Intility.Extensions.Logging.Sentry.csproj" />
1413
<ProjectReference Include="..\..\src\Intility.Logging.AspNetCore\Intility.Logging.AspNetCore.csproj" />

0 commit comments

Comments
 (0)