Skip to content

Commit

Permalink
Update dependencies to dotnet 6 (#246)
Browse files Browse the repository at this point in the history
* remove dotnet core 3.1 dependencies

* update .net and json.text dependencies to 6.x.0 versions

use cultureinfo invariantculture for decimal formatting

* fix polly config test
  • Loading branch information
jenschude authored Aug 31, 2023
1 parent b1c5da5 commit 93cf3e6
Show file tree
Hide file tree
Showing 26 changed files with 113 additions and 108 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
run: git config --global core.longpaths true
- name: Checkout
uses: actions/checkout@v3
- name: Setup dotnet 3.1
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
6.0.x
7.0.x
- run: dotnet tool restore
working-directory: ./commercetools.Sdk
Expand Down Expand Up @@ -59,11 +59,11 @@ jobs:
run: git config --global core.longpaths true
- name: Checkout
uses: actions/checkout@v3
- name: Setup dotnet 3.1
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
6.0.x
7.0.x
- run: dotnet tool restore
working-directory: ./commercetools.Sdk
Expand Down Expand Up @@ -110,11 +110,11 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
6.0.x
7.0.x
- run: dotnet tool restore
working-directory: ./commercetools.Sdk
Expand Down Expand Up @@ -188,7 +188,7 @@ jobs:
- uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
6.0.x
7.0.x
source-url: https://nuget.pkg.github.com/commercetools/index.json
env:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
run: git config --global core.longpaths true
- name: Checkout
uses: actions/checkout@v3
- name: Setup dotnet 3.1
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
6.0.x
7.0.x
- run: dotnet tool restore
working-directory: ./commercetools.Sdk
Expand All @@ -47,10 +47,11 @@ jobs:
steps:
- uses: actions/checkout@v3
# Authenticates packages to push to GPR
- uses: actions/setup-dotnet@v3
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
6.0.x
7.0.x
source-url: https://nuget.pkg.github.com/commercetools/index.json
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="OpenTelemetry.AutoInstrumentation" Version="1.0.0-rc.2" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.5.1-beta.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.5.1-beta.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<LangVersion>8</LangVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public async Task proxy()
await client
.ExecuteAsync<object>(new HttpRequestMessage(HttpMethod.Get, "https://www.example.com"));
});
Assert.Equal("Connection refused", exception.Message);
Assert.StartsWith("Connection refused", exception.Message);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<UserSecretsId>6e42aa04-1612-4e1c-8bb2-190e5c88343f</UserSecretsId>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.14" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="3.1.14" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.14" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="3.1.14" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.14" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="3.1.14" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.14" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="6.0.21" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,16 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.14" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="3.1.14" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.14" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="3.1.14" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.14" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="3.1.14" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.14" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3"><IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="6.0.21" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\commercetools.Base.Client\commercetools.Base.Client.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
<UserSecretsId>6e42aa04-1612-4e1c-8bb2-190e5c88343f</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.14" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="3.1.14" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.14" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="3.1.14" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.14" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.14" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit" Version="2.5.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ public void IntDeserialization()
public void DecimalSerialization()
{
var serializerService = this._serializationFixture.SerializerService;
var attributes = new List<Attribute>
var attributes = new List<IAttribute>
{
new DecimalAttribute() { Name = "decimal", Value = 13m },
new DecimalAttribute() { Name = "decimal-zero", Value = 13.0m },
Expand Down Expand Up @@ -522,7 +522,7 @@ public void testNestedSetList()
new SetAttribute<NestedAttribute>()
{
Name = "products",
Value = new List<NestedAttribute>()
Value = new List<IAttribute>()
},
new LocalizedStringAttribute
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,10 @@ public void DeserializeChangeSubscription()

var changeSubscription1 = serializerService.Deserialize<ChangeSubscription>(serialized1);
var changeSubscription2 = serializerService.Deserialize<ChangeSubscription>(serialized2);
Assert.Equal("cart-discount", changeSubscription1.ResourceTypeId);
Assert.Equal("new-type", changeSubscription2.ResourceTypeId);
Assert.Equal("cart-discount", changeSubscription1.ResourceTypeId.ToString());
Assert.Equal("new-type", changeSubscription2.ResourceTypeId.ToString());
}


[Fact]
public void DeserializeOfSubscriptions()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.14" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
<PackageReference Include="coverlet.collector" Version="1.3.0" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0"/>
<PackageReference Include="coverlet.collector" Version="6.0.0"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.14" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.14" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.2" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.2" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\commercetools.Base.Serialization\commercetools.Base.Serialization.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.2" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\commercetools.Base.Serialization\commercetools.Base.Serialization.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.2" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit" Version="2.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\commercetools.Base.Serialization\commercetools.Base.Serialization.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@
<Folder Include="Domain\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Text.Json" Version="4.7.2" />
<PackageReference Include="Microsoft.Extensions.Http" Version="3.1.14" />
<PackageReference Include="System.Text.Json" Version="6.0.8" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\commercetools.Base.Abstractions\commercetools.Base.Abstractions.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.14" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Text.Json" Version="4.7.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.14" />
<PackageReference Include="System.Text.Json" Version="6.0.8" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

using System;
using System.Collections.Generic;
using System.Globalization;

namespace commercetools.Sdk.Api.Predicates.Query
{
Expand All @@ -20,9 +21,9 @@ public GeoJsonPredicateBuilder(BinaryQueryPredicate predicate,
public CombinationQueryPredicate<T> WithinCircle(decimal longitude, decimal latitude,
long distance)
{
IEnumerable<IQueryPredicate> p = new[]{ ConstantQueryPredicate.Of().Constant(longitude.ToString()),
ConstantQueryPredicate.Of().Constant(latitude.ToString()),
ConstantQueryPredicate.Of().Constant(distance.ToString())};
IEnumerable<IQueryPredicate> p = new[]{ ConstantQueryPredicate.Of().Constant(longitude.ToString(CultureInfo.InvariantCulture)),
ConstantQueryPredicate.Of().Constant(latitude.ToString(CultureInfo.InvariantCulture)),
ConstantQueryPredicate.Of().Constant(distance.ToString(CultureInfo.InvariantCulture))};
return combinationFn.Invoke(predicate.Operator(PredicateOperator.Within.ToString())
.Right(ContainerQueryPredicate.Of()
.Parent(ConstantQueryPredicate.Of().Constant("circle"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
<NoWarn>$(NoWarn);CS1591;CS1573</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="JsonSubTypes" Version="2.0.1" />
<PackageReference Include="System.Text.Json" Version="4.7.2" />
<PackageReference Include="System.Text.Json" Version="6.0.8" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit 93cf3e6

Please sign in to comment.