Skip to content

Commit e6a824f

Browse files
authored
TNT-46398 Support .NET 6 and .NET 7 (#36)
* TNT-46398 Support .NET 6 and .NET 7
1 parent bb12bac commit e6a824f

File tree

10 files changed

+29
-14
lines changed

10 files changed

+29
-14
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,17 @@ jobs:
2727
os: [ubuntu-latest, windows-latest, macOS-latest]
2828
steps:
2929
- name: 'Checkout'
30-
uses: actions/checkout@v2
30+
uses: actions/checkout@v3
3131
with:
3232
lfs: true
3333
fetch-depth: 0
3434
- name: 'Git Fetch Tags'
3535
run: git fetch --tags
3636
shell: pwsh
3737
- name: 'Install .NET Core SDK'
38-
uses: actions/setup-dotnet@v1
38+
uses: actions/setup-dotnet@v3
39+
with:
40+
dotnet-version: 7.0
3941
- name: 'Dotnet Tool Restore'
4042
run: dotnet tool restore
4143
shell: pwsh

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ The Adobe Target .Net SDK uses the [Target Delivery API] to retrieve and deliver
1313
- [Getting started](#getting-started)
1414
- [Prerequisites](#prerequisites)
1515
- [Installation](#installation)
16-
- [Super Simple To Use](#super-simple-to-use)
16+
- [Super Simple to Use](#super-simple-to-use)
1717
- [Sample Apps](#sample-apps)
1818
- [Build](#build)
1919
- [Releases](#releases)
20-
- [Using nugets built locally in your project](#using-nugets-built-locally-in-your-project)
2120
- [Contributing](#contributing)
2221
- [Licensing](#licensing)
2322

@@ -26,7 +25,7 @@ The Adobe Target .Net SDK uses the [Target Delivery API] to retrieve and deliver
2625
### Prerequisites
2726

2827
At a minimum [.NET Core SDK 2.0](https://dotnet.microsoft.com/download/dotnet-core/2.0) is required to build, test, and generate NuGet packages.
29-
Note: the SDK itself multi-targets .NET Standard 2.0 and .NET 5
28+
Note: the SDK itself multi-targets .NET Standard 2.0, .NET 5, 6 and 7
3029

3130
**macOS/Linux**
3231

SampleApp/SampleApp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<PropertyGroup>
1212
<OutputType>Exe</OutputType>
13-
<TargetFramework>net5.0</TargetFramework>
13+
<TargetFramework>net7.0</TargetFramework>
1414
<StartupObject>SampleApp.ProgramSync</StartupObject>
1515
</PropertyGroup>
1616

Source/Adobe.Target.Client/Adobe.Target.Client.csproj

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

33
<PropertyGroup Label="Build">
4-
<TargetFrameworks>net5.0;netstandard2.0</TargetFrameworks>
4+
<TargetFrameworks>net5.0;net6.0;net7.0;netstandard2.0</TargetFrameworks>
55
</PropertyGroup>
66

77
<PropertyGroup Label="Package">
@@ -11,14 +11,27 @@
1111
<MinVerTagPrefix>client-</MinVerTagPrefix>
1212
</PropertyGroup>
1313

14+
<ItemGroup Label="Platform references for .NET 5 / Standard 2.0" Condition = "'$(TargetFramework)' == 'net5.0' OR '$(TargetFramework)' == 'netstandard2.0'">
15+
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.*" />
16+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.*" />
17+
</ItemGroup>
18+
19+
<ItemGroup Label="Platform references for .NET 6" Condition = "'$(TargetFramework)' == 'net6.0'">
20+
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.*" />
21+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.*" />
22+
</ItemGroup>
23+
24+
<ItemGroup Label="Platform references for .NET 7" Condition = "'$(TargetFramework)' == 'net7.0'">
25+
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.*" />
26+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.*" />
27+
</ItemGroup>
28+
1429
<ItemGroup Label="Project References">
1530
<PackageReference Include="Adobe.ExperienceCloud.Ecid" Version="1.0.0" />
1631
<PackageReference Include="Adobe.Target.Delivery" Version="1.1.3" />
1732
<PackageReference Include="JsonLogic.Net" Version="1.1.11" />
1833
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
19-
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
2034
<PackageReference Include="UAParser" Version="3.1.46" />
21-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.1" />
2235
</ItemGroup>
2336

2437
<ItemGroup>

Source/Adobe.Target.Client/OnDevice/RuleLoader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ private async Task LoadRulesAsync()
149149
.OrResult<IRestResponse>(r => HttpStatusCodesWorthRetrying.Contains(r.StatusCode))
150150
.RetryAsync(MaxRetries, onRetry: (exception, retryCount, context) =>
151151
{
152-
this.logger.LogError(exception.Exception, Messages.RuleLoadingError, retryCount);
152+
this.logger?.LogError(exception.Exception, Messages.RuleLoadingError, retryCount);
153153
})
154154
.ExecuteAndCaptureAsync(() => client.ExecuteAsync(this.GetRequest()))
155155
.ConfigureAwait(false);

Source/Adobe.Target.Delivery/Adobe.Target.Delivery.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 Label="Build">
4-
<TargetFrameworks>net5.0;netstandard2.0</TargetFrameworks>
4+
<TargetFrameworks>net5.0;net6.0;net7.0;netstandard2.0</TargetFrameworks>
55
</PropertyGroup>
66

77
<PropertyGroup Label="Package">

Tests/Adobe.Target.Client.Test/Adobe.Target.Client.Test.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 Label="Build">
4-
<TargetFramework>net5.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup Label="Project References">

codegeneration/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules/
22
build/
3+
prevbuild/

codegeneration/template/netcore_project.mustache

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 Label="Build">
4-
<TargetFrameworks>net5.0;netstandard2.0</TargetFrameworks>
4+
<TargetFrameworks>net5.0;net6.0;net7.0;netstandard2.0</TargetFrameworks>
55
</PropertyGroup>
66

77
<PropertyGroup Label="Package">

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
33
"rollForward": "latestMajor",
4-
"version": "5.0.202"
4+
"version": "7.0.101"
55
}
66
}

0 commit comments

Comments
 (0)