[WIP] Resolve native library location from runtimes folder #1571
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggesti
2C31
ons cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the LibGit2Sharp side of the changes that libgit2/libgit2sharp.nativebinaries#68 enables, which means it won't build until an update package is available.
This builds on top of the changes introduced in #1563, allowing the default native library path to be resolved from the runtimes folder, for all target frameworks (including mono).
I've embedded the runtime.json information from https://github.com/dotnet/corefx/blob/master/pkg/Microsoft.NETCore.Platforms/runtime.json, and added the Microsoft.DotNet.PlatformAbstractions package to be able to get the runtime identifier.
This lets the correct native library to be chosen based on the runtime identifier, which maps back to the OS that the code is being run on.
One immediate benefit from this change is that when using LibGit2Sharp on .NET Core inside an MSBuild task, the correct native library should be chose automatically.
@tmat @AArnott I think this should really simplify the MSBuild task scenario while we're waiting for MSBuild to support this directly!