Skip to content

Commit dd6e9a2

Browse files
committed
wip: xml-docs
1 parent c78563a commit dd6e9a2

19 files changed

+72
-132
lines changed

.nuke/build.schema.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
"description": "Shows the help text for this build assembly"
104104
},
105105
"Host": {
106-
"description": "Host for execution. Default is 'automatic'",
106+
"description": "Host for execution. Default is automatic",
107107
"$ref": "#/definitions/Host"
108108
},
109109
"NoLogo": {
@@ -120,7 +120,7 @@
120120
},
121121
"Profile": {
122122
"type": "array",
123-
"description": "Defines the profiles to load",
123+
"description": "Profiles (parameter files) to load",
124124
"items": {
125125
"type": "string"
126126
}
@@ -144,7 +144,7 @@
144144
}
145145
},
146146
"Verbosity": {
147-
"description": "Logging verbosity during build execution. Default is 'Normal'",
147+
"description": "Logging verbosity during build execution. Default is Normal",
148148
"$ref": "#/definitions/Verbosity"
149149
}
150150
}
@@ -180,8 +180,7 @@
180180
"default": "Secrets must be entered via 'nuke :secrets [profile]'"
181181
},
182182
"IgnoreFailedSources": {
183-
"type": "boolean",
184-
"description": "Ignore unreachable sources during Restore"
183+
"type": "boolean"
185184
},
186185
"Major": {
187186
"type": "boolean"

.teamcity/settings.kts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ project {
5050
checkbox (
5151
"env.IgnoreFailedSources",
5252
label = "IgnoreFailedSources",
53-
description = "Ignore unreachable sources during Restore",
5453
value = "False",
5554
checked = "True",
5655
unchecked = "False",
@@ -84,7 +83,7 @@ project {
8483
select (
8584
"env.Verbosity",
8685
label = "Verbosity",
87-
description = "Logging verbosity during build execution. Default is 'Normal'.",
86+
description = "Logging verbosity during build execution. Default is Normal",
8887
value = "Normal",
8988
options = listOf("Minimal" to "Minimal", "Normal" to "Normal", "Quiet" to "Quiet", "Verbose" to "Verbose"),
9089
display = ParameterDisplay.NORMAL)

source/Nuke.Build.Tests/DefaultInterfaceExecutionTest.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ namespace Nuke.Common.Tests.Execution;
1313

1414
public class DefaultInterfaceExecutionTest
1515
{
16-
public static string Description = "description";
1716
public static Action Action = () => { };
1817
public static Expression<Func<bool>> Requirement = () => true;
1918
public static Func<bool> StaticCondition = () => true;
@@ -33,7 +32,7 @@ public void Test()
3332

3433
targets.Single(x => x.IsDefault).Should().Be(e);
3534

36-
a.Description.Should().Be(Description);
35+
a.Description.Should().Be("Description");
3736
a.DelegateRequirements.Should().Equal(Requirement);
3837
a.Actions.Should().Equal(Action);
3938
a.AllDependencies.Should().BeEmpty();
@@ -189,14 +188,13 @@ private class OverriddenDuplicatedTargetTestBuild : NukeBuild, ITestBuild, IDupl
189188

190189
private interface ITestBuild
191190
{
192-
public string Description => DefaultInterfaceExecutionTest.Description;
193191
public Action Action => DefaultInterfaceExecutionTest.Action;
194192
public Expression<Func<bool>> Requirement => DefaultInterfaceExecutionTest.Requirement;
195193
public Func<bool> StaticCondition => DefaultInterfaceExecutionTest.StaticCondition;
196194
public Func<bool> DynamicCondition => DefaultInterfaceExecutionTest.DynamicCondition;
197195

196+
/// <summary>Description</summary>
198197
public Target A => _ => _
199-
.Description(Description)
200198
.Requires(Requirement)
201199
.Executes(Action);
202200

source/Nuke.Build.Tests/Nuke.Build.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net8.0</TargetFramework>
5+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
56
</PropertyGroup>
67

78
<ItemGroup>

source/Nuke.Build.Tests/SchemaUtilityTest.TestCustomParameterAttribute.verified.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"description": "Shows the help text for this build assembly"
3535
},
3636
"Host": {
37-
"description": "Host for execution. Default is 'automatic'",
37+
"description": "Host for execution. Default is automatic",
3838
"$ref": "#/definitions/Host"
3939
},
4040
"NoLogo": {
@@ -51,7 +51,7 @@
5151
},
5252
"Profile": {
5353
"type": "array",
54-
"description": "Defines the profiles to load",
54+
"description": "Profiles (parameter files) to load",
5555
"items": {
5656
"type": "string"
5757
}
@@ -75,7 +75,7 @@
7575
}
7676
},
7777
"Verbosity": {
78-
"description": "Logging verbosity during build execution. Default is 'Normal'",
78+
"description": "Logging verbosity during build execution. Default is Normal",
7979
"$ref": "#/definitions/Verbosity"
8080
}
8181
}

source/Nuke.Build.Tests/SchemaUtilityTest.TestEmptyBuild.verified.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
1+
{
22
"$schema": "http://json-schema.org/draft-04/schema#",
33
"definitions": {
44
"Host": {
@@ -34,7 +34,7 @@
3434
"description": "Shows the help text for this build assembly"
3535
},
3636
"Host": {
37-
"description": "Host for execution. Default is 'automatic'",
37+
"description": "Host for execution. Default is automatic",
3838
"$ref": "#/definitions/Host"
3939
},
4040
"NoLogo": {
@@ -51,7 +51,7 @@
5151
},
5252
"Profile": {
5353
"type": "array",
54-
"description": "Defines the profiles to load",
54+
"description": "Profiles (parameter files) to load",
5555
"items": {
5656
"type": "string"
5757
}
@@ -75,7 +75,7 @@
7575
}
7676
},
7777
"Verbosity": {
78-
"description": "Logging verbosity during build execution. Default is 'Normal'",
78+
"description": "Logging verbosity during build execution. Default is Normal",
7979
"$ref": "#/definitions/Verbosity"
8080
}
8181
}

source/Nuke.Build.Tests/SchemaUtilityTest.TestParameterBuild.verified.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"description": "Shows the help text for this build assembly"
8080
},
8181
"Host": {
82-
"description": "Host for execution. Default is 'automatic'",
82+
"description": "Host for execution. Default is automatic",
8383
"$ref": "#/definitions/Host"
8484
},
8585
"NoLogo": {
@@ -96,7 +96,7 @@
9696
},
9797
"Profile": {
9898
"type": "array",
99-
"description": "Defines the profiles to load",
99+
"description": "Profiles (parameter files) to load",
100100
"items": {
101101
"type": "string"
102102
}
@@ -120,7 +120,7 @@
120120
}
121121
},
122122
"Verbosity": {
123-
"description": "Logging verbosity during build execution. Default is 'Normal'",
123+
"description": "Logging verbosity during build execution. Default is Normal",
124124
"$ref": "#/definitions/Verbosity"
125125
}
126126
}

