Skip to content
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

Consider adding developmentDependency to nuspec for Cake.Common #895

Closed
daveaglick opened this issue May 18, 2016 · 12 comments
Closed

Consider adding developmentDependency to nuspec for Cake.Common #895

daveaglick opened this issue May 18, 2016 · 12 comments
Milestone

Comments

@daveaglick
Copy link
Member

This flag was introduced in 2.8 for .nuspec files and indicates that the package is intended to support things like addons where you don't want to consuming package to take a dependency in it's own package. This seems appropriate for Cake.Common since it's primarily consumed by addins, which shouldn't actually take a NuGet dependency since that library will already be loaded by the engine and may cause conflicts if the addin takes a dependency and downloads a different version. The effect of this flag in the .nuspec is that NuGet will automatically add the developmentDependency flag to the packages.config of the consuming library.

@devlead
Copy link
Member

devlead commented May 18, 2016

Cool, sounds like a good idea to me 👍

@daveaglick
Copy link
Member Author

Great, I'll spin up a PR

@daveaglick
Copy link
Member Author

It turns out NuGetPackSettings doesn't have support for this flag either. I'll submit a separate PR to add it to the packing alias.

@patriksvensson
Copy link
Member

@daveaglick The dependencies for Cake.Common are specified in the nuspec directly and not via code.

@daveaglick
Copy link
Member Author

@patriksvensson Great - that'll make it super easy to add the flag for Cake.Common (in fact, incoming now...).

Should probably still add to NuGetPackSettings so that Cake users can take advantage of it when packing without a .nuspec from Cake.

@patriksvensson
Copy link
Member

@daveaglick Absolutely! Great initiative!

@gitfool
Copy link
Contributor

gitfool commented May 18, 2016

@daveaglick When doing this you should also specify minClientVersion="2.8":

<?xml version="1.0"?>
<package>
  <metadata minClientVersion="2.8">
    <developmentDependency>true</developmentDependency>
  </metadata>
</package>

@daveaglick
Copy link
Member Author

@gitfool Hmm - good point. That might be a problem though. Do we necessarily want to limit addin developers to having a NuGet client >= 2.8? Maybe that's reasonable, I'm not sure.

What would happen if an earlier version client found this unsupported element as a child of metadata? Does NuGet ignore elements it doesn't recognize or does it throw an error?

@gitfool
Copy link
Contributor

gitfool commented May 18, 2016

@daveaglick I can't answer those questions, sorry; not without testing it out for myself that is.

If requiring NuGet client 2.8 is acceptable, then you can simply add the attribute. FWIW, 2.8 came out in January 2014 (http://docs.nuget.org/release-notes/nuget-2.8).

@devlead @patriksvensson @gep13 thoughts?

@devlead
Copy link
Member

devlead commented May 19, 2016

@daveaglick @gitfool I'm ok with 2.8 requirement, the older versions aren't even downloadable anymore on nuget.org

@patriksvensson @gep13 do you agree?

@daveaglick
Copy link
Member Author

@gitfool Just submitted another PR to add it. I was going to go ahead and test the behavior of pre-2.8 clients, but as @devlead point out, you can't even download them anymore. Figured that was as good a signal as any that it was okay to exclude them. Especially since using Cake.Common via NuGet would typically be done by addin authors who presumably are using updated tools.

@gitfool
Copy link
Contributor

gitfool commented May 19, 2016

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants