-
Notifications
You must be signed in to change notification settings - Fork 527
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
Implementation for #913 Paket.pack: add support for nuget dependencies conditional on target framework #2428
Conversation
@forki Hi is it possible to review this one it's really a needed feature |
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.
This looks very good. Only couple of minor nitpicks.
@@ -83,23 +84,45 @@ module internal NupkgWriter = | |||
frameworkAssembliesList |> List.iter (buildFrameworkReferencesNode >> d.Add) | |||
metadataNode.Add d | |||
|
|||
let buildDependencyNode (Id, requirement:VersionRequirement) = | |||
let buildDependencyNode (id, requirement:VersionRequirement) = |
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.
Can you please rename this thing. id is a function from the FSharp.Core and I think we should avoid confusion. Maybe name or idProperty or something like that
|
||
|
||
let buildDependencyNodes (excludedDependencies, add, dependencyList) = | ||
let takeFirstOfThree (a,_,_) = a |
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.
That's a nice trick, but could you please manually inline this? I don't think we really need these functions here. Thx
|> List.iter (buildDependencyNode >> d.Add) | ||
metadataNode.Add d | ||
let groups = List.groupBy thirdOf3 dependencyList | ||
if groups.Length = 1 && fst groups.Head = None then |
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.
Could you please use pattern matching here?
let addDependency (templateFile : TemplateFile) (dependency : PackageName * VersionRequirement) = | ||
|
||
|
||
let addDependency (templateFile : TemplateFile) (dependency : PackageName * VersionRequirement * FrameworkIdentifier option) = | ||
match templateFile with | ||
| CompleteTemplate(core, opt) -> |
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.
Same here. Please get rid of firstOf3
static member ForNone = { Framework = None ; Dependencies = [] } | ||
static member ForFramework framework = { Framework = framework ; Dependencies = [] } | ||
|
||
let private getDependencieByLine (fileName, lockFile:LockFile,currentVersion:SemVerInfo option, specificVersions:Map<string, SemVerInfo>, line:string, framework:FrameworkIdentifier option)= |
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.
Small typo in function name
@@ -439,7 +439,6 @@ module FrameworkDetection = | |||
|
|||
open Logging | |||
/// parse a string to construct a Netframework, NetCore, NetStandard, or other dotnet identifier | |||
[<Obsolete "Use PlatformMatching.extractPlatforms instead">] |
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.
?
Hope the change are good for you, my first time with F# so I don't know all the good way to do. |
It's really great contribution. Thank you. Only thing left is a bit of
documentation. You can find md files in /docs (or so). Sorry I am on
mobile. If that's done we can release as 5.1 (cc @matthid)
Am 18.06.2017 2:50 nachm. schrieb "Benjamin Hugot" <[email protected]
…:
Hope the change are good for you, my first time with F# so I don't know
all the good way to do.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2428 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgNIVvpygm35vfQVsvQdNMo4HlakC5ks5sFR0bgaJpZM4N8RLE>
.
|
Added documentation. |
thanks a lot! released in 5.1 |
No problems it s helping my team too |
Obviously I'm a bit late but shouldn't we be able to calculate the correct groups from the framework restrictions ourself? All we would need is the list of frameworks the package contains binaries for. Rest could be figured out by paket itself. |
Hi, this is a proposal for #913
it's going to fix a bit of #2394 too
the template should be 'type file'
and the syntax is the following