Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(runtime): updating the .net version support for net8.0, and removing support for netstandard2.1 and net5.0 #93

Merged
merged 3 commits into from
Jan 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:

jobs:
build:

runs-on: ubuntu-latest

steps:
Expand All @@ -25,14 +24,14 @@ jobs:
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
- name: Setup .NET 5.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: '5.0.x'
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: Setup .NET 8.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'

# Perform the dotnet actions
- name: Install dependencies
Expand All @@ -45,25 +44,25 @@ jobs:
# Get the version information
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
if: ${{ contains(github.event_name, 'push') }}
if: ${{ success() && contains(github.event_name, 'push') }}
with:
versionSpec: '5.x'
- name: Determine Version
uses: gittools/actions/gitversion/[email protected]
if: ${{ contains(github.event_name, 'push') }}
if: ${{ success() && contains(github.event_name, 'push') }}
with:
useConfigFile: true
- name: Display SemVer
if: ${{ contains(github.event_name, 'push') }}
if: ${{ success() && contains(github.event_name, 'push') }}
run: |
echo "SemVer: $GITVERSION_SEMVER"

# Package and publish
- name: Package
if: ${{ contains(github.event_name, 'push') }}
if: ${{ success() && contains(github.event_name, 'push') }}
run: dotnet pack --no-build --configuration Release --output ./Packages -p:PackageVersion=$GITVERSION_SEMVER
- name: Push
if: ${{ contains(github.event_name, 'push') }}
if: ${{ success() && contains(github.event_name, 'push') }}
run: |
cd Packages
dotnet nuget push "*.nupkg" --source https://api.nuget.org/v3/index.json --api-key $NUGET_API_KEY
Expand Down
2 changes: 1 addition & 1 deletion src/Geo.ArcGIS/Geo.ArcGIS.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<Authors>Justin Canton</Authors>
<Company>Geo.NET</Company>
<Product>Geo.NET ArcGIS</Product>
Expand Down
2 changes: 1 addition & 1 deletion src/Geo.Bing/Geo.Bing.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<Authors>Justin Canton</Authors>
<Company>Geo.NET</Company>
<Product>Geo.NET Bing</Product>
Expand Down
19 changes: 7 additions & 12 deletions src/Geo.Core/Geo.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<Authors>Justin Canton</Authors>
<Company>Geo.NET</Company>
<Product>Geo.NET Core</Product>
Expand All @@ -16,28 +16,23 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.Localization" Version="8.0.0" />
<PackageReference Include="System.Text.Encodings.Web" Version="8.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.Extensions.Localization" Version="6.0.0" />
<PackageReference Include="System.Text.Encodings.Web" Version="6.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<PackageReference Include="Microsoft.Extensions.Localization" Version="5.0.1" />
<PackageReference Include="System.Text.Encodings.Web" Version="5.0.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="Microsoft.Extensions.Localization" Version="5.0.1" />
<PackageReference Include="System.Text.Encodings.Web" Version="5.0.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Extensions.Localization" Version="3.1.0" />
<PackageReference Include="System.Text.Encodings.Web" Version="4.7.2" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Geo.Google/Geo.Google.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<Authors>Justin Canton</Authors>
<Company>Geo.NET</Company>
<Product>Geo.NET Google</Product>
Expand Down
2 changes: 1 addition & 1 deletion src/Geo.Here/Geo.Here.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<Authors>Justin Canton</Authors>
<Company>Geo.NET</Company>
<Product>Geo.NET HERE</Product>
Expand Down
2 changes: 1 addition & 1 deletion src/Geo.MapBox/Geo.MapBox.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<Authors>Justin Canton</Authors>
<Company>Geo.NET</Company>
<Product>Geo.NET MapBox</Product>
Expand Down
2 changes: 1 addition & 1 deletion src/Geo.MapQuest/Geo.MapQuest.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<Authors>Justin Canton</Authors>
<Company>Geo.NET</Company>
<Product>Geo.NET MapQuest</Product>
Expand Down
24 changes: 8 additions & 16 deletions src/Source.props
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
<Project>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'netstandard2.0'">
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
Expand Down
2 changes: 1 addition & 1 deletion test/Geo.ArcGIS.Tests/Geo.ArcGIS.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net48;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net48;netcoreapp3.1;net6.0;net8.0</TargetFrameworks>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
22 changes: 11 additions & 11 deletions test/Geo.ArcGIS.Tests/Services/ArcGISGeocodingShould.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public async Task AddArcGISTokenSuccessfully()

var query = QueryString.Empty;

query = await sut.AddArcGISToken(query, CancellationToken.None).ConfigureAwait(false);
query = await sut.AddArcGISToken(query, CancellationToken.None);

