-
Notifications
You must be signed in to change notification settings - Fork 525
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Detect framework assembly references in nuspec template - closes #740
- Loading branch information
Showing
7 changed files
with
101 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,6 +66,18 @@ let nuspecDoc (info:CompleteInfo) = | |
| Some s -> addChildNode metadataNode nodeName s | ||
| None -> () | ||
|
||
let buildFrameworkReferencesNode libName = | ||
let element = XElement(ns + "frameworkAssembly") | ||
element.SetAttributeValue(XName.Get "assemblyName", libName) | ||
element.SetAttributeValue(XName.Get "targetFramework", "") | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
forki
Author
Member
|
||
element | ||
|
||
let buildFrameworkReferencesNode frameworkAssembliesList = | ||
if frameworkAssembliesList = [] then () else | ||
let d = XElement(ns + "frameworkAssemblies") | ||
frameworkAssembliesList |> List.iter (buildFrameworkReferencesNode >> d.Add) | ||
metadataNode.Add d | ||
|
||
let buildDependencyNode (Id, (VersionRequirement(range, _))) = | ||
let dep = XElement(ns + "dependency") | ||
dep.SetAttributeValue(XName.Get "id", Id) | ||
|
@@ -114,6 +126,7 @@ let nuspecDoc (info:CompleteInfo) = | |
!! "developmentDependency" "true" | ||
|
||
optional.References |> buildReferencesNode | ||
optional.FrameworkAssemblyReferences |> buildFrameworkReferencesNode | ||
optional.Dependencies |> buildDependenciesNode | ||
XDocument(declaration, box root) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I'm pretty sure this is invalid according to the nuspec reference. Either the
frameworkAssembly
contains atargetFramework
attribute (applies only to a specific set of target framework), or it doesn't have the attribute (applies to all target frameworks).