This content is part of a third party extension that is not supported by the Cake project.
For more information about this extension see Cake.Incubator.
Summary
Several extension methods when using XDocument.
- Assembly
- Cake
.Incubator .dll - Namespace
- Cake
.Incubator .XDocumentExtensions - Base Types
-
- Object
graph BT
Type-->Base0["Object"]
Type["XDocumentExtensions"]
class Type type-node
Syntax
public static class XDocumentExtensions
Methods
| Name | Value | Summary |
|---|---|---|
| Get |
ICollection |
Returns all <Reference> entries declared in the project, resolving HintPath
values relative to rootPath.
static
|
| Get |
ICollection |
Returns all <DotNetCliToolReference> entries declared in the project.
static
|
| GetFirstElementValue |
string |
gets the first matching element value, if a config is passed, it will only match an element with the specified config and platform condition.
the platform defaults to AnyCPU
static
|
| GetNuspecProps |
NameValueCollection |
Returns the project's nuspec-relevant property values (PackageId, Title, Authors,
Description, Copyright, etc.) keyed by element name.
static
|
| GetOutputPaths |
DirectoryPath[] |
Gets the first output path value for a specific config from an xml document
static
|
| GetPackageReferences |
ICollection |
Returns all <PackageReference> entries declared in the project, resolving
PrivateAssets / IncludeAssets / ExcludeAssets attributes or child elements and any
TargetFramework condition on the element or its parent ItemGroup.
static
|
| GetProjectReferences |
ICollection |
Returns all <ProjectReference> entries, resolving Include paths relative to
rootPath.
static
|
| GetSdk |
string |
Returns the SDK identifier from the project's root element, supporting both
the <Project Sdk="..."> attribute form and the <Project><Sdk Name="..." /></Project>
child-element form (per #267 — common in monorepos that hide reusable SDK
configuration in Directory.Build.props).
static
|
| GetTargets |
ICollection |
Returns all <Target> build targets declared in the project (with their
BeforeTargets / AfterTargets attributes and nested <Exec> commands).
static
|
| GetVersion |
string |
Returns the project version, combining VersionPrefix and VersionSuffix when both are
present, falling back to Version, and ultimately "1.0.0" when nothing is set.
static
|
| Get |
XName |
Combines an XNamespace with an element name into an XName, handling the case where
the namespace is null (pre-VS2017 csproj files use a default namespace; modern
SDK-style projects don't).
static
|
| IsDotNetSdk |
bool |
Checks if an xml document for the dot net sdk attribute
static
|
Extension Methods
| Name | Value | Summary |
|---|---|---|
| ToDictionary |
IDictionary |
From ObjectHelpers
Requires the Cake.DeployParams addin
|
| To |
string |
Returns the string value or a
Not set> markup suitable for Spectre.Console.
From StringExtensions
Requires the Cake.Issues addin
|
