Skip to content

Commit

Permalink
Merge pull request #273 from twcclegg/net9
Browse files Browse the repository at this point in the history
.net 9 migration
  • Loading branch information
twcclegg authored Nov 14, 2024
2 parents 8bb59ed + ac35768 commit 7847c6f
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build_and_run_unit_tests_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
dotnet-version: 9.x
- name: Add zip files required for running tests
run: |
(cd resources/geocoding; zip -r ../../resources/geocoding.zip *)
Expand All @@ -25,6 +25,6 @@ jobs:
- name: Build solution
run: dotnet build --no-restore
working-directory: ./csharp
- name: Test solution targeting dotnet8.0 only
run: dotnet test --no-build --verbosity normal -p:TargetFrameworks=net8.0
- name: Test solution targeting dotnet9.0 only
run: dotnet test --no-build --verbosity normal -p:TargetFrameworks=net9.0
working-directory: ./csharp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.x
dotnet-version: 9.x
- name: Get new metadata information and create new GitHub release
timeout-minutes: 30
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
dotnet-version: 9.x
- name: Add zip files required for running tests
run: |
Compress-Archive -Path "resources\geocoding\*" -DestinationPath "resources\geocoding.zip"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run_performance_tests_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
dotnet-version: 9.x
- name: Run performance tests
run: dotnet run -c Release --framework net8.0
run: dotnet run -c Release --framework net9.0
working-directory: ./csharp/PhoneNumbers.PerformanceTest
4 changes: 4 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ pull_requests:
branches:
only:
- main
install:
- ps: |
Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -UseBasicParsing -OutFile "$env:temp\dotnet-install.ps1"
& $env:temp\dotnet-install.ps1 -Architecture x64 -Version '9.0.100' -InstallDir "$env:ProgramFiles\dotnet"
before_build:
- dotnet restore csharp -s https://api.nuget.org/v3/index.json
- ps: Compress-Archive -Path "resources\geocoding\*" -DestinationPath "resources\geocoding.zip"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netframework4.8;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>netframework4.8;net8.0;net9.0</TargetFrameworks>
<NoWarn>$(NoWarn);1591;CA1014;CA1062;CA1707</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
Expand All @@ -10,7 +10,7 @@
<IsPackable>false</IsPackable>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net8.0'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0' Or '$(TargetFramework)' == 'net9.0'">
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<PackageId>libphonenumber-csharp.extensions</PackageId>
<VersionPrefix>$(APPVEYOR_BUILD_VERSION)</VersionPrefix>
<Authors>Thomas Clegg</Authors>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net8.0;net9.0</TargetFrameworks>
<LangVersion>preview</LangVersion>
<PackageTags>phonenumber phone libphonenumber e164 e.164 international extensions</PackageTags>
<PackageProjectUrl>https://github.com/twcclegg/libphonenumber-csharp</PackageProjectUrl>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netframework4.8;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>netframework4.8;net8.0;net9.0</TargetFrameworks>
<ImplicitUsings>disable</ImplicitUsings>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net8.0'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0' Or '$(TargetFramework)' == 'net9.0'">
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions csharp/PhoneNumbers.Test/PhoneNumbers.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netframework4.8;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>netframework4.8;net8.0;net9.0</TargetFrameworks>
<AssemblyName>PhoneNumbers.Test</AssemblyName>
<PackageId>PhoneNumbers.Test</PackageId>
<DebugType>full</DebugType>
<NoWarn>$(NoWarn);CA1014;CA1707</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net8.0'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0' Or '$(TargetFramework)' == 'net9.0'">
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions csharp/PhoneNumbers/PhoneNumbers.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<PackageId>libphonenumber-csharp</PackageId>
<VersionPrefix>$(APPVEYOR_BUILD_VERSION)</VersionPrefix>
<Authors>Patrick Mézard;Thomas Clegg;Jarrod Alexander;Google;libphonenumber contributors</Authors>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net8.0;net9.0</TargetFrameworks>
<LangVersion>preview</LangVersion>
<PackageTags>phonenumber phone libphonenumber e164 e.164 international</PackageTags>
<PackageProjectUrl>https://github.com/twcclegg/libphonenumber-csharp</PackageProjectUrl>
Expand All @@ -25,7 +25,7 @@
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0' Or '$(TargetFramework)' == 'net8.0'">
<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0' Or '$(TargetFramework)' == 'net9.0'">
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion lib/github-actions-metadata-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ cd ${GITHUB_ACTION_WORKING_DIRECTORY}
cd csharp
dotnet restore
dotnet build --no-restore
dotnet test --no-build --verbosity normal -p:TargetFrameworks=net8.0
dotnet test --no-build --verbosity normal -p:TargetFrameworks=net9.0
# Cleanup test dependencies
rm -rf ${GITHUB_ACTION_WORKING_DIRECTORY}/resources/geocoding.zip
rm -rf ${GITHUB_ACTION_WORKING_DIRECTORY}/resources/test/testgeocoding.zip
Expand Down

0 comments on commit 7847c6f

Please sign in to comment.