Skip to content

Commit

Permalink
Merge branch 'hotfix/0.17.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
matkoch committed Mar 4, 2019
2 parents a4dd964 + 81eb933 commit 60a0b91
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [vNext]

## [0.17.6] / 2019-03-04
- Fixed `RequirementService` to check for `ParameterAttribute` when injecting values interactively

## [0.17.5] / 2019-03-03
- Fixed `GlobDirectories` and `GlobFiles` to not collect items lazily

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

[vNext]: https://github.com/nuke-build/common/compare/0.17.5...HEAD
[vNext]: https://github.com/nuke-build/common/compare/0.17.6...HEAD
[0.17.6]: https://github.com/nuke-build/common/compare/0.17.5...0.17.6
[0.17.5]: https://github.com/nuke-build/common/compare/0.17.4...0.17.5
[0.17.4]: https://github.com/nuke-build/common/compare/0.17.3...0.17.4
[0.17.3]: https://github.com/nuke-build/common/compare/0.17.2...0.17.3
Expand Down
8 changes: 6 additions & 2 deletions source/Nuke.Common/Execution/RequirementService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static void ValidateRequirements(NukeBuild build)
{
if (requirement is Expression<Func<bool>> boolExpression)
ControlFlow.Assert(boolExpression.Compile().Invoke(), $"Target '{target.Name}' requires '{requirement.Body}'.");
else if (IsMemberNull(requirement.GetMemberInfo(), build))
else if (IsMemberNull(requirement.GetMemberInfo(), build, target))
ControlFlow.Fail($"Target '{target.Name}' requires member '{requirement.GetMemberInfo().Name}' to be not null.");
}

Expand All @@ -34,8 +34,12 @@ public static void ValidateRequirements(NukeBuild build)
}
}

private static bool IsMemberNull(MemberInfo member, NukeBuild build)
private static bool IsMemberNull(MemberInfo member, NukeBuild build, ExecutableTarget target = null)
{
var from = target != null ? $"from target '{target.Name}' " : string.Empty;
ControlFlow.Assert(member.HasCustomAttribute<ParameterAttribute>(),
$"Member '{member.Name}' is required {from}but not marked with a {nameof(ParameterAttribute)}.");

if (NukeBuild.Host == HostType.Console)
InjectValueInteractive(build, member);

Expand Down

0 comments on commit 60a0b91

Please sign in to comment.