Skip to content

Commit

Permalink
nuint requires System namespace when targeting net6.0-maccatalyst…
Browse files Browse the repository at this point in the history
… / net6.0-android
  • Loading branch information
MartyIX committed Nov 3, 2022
1 parent 7b21573 commit 043aba4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.x'
- run: dotnet workload install android ios maccatalyst
- run: dotnet --info
- name: Test (.NET 6.0/Debug)
run: dotnet test -f net6.0 -c Debug
Expand All @@ -32,6 +33,7 @@ jobs:
uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.x'
- run: dotnet workload install android
- run: dotnet --info
- name: Test (.NET 6.0/Debug)
run: dotnet test -f net6.0 -c Debug
Expand All @@ -44,6 +46,7 @@ jobs:
image: mcr.microsoft.com/dotnet/sdk:6.0-alpine
steps:
- uses: actions/checkout@v3
- run: dotnet workload install android
- run: dotnet --info
- name: Test (.NET 6.0/Debug)
run: dotnet test -f net6.0 -c Debug
Expand All @@ -58,6 +61,7 @@ jobs:
uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.x'
- run: dotnet workload install android ios maccatalyst
- run: dotnet --info
- name: Test (.NET 6.0/Debug)
run: dotnet test -f net6.0 -c Debug
Expand Down
3 changes: 2 additions & 1 deletion src/Sodium.Core/Sodium.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.1;netstandard2.0</TargetFrameworks>
<TargetFrameworks>netstandard2.1;netstandard2.0;net6.0;net6.0-android</TargetFrameworks>
<TargetFrameworks Condition="!$([MSBuild]::IsOSPlatform('linux'))">$(TargetFrameworks);net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<LangVersion>9.0</LangVersion>
<Features>strict</Features>
<Nullable>enable</Nullable>
Expand Down
3 changes: 2 additions & 1 deletion src/Sodium.Core/SodiumCore.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Runtime.InteropServices;
using static Interop.Libsodium;

Expand Down Expand Up @@ -29,7 +30,7 @@ public static byte[] GetRandomBytes(int count)
public static int GetRandomNumber(int upperBound)
{
if (upperBound < 0)
throw new System.ArgumentOutOfRangeException(nameof(upperBound), "upperBound cannot be negative");
throw new ArgumentOutOfRangeException(nameof(upperBound), "upperBound cannot be negative");

SodiumCore.Initialize();
var randomNumber = randombytes_uniform((uint)upperBound);
Expand Down
3 changes: 3 additions & 0 deletions src/Sodium.Core/Utilities.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#if !NETSTANDARD2_0_OR_GREATER
using System;
#endif
using static Interop.Libsodium;

namespace Sodium
Expand Down

0 comments on commit 043aba4

Please sign in to comment.