Skip to content

Commit 60a0b91

Browse files
committed
Merge branch 'hotfix/0.17.6'
2 parents a4dd964 + 81eb933 commit 60a0b91

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

CHANGELOG.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [vNext]
88

9+
## [0.17.6] / 2019-03-04
10+
- Fixed `RequirementService` to check for `ParameterAttribute` when injecting values interactively
11+
912
## [0.17.5] / 2019-03-03
1013
- Fixed `GlobDirectories` and `GlobFiles` to not collect items lazily
1114

@@ -324,7 +327,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
324327
- Added CLT tasks for Git
325328
- Fixed background color in console output
326329

327-
[vNext]: https://github.com/nuke-build/common/compare/0.17.5...HEAD
330+
[vNext]: https://github.com/nuke-build/common/compare/0.17.6...HEAD
331+
[0.17.6]: https://github.com/nuke-build/common/compare/0.17.5...0.17.6
328332
[0.17.5]: https://github.com/nuke-build/common/compare/0.17.4...0.17.5
329333
[0.17.4]: https://github.com/nuke-build/common/compare/0.17.3...0.17.4
330334
[0.17.3]: https://github.com/nuke-build/common/compare/0.17.2...0.17.3

source/Nuke.Common/Execution/RequirementService.cs

+6-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static void ValidateRequirements(NukeBuild build)
2222
{
2323
if (requirement is Expression<Func<bool>> boolExpression)
2424
ControlFlow.Assert(boolExpression.Compile().Invoke(), $"Target '{target.Name}' requires '{requirement.Body}'.");
25-
else if (IsMemberNull(requirement.GetMemberInfo(), build))
25+
else if (IsMemberNull(requirement.GetMemberInfo(), build, target))
2626
ControlFlow.Fail($"Target '{target.Name}' requires member '{requirement.GetMemberInfo().Name}' to be not null.");
2727
}
2828

@@ -34,8 +34,12 @@ public static void ValidateRequirements(NukeBuild build)
3434
}
3535
}
3636

37-
private static bool IsMemberNull(MemberInfo member, NukeBuild build)
37+
private static bool IsMemberNull(MemberInfo member, NukeBuild build, ExecutableTarget target = null)
3838
{
39+
var from = target != null ? $"from target '{target.Name}' " : string.Empty;
40+
ControlFlow.Assert(member.HasCustomAttribute<ParameterAttribute>(),
41+
$"Member '{member.Name}' is required {from}but not marked with a {nameof(ParameterAttribute)}.");
42+
3943
if (NukeBuild.Host == HostType.Console)
4044
InjectValueInteractive(build, member);
4145

0 commit comments

Comments
 (0)