var queryParameters = HttpUtility.ParseQueryString(query.ToString());
queryParameters.Count.Should().Be(1);
Expand Down Expand Up @@ -224,7 +224,7 @@ public async Task BuildAddressCandidateRequestSuccessfully(CultureInfo culture)
};

// Act
var uri = await sut.BuildAddressCandidateRequest(parameters, CancellationToken.None).ConfigureAwait(false);
var uri = await sut.BuildAddressCandidateRequest(parameters, CancellationToken.None);

// Assert
var query = HttpUtility.UrlDecode(uri.PathAndQuery);
Expand Down Expand Up @@ -284,7 +284,7 @@ public async Task BuildPlaceCandidateRequestSuccessfully(CultureInfo culture)
};

// Act
var uri = await sut.BuildPlaceCandidateRequest(parameters, CancellationToken.None).ConfigureAwait(false);
var uri = await sut.BuildPlaceCandidateRequest(parameters, CancellationToken.None);

// Assert
var query = HttpUtility.UrlDecode(uri.PathAndQuery);
Expand Down Expand Up @@ -334,7 +334,7 @@ public async Task BuildSuggestRequestSuccessfully(CultureInfo culture)
};

// Act
var uri = await sut.BuildSuggestRequest(parameters, CancellationToken.None).ConfigureAwait(false);
var uri = await sut.BuildSuggestRequest(parameters, CancellationToken.None);

// Assert
var query = HttpUtility.UrlDecode(uri.PathAndQuery);
Expand Down Expand Up @@ -399,7 +399,7 @@ public async Task BuildReverseGeocodingRequestSuccessfully(CultureInfo culture)
parameters.FeatureTypes.Add(FeatureType.StreetName);

// Act
var uri = await sut.BuildReverseGeocodingRequest(parameters, CancellationToken.None).ConfigureAwait(false);
var uri = await sut.BuildReverseGeocodingRequest(parameters, CancellationToken.None);

// Assert
var query = HttpUtility.UrlDecode(uri.PathAndQuery);
Expand Down Expand Up @@ -479,7 +479,7 @@ public async Task BuildGeocodingRequestSuccessfully(CultureInfo culture)
});

// Act
var uri = await sut.BuildGeocodingRequest(parameters, CancellationToken.None).ConfigureAwait(false);
var uri = await sut.BuildGeocodingRequest(parameters, CancellationToken.None);

// Assert
var query = HttpUtility.UrlDecode(uri.PathAndQuery);
Expand Down Expand Up @@ -533,7 +533,7 @@ public async Task GeocodingAsyncSuccessfully()
SingleLine = "123 East",
});

var response = await sut.GeocodingAsync(parameters).ConfigureAwait(false);
var response = await sut.GeocodingAsync(parameters);
response.Locations.Count.Should().Be(1);
response.SpatialReference.WellKnownID.Should().Be(4326);
}
Expand All @@ -556,7 +556,7 @@ public async Task ReverseGeocodingAsyncSuccessfully()
},
};

var response = await sut.ReverseGeocodingAsync(parameters).ConfigureAwait(false);
var response = await sut.ReverseGeocodingAsync(parameters);
response.Address.MatchAddress.Should().Be("Cali's California Style Burritos");
response.Location.Longitude.Should().Be(-85.837039999999945);
}
Expand All @@ -575,7 +575,7 @@ public async Task SuggestAsyncSuccessfully()
Text = "123 East",
};

var response = await sut.SuggestAsync(parameters).ConfigureAwait(false);
var response = await sut.SuggestAsync(parameters);
response.Suggestions.Count.Should().Be(5);
}

Expand All @@ -593,7 +593,7 @@ public async Task PlaceCandidateAsyncSuccessfully()
Category = "restaurants",
};

var response = await sut.PlaceCandidateAsync(parameters).ConfigureAwait(false);
var response = await sut.PlaceCandidateAsync(parameters);
response.Candidates.Count.Should().Be(0);
response.SpatialReference.WellKnownID.Should().Be(4326);
}
Expand All @@ -612,7 +612,7 @@ public async Task AddressCandidateAsyncSuccessfully()
SingleLineAddress = "123 East",
};

var response = await sut.AddressCandidateAsync(parameters).ConfigureAwait(false);
var response = await sut.AddressCandidateAsync(parameters);
response.Candidates.Count.Should().Be(1);
response.SpatialReference.WellKnownID.Should().Be(4326);
}
Expand Down
10 changes: 5 additions & 5 deletions test/Geo.ArcGIS.Tests/Services/ArcGISTokenContainerShould.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public async Task GetTokenSuccessfully()
{
var tokenContainer = new ArcGISTokenContainer(_mockTokenRetrevial.Object);

var token = await tokenContainer.GetTokenAsync(CancellationToken.None).ConfigureAwait(false);
var token = await tokenContainer.GetTokenAsync(CancellationToken.None);
token.Should().Be("key123");
}

