Skip to content

Commit 42cfb32

Browse files
committed
Merge branch 'hotfix/0.19.2'
2 parents a7625fd + 5cb8c7b commit 42cfb32

9 files changed

+56
-69
lines changed

CHANGELOG.md

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

77
## [vNext]
88

9+
## [0.19.2] / 2019-05-10
10+
- Fixed `ProjectModelTasks` to use existing `MSBUILD_EXE_PATH` value
11+
- Fixed `ParameterService` to consider nullable enum types in value set calculation
12+
- Fixed compile errors in build template
13+
914
## [0.19.1] / 2019-05-03
1015
- Fixed `RequirementService` to check for `InjectionAttributeBase`
1116

@@ -352,7 +357,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
352357
- Added CLT tasks for Git
353358
- Fixed background color in console output
354359

355-
[vNext]: https://github.com/nuke-build/common/compare/0.19.1...HEAD
360+
[vNext]: https://github.com/nuke-build/common/compare/0.19.2...HEAD
361+
[0.19.2]: https://github.com/nuke-build/common/compare/0.19.1...0.19.2
356362
[0.19.1]: https://github.com/nuke-build/common/compare/0.19.0...0.19.1
357363
[0.19.0]: https://github.com/nuke-build/common/compare/0.18.0...0.19.0
358364
[0.18.0]: https://github.com/nuke-build/common/compare/0.17.7...0.18.0

source/Nuke.Common/Execution/ExecutableTarget.cs

+1-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Nuke.Common.Execution
1313
{
14-
[DebuggerDisplay("{" + nameof(ToDebugString) + "}")]
14+
[DebuggerDisplay("{" + nameof(Name) + "}")]
1515
public class ExecutableTarget
1616
{
1717
internal ExecutableTarget()
@@ -44,10 +44,5 @@ internal IReadOnlyCollection<ExecutableTarget> AllDependencies
4444
public TimeSpan Duration { get; internal set; }
4545
public bool Invoked { get; internal set; }
4646
public string SkipReason { get; internal set; }
47-
48-
internal string ToDebugString()
49-
{
50-
return Name;
51-
}
5247
}
5348
}

source/Nuke.Common/Execution/HandleHelpRequestAttribute.cs

-28
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Copyright 2019 Maintainers of NUKE.
2+
// Distributed under the MIT License.
3+
// https://github.com/nuke-build/nuke/blob/master/LICENSE
4+
5+
using System;
6+
using System.Collections.Generic;
7+
using System.Linq;
8+
9+
namespace Nuke.Common.Execution
10+
{
11+
[AttributeUsage(AttributeTargets.Class)]
12+
internal class HandleHelpRequestsAttribute : Attribute, IPostLogoBuildExtension
13+
{
14+
public void Execute(
15+
NukeBuild build,
16+
IReadOnlyCollection<ExecutableTarget> executableTargets,
17+
IReadOnlyCollection<ExecutableTarget> executionPlan)
18+
{
19+
if (NukeBuild.Help || executionPlan.Count == 0)
20+
{
21+
Logger.Normal(HelpTextService.GetTargetsText(build.ExecutableTargets));
22+
Logger.Normal(HelpTextService.GetParametersText(build));
23+
}
24+
25+
if (NukeBuild.Plan)
26+
ExecutionPlanHtmlService.ShowPlan(build.ExecutableTargets);
27+
28+
if (NukeBuild.Help || executionPlan.Count == 0 || NukeBuild.Plan)
29+
Environment.Exit(exitCode: 0);
30+
}
31+
}
32+
}

source/Nuke.Common/Execution/HandlePlanRequestAttribute.cs

-26
This file was deleted.

source/Nuke.Common/NukeBuild.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ namespace Nuke.Common
4545
/// </code>
4646
/// </example>
4747
[PublicAPI]
48-
[HandleHelpRequest]
49-
[HandlePlanRequest]
48+
[HandleHelpRequests]
5049
[HandleShellCompletion]
5150
[HandleVisualStudioDebugging]
5251
public abstract partial class NukeBuild

source/Nuke.Common/ParameterAttribute.cs

+9-2
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,18 @@ public override object GetValue(MemberInfo member, object instance)
7272
}
7373

7474
var memberType = member.GetMemberType();
75-
if (memberType.IsEnum)
76-
return memberType.GetEnumNames().Select(x => (x, Enum.Parse(memberType, x)));
75+
7776
if (memberType.IsSubclassOf(typeof(Enumeration)))
7877
return memberType.GetFields(ReflectionService.Static).Select(x => (x.Name, x.GetValue()));
7978

79+
var enumType = memberType.IsEnum
80+
? memberType
81+
: Nullable.GetUnderlyingType(memberType) is Type underlyingType && underlyingType.IsEnum
82+
? underlyingType
83+
: null;
84+
if (enumType != null)
85+
return enumType.GetEnumNames().Select(x => (x, Enum.Parse(enumType, x)));
86+
8087
return null;
8188
}
8289
}

source/Nuke.Common/ProjectModel/ProjectModelTasks.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ public static Microsoft.Build.Evaluation.Project ParseProject(
3939
string configuration = null,
4040
string targetFramework = null)
4141
{
42-
Environment.SetEnvironmentVariable("MSBUILD_EXE_PATH", s_msbuildPathResolver.Value);
42+
Environment.SetEnvironmentVariable("MSBUILD_EXE_PATH",
43+
Environment.GetEnvironmentVariable("MSBUILD_EXE_PATH") ??
44+
s_msbuildPathResolver.Value);
4345

4446
var projectCollection = new ProjectCollection();
4547
var msbuildProject = new Microsoft.Build.Evaluation.Project(

source/Nuke.GlobalTool/templates/Build.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System;
1+
using System;
22
using System.Linq;
33
using Nuke.Common;
44
using Nuke.Common.Execution;
@@ -132,8 +132,8 @@ class Build : NukeBuild
132132
.SetSymbolSource(SymbolSource) // NUGET
133133
.SetApiKey(ApiKey) // NUGET
134134
.CombineWith( // NUGET
135-
OutputDirectory.GlobFiles("*.nupkg"), (cs, v) => v) // NUGET && OUTPUT_DIR
136-
ArtifactsDirectory.GlobFiles("*.nupkg"), (cs, v) => v // NUGET && ARTIFACTS_DIR
135+
OutputDirectory.GlobFiles("*.nupkg"), (cs, v) => cs // NUGET && OUTPUT_DIR
136+
ArtifactsDirectory.GlobFiles("*.nupkg"), (cs, v) => cs // NUGET && ARTIFACTS_DIR
137137
.SetTargetPath(v)), // NUGET
138138
degreeOfParallelism: 5, // NUGET
139139
completeOnFailure: true); // NUGET

0 commit comments

Comments
 (0)