Skip to content

Commit

Permalink
TNT-46398 Support .NET 6 and .NET 7 (#36)
Browse files Browse the repository at this point in the history
* TNT-46398 Support .NET 6 and .NET 7
  • Loading branch information
XDex authored Dec 16, 2022
1 parent bb12bac commit e6a824f
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 14 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@ jobs:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: 'Checkout'
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
lfs: true
fetch-depth: 0
- name: 'Git Fetch Tags'
run: git fetch --tags
shell: pwsh
- name: 'Install .NET Core SDK'
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0
- name: 'Dotnet Tool Restore'
run: dotnet tool restore
shell: pwsh
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ The Adobe Target .Net SDK uses the [Target Delivery API] to retrieve and deliver
- [Getting started](#getting-started)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Super Simple To Use](#super-simple-to-use)
- [Super Simple to Use](#super-simple-to-use)
- [Sample Apps](#sample-apps)
- [Build](#build)
- [Releases](#releases)
- [Using nugets built locally in your project](#using-nugets-built-locally-in-your-project)
- [Contributing](#contributing)
- [Licensing](#licensing)

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

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.
Note: the SDK itself multi-targets .NET Standard 2.0 and .NET 5
Note: the SDK itself multi-targets .NET Standard 2.0, .NET 5, 6 and 7

**macOS/Linux**

Expand Down
2 changes: 1 addition & 1 deletion SampleApp/SampleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<StartupObject>SampleApp.ProgramSync</StartupObject>
</PropertyGroup>

Expand Down
19 changes: 16 additions & 3 deletions Source/Adobe.Target.Client/Adobe.Target.Client.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Label="Build">
<TargetFrameworks>net5.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net5.0;net6.0;net7.0;netstandard2.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Label="Package">
Expand All @@ -11,14 +11,27 @@
<MinVerTagPrefix>client-</MinVerTagPrefix>
</PropertyGroup>

<ItemGroup Label="Platform references for .NET 5 / Standard 2.0" Condition = "'$(TargetFramework)' == 'net5.0' OR '$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.*" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.*" />
</ItemGroup>

<ItemGroup Label="Platform references for .NET 6" Condition = "'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.*" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.*" />
</ItemGroup>

<ItemGroup Label="Platform references for .NET 7" Condition = "'$(TargetFramework)' == 'net7.0'">
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.*" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.*" />
</ItemGroup>

<ItemGroup Label="Project References">
<PackageReference Include="Adobe.ExperienceCloud.Ecid" Version="1.0.0" />
<PackageReference Include="Adobe.Target.Delivery" Version="1.1.3" />
<PackageReference Include="JsonLogic.Net" Version="1.1.11" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" />
<PackageReference Include="UAParser" Version="3.1.46" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Source/Adobe.Target.Client/OnDevice/RuleLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ private async Task LoadRulesAsync()
.OrResult<IRestResponse>(r => HttpStatusCodesWorthRetrying.Contains(r.StatusCode))
.RetryAsync(MaxRetries, onRetry: (exception, retryCount, context) =>
{
this.logger.LogError(exception.Exception, Messages.RuleLoadingError, retryCount);
this.logger?.LogError(exception.Exception, Messages.RuleLoadingError, retryCount);
})
.ExecuteAndCaptureAsync(() => client.ExecuteAsync(this.GetRequest()))
.ConfigureAwait(false);
Expand Down
2 changes: 1 addition & 1 deletion Source/Adobe.Target.Delivery/Adobe.Target.Delivery.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Label="Build">
<TargetFrameworks>net5.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net5.0;net6.0;net7.0;netstandard2.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Label="Package">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Label="Build">
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup Label="Project References">
Expand Down
1 change: 1 addition & 0 deletions codegeneration/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
build/
prevbuild/
2 changes: 1 addition & 1 deletion codegeneration/template/netcore_project.mustache
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup Label="Build">
<TargetFrameworks>net5.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net5.0;net6.0;net7.0;netstandard2.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Label="Package">
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"rollForward": "latestMajor",
"version": "5.0.202"
"version": "7.0.101"
}
}

0 comments on commit e6a824f

Please sign in to comment.