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

.net 9 migration #273

Merged
merged 3 commits into from
Nov 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
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