source/Nuke.Build.Tests/SchemaUtilityTest.TestTargetBuild.verified.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
1+
{
22
"$schema": "http://json-schema.org/draft-04/schema#",
33
"definitions": {
44
"Host": {
@@ -40,7 +40,7 @@
4040
"description": "Shows the help text for this build assembly"
4141
},
4242
"Host": {
43-
"description": "Host for execution. Default is 'automatic'",
43+
"description": "Host for execution. Default is automatic",
4444
"$ref": "#/definitions/Host"
4545
},
4646
"NoLogo": {
@@ -57,7 +57,7 @@
5757
},
5858
"Profile": {
5959
"type": "array",
60-
"description": "Defines the profiles to load",
60+
"description": "Profiles (parameter files) to load",
6161
"items": {
6262
"type": "string"
6363
}
@@ -81,7 +81,7 @@
8181
}
8282
},
8383
"Verbosity": {
84-
"description": "Logging verbosity during build execution. Default is 'Normal'",
84+
"description": "Logging verbosity during build execution. Default is Normal",
8585
"$ref": "#/definitions/Verbosity"
8686
}
8787
}

source/Nuke.Build/Execution/ExecutableTargetFactory.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using System.Linq;
88
using System.Linq.Expressions;
99
using System.Reflection;
10+
using Namotion.Reflection;
1011
using Nuke.Common.Utilities;
1112
using Nuke.Common.Utilities.Collections;
1213

@@ -44,7 +45,7 @@ ExecutableTarget Create(PropertyInfo property)
4445
Member = property,
4546
Definition = definition,
4647
Intercept = definition.Intercept,
47-
Description = definition.Description,
48+
Description = definition.Description ?? property.ToContextualProperty().PropertyInfo.GetXmlDocsSummary().ToNullIfEmpty(),
4849
Factory = factory,
4950
IsDefault = defaultTargets.Contains(factory),
5051
DynamicConditions = definition.DynamicConditions,

source/Nuke.Build/Execution/ParameterService.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using System.Linq.Expressions;
99
using System.Reflection;
1010
using JetBrains.Annotations;
11+
using Namotion.Reflection;
1112
using Nuke.Common.Tooling;
1213
using Nuke.Common.Utilities;
1314
using Serilog;
@@ -72,7 +73,7 @@ public static string GetParameterMemberName(MemberInfo member)
7273
public static string GetParameterDescription(MemberInfo member)
7374
{
7475
var attribute = member.GetCustomAttribute<ParameterAttribute>().NotNull();
75-
return attribute.Description?.TrimEnd('.');
76+
return (attribute.Description ?? member.ToContextualAccessor().GetXmlDocsSummary()).ToNullIfEmpty()?.TrimEnd(".");
7677
}
7778

7879
[CanBeNull]

0 commit comments

Comments
 (0)