From c46dd91c170fc6aeb757e4732e7b0f504a77e660 Mon Sep 17 00:00:00 2001 From: glopesdev Date: Tue, 15 Jun 2021 09:54:28 +0100 Subject: [PATCH 1/2] Add support for nuget package generation Fixes #2 --- Directory.Build.props | 8 -------- examples/Directory.Build.props | 7 +++++-- liblsl.csproj | 11 ++++++++++- runtimes/README.md | 3 +++ 4 files changed, 18 insertions(+), 11 deletions(-) delete mode 100644 Directory.Build.props create mode 100644 runtimes/README.md diff --git a/Directory.Build.props b/Directory.Build.props deleted file mode 100644 index 84e162b..0000000 --- a/Directory.Build.props +++ /dev/null @@ -1,8 +0,0 @@ - - - Christian Kothe - netstandard2.0 - 1.12.2 - - - diff --git a/examples/Directory.Build.props b/examples/Directory.Build.props index 7a68623..b57ab75 100644 --- a/examples/Directory.Build.props +++ b/examples/Directory.Build.props @@ -1,6 +1,9 @@ - + Christian Kothe + netstandard2.0 + 1.12.2 8.0 - \ No newline at end of file + + diff --git a/liblsl.csproj b/liblsl.csproj index 9e7f251..0b9263b 100644 --- a/liblsl.csproj +++ b/liblsl.csproj @@ -7,6 +7,15 @@ 2.0 $(DefaultItemExcludes);examples/** lsl_csharp + Copyright © Christian Kothe 2021 + https://github.com/labstreaminglayer/liblsl-Csharp + MIT + LSL Lab Streaming Layer + true + win-x86;win-x64;osx-x64;linux-x64 - + + + + diff --git a/runtimes/README.md b/runtimes/README.md new file mode 100644 index 0000000..ccc3e7e --- /dev/null +++ b/runtimes/README.md @@ -0,0 +1,3 @@ +# Runtime Identifier Dependencies + +The NuGet package for the C# bindings includes binary distributions for major platform runtimes targeted by [liblsl](https://github.com/sccn/liblsl). To successfully build the package, these binaries need to be downloaded from [liblsl releases](https://github.com/sccn/liblsl/releases) and included in this folder following the RID naming conventions outlined in the [RID Catalog](https://docs.microsoft.com/en-us/dotnet/core/rid-catalog). \ No newline at end of file From 0f1627d47ad2dfc0d9d65bd00ee639657061d3df Mon Sep 17 00:00:00 2001 From: glopesdev Date: Wed, 16 Jun 2021 20:51:37 +0100 Subject: [PATCH 2/2] Add docs for architecture-specific folders --- runtimes/README.md | 64 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/runtimes/README.md b/runtimes/README.md index ccc3e7e..b275674 100644 --- a/runtimes/README.md +++ b/runtimes/README.md @@ -1,3 +1,65 @@ # Runtime Identifier Dependencies -The NuGet package for the C# bindings includes binary distributions for major platform runtimes targeted by [liblsl](https://github.com/sccn/liblsl). To successfully build the package, these binaries need to be downloaded from [liblsl releases](https://github.com/sccn/liblsl/releases) and included in this folder following the RID naming conventions outlined in the [RID Catalog](https://docs.microsoft.com/en-us/dotnet/core/rid-catalog). \ No newline at end of file +The NuGet package for the C# bindings includes binary distributions for major platform runtimes targeted by [liblsl](https://github.com/sccn/liblsl). To successfully build the package, these binaries need to be downloaded from [liblsl releases](https://github.com/sccn/liblsl/releases) and included in this folder following the RID naming conventions outlined in the [RID Catalog](https://docs.microsoft.com/en-us/dotnet/core/rid-catalog). + +The following [architecture-specific folders](https://docs.microsoft.com/en-us/nuget/create-packages/supporting-multiple-target-frameworks#architecture-specific-folders) are recommended: + +``` +\runtimes + \linux-x64 + \native + liblsl.so + liblsl.so.1.14.0 + \osx-x64 + \native + liblsl.dylib + liblsl.1.14.0.dylib + \win-x64 + \native + lsl.dll + \win-x86 + \native + lsl.dll +``` + +## Project files for dependent projects + +From Visual Studio 2019, both .NET Core (`dotnet`) and .NET Framework compilers will use the `RuntimeIdentifier` element of the new SDK csproj format to control which native dependencies to deploy to the final output folder. + +### .NET Core +In .NET Core, the default is to generate cross-platform deployments, which means that all the runtimes will be deployed to the final output folder. By inserting a specific `RuntimeIdentifier` a build targeting only the specified architecture is generated. + +```xml + + + + Exe + net5.0 + + + + + + + + +``` + +### .NET Framework +In legacy .NET framework projects, `RuntimeIdentifier` defaults to `win7-x86` which has the generic fallback to `win-x86`. Therefore, the above folder structure will automatically copy `lsl.dll` into the output folder of .NET Framework projects. + +```xml + + + + Exe + net472 + + + + + + + + +``` \ No newline at end of file