-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes for .NET Core #49
Conversation
b400412
to
875f128
Compare
Are you sure you're comfortable with that? I believe VS2017 still supports packages.config, even with the latest nuget version. And if the latest nuget version doesn't support it, you could add a MinClientVersion property to your nuspec file to help inform users. |
I'm not sure I'm following you. We know the LibGit2Sharp project will require VS 2017 once your PR lands, and it's consuming the native package via With this change in place, that means LibGit2Sharp gets the two text files embedded in both the The big difference/improvement here will be for people consuming LibGit2Sharp. If they pull the package into their project via packages.config, then that means they're doing something with .NET Framwork or mono, and the If the package is consumed via PackageReference instead, then they are either targeting .NET Core, or multi-targeting to .NET Framework also. In that case, because we're now opting into the transitive restore, that means the This means that for PackageReferences where the native binary package is referenced transitively via LibGit2Sharp, .NET Core will have access to the native libraries via the runtimes, and the .props file will copy them to a .NET Framework target. So, these changes aren't removing options for consumers of LibGit2Sharp, just improving things for all scenarios. |
I don't know that. The fact that we use PackageReference to build the package is an implementation detail. The nuspec is all that matters and that expresses the dependency the same way it did before. To be clear, ridding two embedded files that our consumers don't need is great. But I think we should take care to not break packages.config scenarios if we can avoid it since most of your current customers are on it. |
@AArnott I'm still not really following your point. I specifically tested these changes for both packages.config and PackageReference scenarios, and everything works exactly as it should. These changes should also even work for the old project.json tooling as well. |
OK, if you've tested and it works, that's fine. My concerns were that:
made it sound like you were cutting support for packages.config. And your more recent comment:
Just sounds wrong, because AFAIK we don't require VS 2017 when my PR lands. Why do you think it does? |
Ah, I see the confusion now! Your PR has moved the LibGit2Sharp project to the new SDK-style csproj format, which is not supported by earlier versions of Visual Studio, therefore we know it will be used with VS 2017. My statements about PackageReference and not packages.config are specifically referring to the LibGit2Sharp project itself, not consumers of LibGit2Sharp. Perhaps that would have been better phrased as "We know the LibGit2Sharp project will be consuming NuGet packages in a way that opts into the transitive restore process, so we know that it will use the That means we can put files into The .props file now only has stuff in it that is relevant to the |
Got it. Thanks for the clarification. |
@ethomson I'll get these conflicts resolved, and this should be ready to go now that 0.24.0 is out. |
Props file now only for net40
875f128
to
c9feb25
Compare
@ethomson This is rebased and ready to go now. |
This makes some changes to the native binaries packages to take advantage of the changes in libgit2/libgit2sharp#1318.
The embedded files that LibGit2Sharp itself needs are now embedded via
contentFiles
instead of being referenced in the .props file.The .props file is only ever needed for full .NET Framework and mono, so it's been scoped to
net40
only.The result of these changes is that when LibGit2Sharp references the package directly via
PackageReference
, it gets the files embedded as needed, but projects that consume LibGit2Sharp won't get those files embedded as well.This also means that projects targeting .NET Core/Standard won't get the
lib
folder needlessly copied into the output folder.@ethomson You mentioned wanting to do a LibGit2Sharp release before merging libgit2/libgit2sharp#1318, right? Were you thinking you'd need an updated native binaries package for that as well? If so, you should build that first before this PR gets merged, because these changes assume LibGit2Sharp will be consuming the package via
PackageReference
and notpackages.config
.CC: @AArnott