Skip to content

Commit

Permalink
Merge pull request #1207 from SteeltoeOSS/multi-target-net80
Browse files Browse the repository at this point in the history
Multi-target Steeltoe against .NET 6/8
bart-vmware authored Nov 23, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents f268de5 + a1577d2 commit f6d2dda
Showing 133 changed files with 268 additions and 150 deletions.
4 changes: 2 additions & 2 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -3,13 +3,13 @@
"isRoot": true,
"tools": {
"jetbrains.resharper.globaltools": {
"version": "2023.2.1",
"version": "2023.3.0-eap08",
"commands": [
"jb"
]
},
"regitlint": {
"version": "6.3.10",
"version": "6.3.12",
"commands": [
"regitlint"
]
12 changes: 11 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -36,7 +36,10 @@ jobs:
displayName: Install .NET 6
inputs:
version: 6.0.x
includePreviewVersions: true
- task: UseDotNet@2
displayName: Install .NET 8
inputs:
version: 8.0.x
- task: DotNetCoreCLI@2
displayName: Install Nerdbank.GitVersioning tool
condition: eq(variables['imageName'], 'macOS-latest')
@@ -87,6 +90,13 @@ jobs:
projects: '**/*.csproj'
arguments: '--blame-hang-timeout 3m -f net6.0 --no-build -c $(buildConfiguration) -maxcpucount:1 $(skipFilter) --collect "XPlat Code Coverage" --settings coverlet.runsettings --logger trx --results-directory $(Build.SourcesDirectory)'
publishTestResults: false
- task: DotNetCoreCLI@2
displayName: dotnet test 8.0
inputs:
command: test
projects: '**/*.csproj'
arguments: '--blame-hang-timeout 3m -f net8.0 --no-build -c $(buildConfiguration) -maxcpucount:1 $(skipFilter) --collect "XPlat Code Coverage" --settings coverlet.runsettings --logger trx --results-directory $(Build.SourcesDirectory)'
publishTestResults: false
- task: CopyFiles@2
condition: failed()
inputs:
8 changes: 8 additions & 0 deletions build/package.yml
Original file line number Diff line number Diff line change
@@ -19,6 +19,14 @@ jobs:
steps:
- checkout: self
fetchDepth: 0
- task: UseDotNet@2
displayName: Install .NET 6
inputs:
version: 6.0.x
- task: UseDotNet@2
displayName: Install .NET 8
inputs:
version: 8.0.x
- task: PowerShell@2
displayName: Set package version
env:
10 changes: 9 additions & 1 deletion build/pr-code-cleanup.yml
Original file line number Diff line number Diff line change
@@ -17,6 +17,14 @@ jobs:
if (-not $env:SYSTEM_PULLREQUEST_TARGETBRANCH) {
throw 'This pipeline can only be run from pull requests. Use "/azp run cleanup-code" in a GitHub PR comment.'
}
- task: UseDotNet@2
displayName: Install .NET 6
inputs:
version: 6.0.x
- task: UseDotNet@2
displayName: Install .NET 8
inputs:
version: 8.0.x
- checkout: self
fetchDepth: 0
persistCredentials: true
@@ -62,7 +70,7 @@ jobs:
if ($baseCommitHash -ne $headCommitHash) {
Write-Output "Running code cleanup on commit range $baseCommitHash..$headCommitHash in pull request."
dotnet regitlint -s src/Steeltoe.All.sln --print-command --skip-tool-check --jb-profile="Steeltoe Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN -f commits -a $headCommitHash -b $baseCommitHash
dotnet regitlint -s src/Steeltoe.All.sln --print-command --skip-tool-check --dotnetcoresdk=$(dotnet --version) --jb-profile="Steeltoe Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN -f commits -a $headCommitHash -b $baseCommitHash
}
- task: PowerShell@2
displayName: Detect changes
15 changes: 15 additions & 0 deletions build/sonar-analyze.yml
Original file line number Diff line number Diff line change
@@ -16,6 +16,14 @@ jobs:
steps:
- checkout: self
fetchDepth: 0
- task: UseDotNet@2
displayName: Install .NET 6
inputs:
version: 6.0.x
- task: UseDotNet@2
displayName: Install .NET 8
inputs:
version: 8.0.x
- task: DotNetCoreCLI@2
displayName: dotnet restore
inputs:
@@ -57,6 +65,13 @@ jobs:
projects: '**/*.csproj'
arguments: '--blame-hang-timeout 3m -f net6.0 --no-build -c $(buildConfiguration) -maxcpucount:1 --filter "Category!=SkipOnLinux" --collect "XPlat Code Coverage" --settings coverlet.runsettings --logger trx --results-directory $(Build.SourcesDirectory)'
publishTestResults: false
- task: DotNetCoreCLI@2
displayName: dotnet test 8.0
inputs:
command: test
projects: '**/*.csproj'
arguments: '--blame-hang-timeout 3m -f net8.0 --no-build -c $(buildConfiguration) -maxcpucount:1 --filter "Category!=SkipOnLinux" --collect "XPlat Code Coverage" --settings coverlet.runsettings --logger trx --results-directory $(Build.SourcesDirectory)'
publishTestResults: false
- task: CopyFiles@2
condition: failed()
inputs:
12 changes: 11 additions & 1 deletion build/templates/component-build.yaml
Original file line number Diff line number Diff line change
@@ -21,7 +21,10 @@ jobs:
displayName: Install .NET 6
inputs:
version: 6.0.x
includePreviewVersions: true
- task: UseDotNet@2
displayName: Install .NET 8
inputs:
version: 8.0.x
- task: DotNetCoreCLI@2
displayName: Install Nerdbank.GitVersioning tool
condition: eq('${{parameters.OS}}', 'macOS')
@@ -62,6 +65,13 @@ jobs:
projects: $(SolutionFile)
arguments: -f net6.0 ${{parameters.skipFilter}} $(CommonTestArgs)
publishTestResults: false
- task: DotNetCoreCLI@2
displayName: dotnet test 8.0
inputs:
command: test
projects: $(SolutionFile)
arguments: -f net8.0 ${{parameters.skipFilter}} $(CommonTestArgs)
publishTestResults: false
- task: CopyFiles@2
condition: failed()
inputs:
12 changes: 10 additions & 2 deletions build/verify-code-style.yml
Original file line number Diff line number Diff line change
@@ -13,6 +13,14 @@ jobs:
pool:
vmImage: ubuntu-latest
steps:
- task: UseDotNet@2
displayName: Install .NET 6
inputs:
version: 6.0.x
- task: UseDotNet@2
displayName: Install .NET 8
inputs:
version: 8.0.x
- checkout: self
persistCredentials: true
fetchDepth: 0
@@ -41,7 +49,7 @@ jobs:
script: |
if (-not $env:SYSTEM_PULLREQUEST_TARGETBRANCH) {
Write-Output "Running code cleanup on all files in branch."
dotnet regitlint -s src/Steeltoe.All.sln --print-command --skip-tool-check --jb-profile="Steeltoe Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN --fail-on-diff --print-diff
dotnet regitlint -s src/Steeltoe.All.sln --print-command --skip-tool-check --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="Steeltoe Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN --fail-on-diff --print-diff
}
else {
# We are in detached head (the merge result), so there's no need to account for an out-of-date PR.
@@ -52,5 +60,5 @@ jobs:
if ($LastExitCode -ne 0) { throw "Command 'git rev-parse (2)' failed with exit code $LastExitCode." }

Write-Output "Running code cleanup on commit range $baseCommitHash..$headCommitHash in pull request."
dotnet regitlint -s src/Steeltoe.All.sln --print-command --skip-tool-check --jb-profile="Steeltoe Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN --fail-on-diff --print-diff -f commits -a $headCommitHash -b $baseCommitHash
dotnet regitlint -s src/Steeltoe.All.sln --print-command --skip-tool-check --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="Steeltoe Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN --fail-on-diff --print-diff -f commits -a $headCommitHash -b $baseCommitHash
}
6 changes: 3 additions & 3 deletions cleanupcode.ps1
Original file line number Diff line number Diff line change
@@ -28,17 +28,17 @@ if ($revision) {

if ($baseCommitHash -eq $headCommitHash) {
Write-Output "Running code cleanup on staged/unstaged files."
dotnet regitlint -s src/Steeltoe.All.sln --print-command --skip-tool-check --jb-profile="Steeltoe Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN -f staged,modified
dotnet regitlint -s src/Steeltoe.All.sln --print-command --skip-tool-check --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="Steeltoe Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN -f staged,modified
VerifySuccessExitCode
}
else {
Write-Output "Running code cleanup on commit range $baseCommitHash..$headCommitHash, including staged/unstaged files."
dotnet regitlint -s src/Steeltoe.All.sln --print-command --skip-tool-check --jb-profile="Steeltoe Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN -f staged,modified,commits -a $headCommitHash -b $baseCommitHash
dotnet regitlint -s src/Steeltoe.All.sln --print-command --skip-tool-check --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="Steeltoe Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN -f staged,modified,commits -a $headCommitHash -b $baseCommitHash
VerifySuccessExitCode
}
}
else {
Write-Output "Running code cleanup on all files."
dotnet regitlint -s src/Steeltoe.All.sln --print-command --skip-tool-check --jb-profile="Steeltoe Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN
dotnet regitlint -s src/Steeltoe.All.sln --print-command --skip-tool-check --jb --dotnetcoresdk=$(dotnet --version) --jb-profile="Steeltoe Full Cleanup" --jb --properties:Configuration=Release --jb --verbosity=WARN
VerifySuccessExitCode
}
9 changes: 9 additions & 0 deletions shared.props
Original file line number Diff line number Diff line change
@@ -19,6 +19,15 @@
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)\Steeltoe.Release.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' != 'net6.0'">
<!--
https://github.com/SonarSource/sonar-dotnet/issues/6752#issuecomment-1768257155
As long as we're multi-targeting against .NET 6, its warnings are more useful.
This suppression should be reverted when the .NET 6 target is dropped.
-->
<NoWarn>$(NoWarn);S4056</NoWarn>
</PropertyGroup>

<ItemGroup>
<AdditionalFiles Include="$(MSBuildThisFileDirectory)\stylecop.json" Visible="false" />
</ItemGroup>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<Description>Package for automatically configuring Steeltoe packages that have separately been added to a project.</Description>
<PackageTags>Autoconfiguration;automatic configuration;application bootstrapping</PackageTags>
<IsPackable>true</IsPackable>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\..\..\shared.props" />
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\..\..\shared.props" />
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<RootNamespace>Steeltoe.Common</RootNamespace>
<Description>Abstractions commonly used across Steeltoe components</Description>
<PackageTags></PackageTags>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<Description>Steeltoe common expression language library</Description>
<PackageTags>NET Core;Expression;SPEL</PackageTags>
<IsPackable>true</IsPackable>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<Description>Steeltoe library for common hosting-related utilities</Description>
<PackageTags>NET Core;Cloud Hosting;</PackageTags>
<IsPackable>true</IsPackable>
2 changes: 1 addition & 1 deletion src/Common/src/Common.Http/Steeltoe.Common.Http.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<Description>Steeltoe common library for HTTP</Description>
<PackageTags></PackageTags>
<IsPackable>true</IsPackable>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<Description>Steeltoe common library for Kubernetes</Description>
<PackageTags>Kubernetes</PackageTags>
<IsPackable>true</IsPackable>
2 changes: 1 addition & 1 deletion src/Common/src/Common.Net/Steeltoe.Common.Net.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<Description>Steeltoe common library for network interaction</Description>
<PackageTags></PackageTags>
<IsPackable>true</IsPackable>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<Description>Steeltoe library for handling retries</Description>
<PackageTags>NET Core;Retry;</PackageTags>
<IsPackable>true</IsPackable>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<Description>Steeltoe common library for security</Description>
<PackageTags></PackageTags>
<IsPackable>true</IsPackable>
2 changes: 1 addition & 1 deletion src/Common/src/Common.Utils/Steeltoe.Common.Utils.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<Description>Steeltoe common utility libraries</Description>
<PackageTags></PackageTags>
<IsPackable>true</IsPackable>
2 changes: 1 addition & 1 deletion src/Common/src/Common/Steeltoe.Common.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<Description>Steeltoe common library</Description>
<PackageTags></PackageTags>
<IsPackable>true</IsPackable>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\..\..\shared.props" />
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\..\..\shared.props" />
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\..\..\shared.props" />
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\..\..\shared.props" />
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\..\..\shared.props" />
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\..\..\shared.props" />
2 changes: 1 addition & 1 deletion src/Common/test/Common.Test/Steeltoe.Common.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\..\..\shared.props" />
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
</PropertyGroup>

<Import Project="..\..\..\..\shared.props" />
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<RootNamespace>Steeltoe.Configuration</RootNamespace>
<Description>Abstractions used in Steeltoe Configuration libraries</Description>
<PackageTags></PackageTags>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<Description>Configuration Provider for reading CloudFoundry Service Bindings</Description>
<PackageTags>Configuration;CloudFoundry;Services;Bindings</PackageTags>
<IsPackable>true</IsPackable>
Loading

0 comments on commit f6d2dda

Please sign in to comment.