Class NuspecUtility
Until NuspecReader and Manifest are unified, this is a place to share implementations of reading and parsing specific elements out of the .nuspec XML.
public static class NuspecUtility
- Inheritance
-
NuspecUtility
- Inherited Members
Fields
FrameworkReference
public static readonly string FrameworkReference
Field Value
FrameworkReferences
public static readonly string FrameworkReferences
Field Value
Group
public static readonly string Group
Field Value
License
public static readonly string License
Field Value
Name
public static readonly string Name
Field Value
PackageType
public static readonly string PackageType
Field Value
PackageTypes
public static readonly string PackageTypes
Field Value
Repository
public static readonly string Repository
Field Value
RepositoryBranch
public static readonly string RepositoryBranch
Field Value
RepositoryCommit
public static readonly string RepositoryCommit
Field Value
RepositoryUrl
public static readonly string RepositoryUrl
Field Value
Serviceable
public static readonly string Serviceable
Field Value
TargetFramework
public static readonly string TargetFramework
Field Value
Type
public static readonly string Type
Field Value
Version
public static readonly string Version
Field Value
Methods
GetPackageTypes(XElement, bool)
Gets the package types from a .nuspec metadata XML element.
public static IReadOnlyList<PackageType> GetPackageTypes(XElement metadataNode, bool useMetadataNamespace)
Parameters
metadataNode
XElementThe metadata XML element.
useMetadataNamespace
boolWhether or not to use the metadata element's namespace when finding the package type nodes. If false is specified, only the local names of the package type nodes are used for comparison. If true is specified, the package type nodes must have the same namespace as the metadata node.
Returns
- IReadOnlyList<PackageType>
A list of package types. If no package types are found in the metadata node, an empty list is returned.
IsServiceable(XElement)
Gets the value of serviceable element from a .nuspec metadata XML element.
public static bool IsServiceable(XElement metadataNode)
Parameters
metadataNode
XElementThe metadata XML element.
Returns
- bool
true if the serviceable element is set in the .nuspec file as true, else false.