Expand All @@ -67,10 +67,10 @@ public async Task GetTokenTwice()
{
var tokenContainer = new ArcGISTokenContainer(_mockTokenRetrevial.Object);

var token = await tokenContainer.GetTokenAsync(CancellationToken.None).ConfigureAwait(false);
var token = await tokenContainer.GetTokenAsync(CancellationToken.None);
token.Should().Be("key123");

var tokenAgain = await tokenContainer.GetTokenAsync(_quickExpireToken).ConfigureAwait(false);
var tokenAgain = await tokenContainer.GetTokenAsync(_quickExpireToken);
tokenAgain.Should().Be("key123");
}

Expand All @@ -83,10 +83,10 @@ public async Task GetTokenExpiredAndRefetched()
{
var tokenContainer = new ArcGISTokenContainer(_mockTokenRetrevial.Object);

var token = await tokenContainer.GetTokenAsync(_quickExpireToken).ConfigureAwait(false);
var token = await tokenContainer.GetTokenAsync(_quickExpireToken);
token.Should().Be("key456");

var tokenAgain = await tokenContainer.GetTokenAsync(CancellationToken.None).ConfigureAwait(false);
var tokenAgain = await tokenContainer.GetTokenAsync(CancellationToken.None);
tokenAgain.Should().Be("key123");
}
}
Expand Down
6 changes: 3 additions & 3 deletions test/Geo.ArcGIS.Tests/Services/ArcGISTokenRetrevialShould.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public async Task BuildContentSuccessfully()
var content = service.BuildContent();
content.Headers.ContentType.ToString().Should().Be("application/x-www-form-urlencoded");

var collection = await content.ReadAsStringAsync().ConfigureAwait(false);
var collection = await content.ReadAsStringAsync();
collection.Should().Contain("client_id=abc123")
.And.Contain("client_secret=secret123")
.And.Contain("grant_type=client_credentials");
Expand All @@ -91,7 +91,7 @@ public async Task GetTokenShouldReturnEmptyWithNoKey()
var keyContainer = new ArcGISCredentialsContainer(string.Empty, string.Empty);
var service = new ArcGISTokenRetrevial(httpClient, keyContainer);

var token = await service.GetTokenAsync(CancellationToken.None).ConfigureAwait(false);
var token = await service.GetTokenAsync(CancellationToken.None);
token.AccessToken.Should().Be(string.Empty);
token.ExpiresIn.Should().Be(int.MaxValue);
}
Expand All @@ -108,7 +108,7 @@ public async Task GetTokenShouldReturnValidToken()
{
var service = new ArcGISTokenRetrevial(httpClient, _keyContainer);

var token = await service.GetTokenAsync(CancellationToken.None).ConfigureAwait(false);
var token = await service.GetTokenAsync(CancellationToken.None);
token.AccessToken.Should().Be("1234567890abc");
token.ExpiresIn.Should().Be(15000);
}
Expand Down
2 changes: 1 addition & 1 deletion test/Geo.Bing.Tests/Geo.Bing.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net48;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net48;netcoreapp3.1;net6.0;net8.0</TargetFrameworks>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions test/Geo.Bing.Tests/Services/BingGeocodingShould.cs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public async Task GeocodingAsyncSuccessfully()
Query = "1 Microsoft Way Redmond WA",
};

var response = await sut.GeocodingAsync(parameters).ConfigureAwait(false);
var response = await sut.GeocodingAsync(parameters);
response.StatusCode.Should().Be(200);
response.ResourceSets.Count.Should().Be(1);
}
Expand All @@ -450,7 +450,7 @@ public async Task ReverseGeocodingAsyncSuccessfully()
},
};

var response = await sut.ReverseGeocodingAsync(parameters).ConfigureAwait(false);
var response = await sut.ReverseGeocodingAsync(parameters);
response.StatusCode.Should().Be(200);
response.ResourceSets.Count.Should().Be(1);
}
Expand All @@ -473,7 +473,7 @@ public async Task AddressGeocodingAsyncSuccessfully()
CountryRegion = new RegionInfo("en-CA"),
};

var response = await sut.AddressGeocodingAsync(parameters).ConfigureAwait(false);
var response = await sut.AddressGeocodingAsync(parameters);
response.StatusCode.Should().Be(200);
response.ResourceSets.Count.Should().Be(1);
response.ResourceSets[0].EstimatedTotal.Should().Be(2);
Expand Down
Loading
Loading