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

add support for .NET 8 #1303

Merged
merged 4 commits into from
Sep 17, 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
4 changes: 2 additions & 2 deletions .github/workflows/dotnet-codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up .NET 6.0
- name: Set up .NET 8.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x

- name: Run Binding Codestyle
run: dotnet format --verify-no-changes
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/dotnet-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up .NET 6.0
- name: Set up .NET 8.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x

- name: Package restore
run: dotnet restore
Expand Down Expand Up @@ -86,10 +86,10 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up .NET 6.0
- name: Set up .NET 8.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: 8.0.x

- name: Package restore
run: dotnet restore
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, macos-13, windows-latest]
dotnet-version: [2.1.x, 3.0.x, 3.1.x, 5.0.x, 6.0.x]
dotnet-version: [2.1.x, 3.0.x, 3.1.x, 5.0.x, 6.0.x, 8.0.x]
include:
- dotnet-version: 2.1.x
binding-framework: netstandard2.0
Expand All @@ -67,6 +67,9 @@ jobs:
- dotnet-version: 6.0.x
binding-framework: net6.0
test-framework: net6.0
- dotnet-version: 8.0.x
binding-framework: net8.0
test-framework: net8.0
exclude:
- os: macos-latest
dotnet-version: 2.1.x
Expand All @@ -76,8 +79,10 @@ jobs:
dotnet-version: 3.1.x
- os: macos-latest
dotnet-version: 5.0.x
- os: macos-13
- os: macos-latest
dotnet-version: 6.0.x
- os: macos-13
dotnet-version: 8.0.x

steps:
- uses: actions/checkout@v3
Expand All @@ -100,13 +105,13 @@ jobs:

strategy:
matrix:
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-64]
machine: [rpi3-32, rpi3-64, rpi4-32, rpi4-64, rpi5-32, rpi5-64]

steps:
- uses: actions/checkout@v3

- name: Build binding
run: dotnet build Porcupine/Porcupine.csproj --framework net6.0
run: dotnet build Porcupine/Porcupine.csproj --framework net8.0

- name: Test
run: dotnet test --framework net6.0 -v n
run: dotnet test --framework net8.0 -v n
15 changes: 13 additions & 2 deletions binding/dotnet/Porcupine/Porcupine.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;netcoreapp3.0;netstandard2.0</TargetFrameworks>
<Version>3.0.3</Version>
<TargetFrameworks>net8.0;net6.0;netcoreapp3.0;netstandard2.0</TargetFrameworks>
<Version>3.0.4</Version>
<Authors>Picovoice</Authors>
<Company />
<Product>Porcupine Wake Word Engine</Product>
Expand Down Expand Up @@ -39,6 +39,7 @@
<PackagePath>
build/netcoreapp3.0/Porcupine.targets;
build/net6.0/Porcupine.targets;
build/net8.0/Porcupine.targets;
</PackagePath>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand All @@ -51,6 +52,7 @@
build/netstandard2.0/libpv_porcupine.dll;
build/netcoreapp3.0/lib/windows/amd64/libpv_porcupine.dll;
build/net6.0/lib/windows/amd64/libpv_porcupine.dll;
build/net8.0/lib/windows/amd64/libpv_porcupine.dll;
</PackagePath>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>lib\windows\amd64\libpv_porcupine.dll</Link>
Expand All @@ -61,6 +63,7 @@
build/netstandard2.0/libpv_porcupine.so;
build/netcoreapp3.0/lib/linux/x86_64/libpv_porcupine.so;
build/net6.0/lib/linux/x86_64/libpv_porcupine.so;
build/net8.0/lib/linux/x86_64/libpv_porcupine.so;
</PackagePath>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>lib\linux\x86_64\libpv_porcupine.so</Link>
Expand All @@ -71,6 +74,7 @@
build/netstandard2.0/libpv_porcupine.dylib;
build/netcoreapp3.0/lib/mac/x86_64/libpv_porcupine.dylib;
build/net6.0/lib/mac/x86_64/libpv_porcupine.dylib;
build/net8.0/lib/mac/x86_64/libpv_porcupine.dylib;
</PackagePath>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>lib\mac\x86_64\libpv_porcupine.dylib</Link>
Expand All @@ -84,6 +88,7 @@
<PackagePath>
build/netcoreapp3.0/lib/raspberry-pi;
build/net6.0/lib/raspberry-pi;
build/net8.0/lib/raspberry-pi;
</PackagePath>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>lib\raspberry-pi\%(RecursiveDir)%(Filename)%(Extension)</Link>
Expand All @@ -96,6 +101,7 @@
<Content Include="..\..\..\lib\mac\arm64\libpv_porcupine.dylib">
<PackagePath>
build/net6.0/lib/mac/arm64/libpv_porcupine.dylib;
build/net8.0/lib/mac/arm64/libpv_porcupine.dylib;
</PackagePath>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>lib\mac\arm64\libpv_porcupine.dylib</Link>
Expand Down Expand Up @@ -123,6 +129,7 @@
build/netstandard2.0/resources/keyword_files/windows;
build/netcoreapp3.0/resources/keyword_files/windows;
build/net6.0/resources/keyword_files/windows;
build/net8.0/resources/keyword_files/windows;
</PackagePath>
<Link>resources\keyword_files\windows\%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand All @@ -145,6 +152,7 @@
build/netstandard2.0/resources/keyword_files/mac;
build/netcoreapp3.0/resources/keyword_files/mac;
build/net6.0/resources/keyword_files/mac;
build/net8.0/resources/keyword_files/mac;
</PackagePath>
<Link>resources\keyword_files\mac\%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand All @@ -167,6 +175,7 @@
build/netstandard2.0/resources/keyword_files/linux;
build/netcoreapp3.0/resources/keyword_files/linux;
build/net6.0/resources/keyword_files/linux;
build/net8.0/resources/keyword_files/linux;
</PackagePath>
<Link>resources\keyword_files\linux\%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand All @@ -189,6 +198,7 @@
build/netstandard2.0/resources/keyword_files/raspberry-pi;
build/netcoreapp3.0/resources/keyword_files/raspberry-pi;
build/net6.0/resources/keyword_files/raspberry-pi;
build/net8.0/resources/keyword_files/raspberry-pi;
</PackagePath>
<Link>resources\keyword_files\raspberry-pi\%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand All @@ -198,6 +208,7 @@
build/netstandard2.0/lib/common/porcupine_params.pv;
build/netcoreapp3.0/lib/common/porcupine_params.pv;
build/net6.0/lib/common/porcupine_params.pv;
build/net8.0/lib/common/porcupine_params.pv;
</PackagePath>
<Link>lib\common\porcupine_params.pv</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
2 changes: 0 additions & 2 deletions binding/dotnet/Porcupine/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,8 @@ public static string PvLinuxMachine()
switch (cpuPart)
{
case "0xd03": return "cortex-a53" + archInfo;
case "0xd07": return "cortex-a57" + archInfo;
case "0xd08": return "cortex-a72" + archInfo;
case "0xd0b": return "cortex-a76" + archInfo;
case "0xc08": return "";
default:
throw new PlatformNotSupportedException($"This device (CPU part = {cpuPart}) is not supported by Picovoice.");
}
Expand Down
2 changes: 1 addition & 1 deletion binding/dotnet/PorcupineTest/PorcupineTest.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1;netcoreapp3.0;netcoreapp2.1;</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0;net5.0;netcoreapp3.1;netcoreapp3.0;netcoreapp2.1;</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion binding/dotnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Porcupine is:

## Requirements

- .NET 6.0
- .NET 8.0

## Compatibility

Expand Down
4 changes: 2 additions & 2 deletions demo/dotnet-vui/AvaloniaVUI/AvaloniaVUI.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<AvaloniaResource Include="Assets\**" />
Expand All @@ -17,6 +17,6 @@
<PackageReference Include="Avalonia.Desktop" Version="0.9.12" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.9.12" />
<PackageReference Include="PvRecorder" Version="1.2.5" />
<PackageReference Include="Porcupine" Version="3.0.3" />
<PackageReference Include="Porcupine" Version="3.0.4" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions demo/dotnet/PorcupineDemo/PorcupineDemo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Configurations>FileDemo.Debug;FileDemo.Release;MicDemo.Debug;MicDemo.Release</Configurations>
</PropertyGroup>

Expand All @@ -19,7 +19,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Porcupine" Version="3.0.3" />
<PackageReference Include="PvRecorder" Version="1.2.5" />
<PackageReference Include="Porcupine" Version="3.0.4" />
<PackageReference Include="PvRecorder" Version="1.2.6" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion demo/dotnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Porcupine is:

## Requirements

- .NET 6.0
- .NET 8.0

## Compatibility

Expand Down
Loading