Description
The new NuGet v3/dotnet cli tooling now has built-in support for distributing native binaries.
It will automatically load relevant libraries without the need to do anything special, it's not even necessary anymore to have a build task to copy them around, everything just works.
This is used for example by the https://www.nuget.org/packages/Libuv/ package for Kestrel.
Making use of this is trivial: Just place the libraries in a special folder structure and NuGet automatically picks them up.
Currently, the binaries live here:
libgit2/linux/x86_64/libgit2-381caf5.so
libgit2/osx/libgit2-381caf5.dylib
libgit2/win32/x64/git2-381caf5.dll
libgit2/win32/x86/git2-381caf5.dll
All that needs to be done is to move them here:
runtimes/linux-x64/native/libgit2-381caf5.so
runtimes/osx/native/libgit2-381caf5.dylib
runtimes/win7-x64/native/git2-381caf5.dll
runtimes/win7-x86/native/git2-381caf5.dll
I tried to create a PR but couldn't quite figure out how all the build scripts etc. work and it seems hard to test without direct access to the build servers.
Therefore I repackaged the existing LibGit2Sharp.NativeBinaries package with the new folder structure: https://www.nuget.org/packages/LibGit2Sharp.NativeBinaries-dotnet/ as an example. I tested that package and it works nicely.
Do you think you could update the build scripts to output nuget v3 compatible packages? Should just be a matter of adjusting the paths and then updating the old-school build.props so existing users don't break.
Let me know if you need a hand, happy to help out.