Skip to content

Commit

Permalink
add support for .NET 8
Browse files Browse the repository at this point in the history
  • Loading branch information
albho committed Sep 11, 2024
1 parent 0e0b1f6 commit 8320dba
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 17 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/dotnet-codestyle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,25 @@ 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
working-directory: binding/dotnet

# ************** REMOVE AFTER RELEASE ********************
- name: Pack .NET SDK
run: dotnet pack -c Release
working-directory: binding/dotnet

- name: Add local NuGet package file
run: dotnet add package -s ../../../binding/dotnet/Porcupine/bin/Release Porcupine
working-directory: demo/dotnet/PorcupineDemo
# ********************************************************

- name: Run Demo Codestyle
run: dotnet format --verify-no-changes
working-directory: demo/dotnet
Expand Down
38 changes: 34 additions & 4 deletions .github/workflows/dotnet-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,20 @@ 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

# ************** REMOVE AFTER RELEASE ********************
- name: Pack .NET SDK
run: dotnet pack -c Release
working-directory: binding/dotnet

- name: Add local NuGet package file
continue-on-error: true
run: dotnet add package -s ../../../binding/dotnet/Porcupine/bin/Release Porcupine
# ********************************************************

- name: Package restore
run: dotnet restore
Expand All @@ -61,6 +71,16 @@ jobs:
steps:
- uses: actions/checkout@v3

# ************** REMOVE AFTER RELEASE ********************
- name: Pack .NET SDK
run: dotnet pack -c Release
working-directory: binding/dotnet

- name: Add local NuGet package file
continue-on-error: true
run: dotnet add package -s ../../../binding/dotnet/Porcupine/bin/Release Porcupine
# ********************************************************

- name: Package restore
run: dotnet restore

Expand All @@ -86,10 +106,20 @@ 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

# ************** REMOVE AFTER RELEASE ********************
- name: Pack .NET SDK
run: dotnet pack -c Release
working-directory: binding/dotnet

- name: Add local NuGet package file
continue-on-error: true
run: dotnet add package -s ../../../binding/dotnet/Porcupine/bin/Release Porcupine
# ********************************************************

- name: Package restore
run: dotnet restore
Expand Down
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>
4 changes: 2 additions & 2 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="Porcupine" Version="3.0.4" />
<PackageReference Include="PvRecorder" Version="1.2.5" />
</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

0 comments on commit 8320dba

Please sign in to comment.