-
Notifications
You must be signed in to change notification settings - Fork 587
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
Change NuGetPack call signature to avoid "kempejada" #554
Conversation
@files@ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder how this worked all the time since I really needed it to get the package creation working on Linux/Mono. The windows build didn't complain about it though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you omit the files section. NuGet just takes all files in the current structure. This is what we used for FAKE's own build. So I'm reverting this little change. Other builds use the explicit file section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I found your issue. The implicit version seems to bug on mono. Thanks nuget....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering why omitting it would work because I explicitly tested it with FAKEs own nuspec on mono and it didn't work out.
Change NuGetPack call signature to avoid "kempejada"
Now the build fails on Travis. Ideas? |
I'll have a look at the build, but seems it is related to files collection anyways: |
This set of changes streamline
NuGetHelper
functions, in particular the usage ofNuGetPack
towards the usage ofNuGet
. A rudimentary approach to intergration testing ofNugetHelper
is provided as well.Problem
Creating nuget packages is a fairly common task. FAKE provides nice helpers to do this, in particular the
NuGet
function, which sort of is a "all in" function to create and publish the package in one go. However, if one were to provide two separate targets for creating and publishing the package, theNuGet
function needs to be called twice. Obviously with thePublish
property being set tofalse
in first call andtrue
on the second call.Interestingly, FAKE NuGetHelpers provide two additional functions:
NuGetPack
andNuGetPush
. As the names already say it,NuGetPack
creates the package, whileNuGetPush
publishes it.Given the user would like to use
NuGetPack
andNuGetPush
for separate targets instead ofNuGet
, a specific API divergence bubbles up to the public surface:NuGet
expects a nuspec template to be passed and processes it by replacing theNugetParams
accordingly. In constrast,NuGetPack
has the same call signature asNuGet
, but expects a complete and valid nuspec file as opposed to a nuspec template file. This kempejada forces the user to useNuGet
twice instead of (intuitively) useNuGetPack
andNuGetPush
for separate targets.Note: This "API divergence" is called kempejada here (just out of fun).
Solution
NuGetPack
now performs the same package creation process asNuGet
does. For a minimum level of verification, an integration is provided. For the integration test some helper functions were needed for function conversion (CSharpHelper.fs
). I don't like that I've put them right into FakeLib, but I didn't knew a better place to tuck it in.This change preserves compatibility to any prior
NuGetPack
usage since a complete (non-templated) nuspec file is just processed and passed along to the pack function.Windows and Mono builds / tests pass. Please review thoroughly. Feedback and comments appreciated.