Skip to content

Commit

Permalink
Merge branch 'hotfix/0.24.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
matkoch committed Feb 15, 2020
2 parents 67358e7 + 8972204 commit f8de265
Show file tree
Hide file tree
Showing 51 changed files with 15,249 additions and 15,175 deletions.
9 changes: 9 additions & 0 deletions .idea/.idea.nuke-common/.idea/runConfigurations/CI__All_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .idea/.idea.nuke-common/.idea/runConfigurations/CI__AppVeyor_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions .idea/.idea.nuke-common/.idea/runConfigurations/CI__TeamCity_.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [vNext]

## [0.24.2] / 2020-02-15
- Fixed extension methods for settings with base type
- Fixed `SonarScannerTasks` to have `Framework` property
- Fixed generation of `shell-completion.yml` to exclude unlisted targets for invocation

## [0.24.1] / 2020-02-07
- Fixed `NuGetPackageResolver` to include dependencies during tool path resolution
- Fixed parsing of TeamCity environment variables
Expand Down Expand Up @@ -521,7 +526,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/nuke/compare/0.24.1...HEAD
[vNext]: https://github.com/nuke-build/nuke/compare/0.24.2...HEAD
[0.24.2]: https://github.com/nuke-build/nuke/compare/0.24.1...0.24.2
[0.24.1]: https://github.com/nuke-build/nuke/compare/0.24.0...0.24.1
[0.24.0]: https://github.com/nuke-build/nuke/compare/0.23.7...0.24.0
[0.23.7]: https://github.com/nuke-build/nuke/compare/0.23.6...0.23.7
Expand Down
23 changes: 21 additions & 2 deletions build/Build.GitFlow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,36 @@

using System.IO;
using System.Linq;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Nuke.Common;
using Nuke.Common.Git;
using Nuke.Common.Tooling;
using Nuke.Common.Tools.GitHub;
using Nuke.Common.Tools.GitVersion;
using static Nuke.Common.ChangeLog.ChangelogTasks;
using static Nuke.Common.ControlFlow;
using static Nuke.Common.Tools.Git.GitTasks;
using static Nuke.Common.Tools.GitVersion.GitVersionTasks;

partial class Build
{
[Parameter] readonly bool AutoStash = true;

Target Milestone => _ => _
.Unlisted()
.OnlyWhenStatic(() => GitRepository.IsOnReleaseBranch() || GitRepository.IsOnHotfixBranch())
.Executes(async () =>
{
var milestoneTitle = $"v{GitVersion.MajorMinorPatch}";
var milestone = (await GitRepository.GetGitHubMilestone(milestoneTitle)).NotNull("milestone != null");
Assert(milestone.OpenIssues == 0, "milestone.OpenIssues == 0");
Assert(milestone.ClosedIssues != 0, "milestone.ClosedIssues != 0");
});

Target Changelog => _ => _
.Unlisted()
.DependsOn(Milestone)
.OnlyWhenStatic(() => GitRepository.IsOnReleaseBranch() || GitRepository.IsOnHotfixBranch())
.Executes(() =>
{
Expand Down Expand Up @@ -48,6 +64,7 @@ partial class Build
.SetFramework("netcoreapp3.0")
.SetUrl(RootDirectory)
.SetBranch(MasterBranch)
.EnableNoFetch()
.DisableLogOutput()).Result;
if (!GitRepository.IsOnHotfixBranch())
Expand All @@ -72,12 +89,14 @@ void FinishReleaseOrHotfix()

void Checkout(string branch, string start)
{
if (AutoStash)
var hasCleanWorkingCopy = GitHasCleanWorkingCopy();

if (!hasCleanWorkingCopy && AutoStash)
Git("stash");

Git($"checkout -b {branch} {start}");

if (AutoStash)
if (!hasCleanWorkingCopy && AutoStash)
Git("stash apply");
}
}
10 changes: 8 additions & 2 deletions build/specifications/SonarScanner.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"name": "SonarScanner",
"officialUrl": "https://www.sonarqube.org/",
"help": "The SonarScanner for MSBuild is the recommended way to launch a SonarQube or SonarCloud analysis for projects/solutions using MSBuild or dotnet command as build tool.",
"packageId": "dotnet-sonarscanner|MSBuild.SonarQube.Runner.Tool",
"packageExecutable": "SonarScanner.MSBuild.dll|SonarScanner.MSBuild.exe",
"customExecutable": true,
"tasks": [
{
"postfix": "Begin",
Expand Down Expand Up @@ -209,5 +208,12 @@
]
}
}
],
"commonTaskProperties": [
{
"name": "Framework",
"type": "string",
"noArgument": true
}
]
}
2 changes: 1 addition & 1 deletion shell-completion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Skip:
- GenerateTools
- Hotfix
- Install
- Milestone
- Pack
- Publish
- References
Expand All @@ -47,7 +48,6 @@ Source:
Target:
- Analysis
- Announce
- Changelog
- CheckoutExternalRepositories
- Clean
- Compile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,10 @@ private static DataClassWriter WriteMethod(
params string[] modifications)
{
// NOTE: methods cannot be generic because constraints are not taken into account for overload resolution
var parameters = new[] { $"this {writer.DataClass.Name} toolSettings" }.Concat(additionalParameters);
var parameters = new[] { "this T toolSettings" }.Concat(additionalParameters);
return writer
.WriteLine("[Pure]")
.WriteLine($"public static {writer.DataClass.Name} {name}({parameters.JoinComma()})")
.WriteLine($"public static T {name}<T>({parameters.JoinComma()}) where T : {writer.DataClass.Name}")
.WriteBlock(w => w
.WriteLine("toolSettings = toolSettings.NewInstance();")
.ForEachWriteLine(modifications)
Expand Down
11 changes: 6 additions & 5 deletions source/Nuke.Common/Execution/HandleShellCompletionAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Collections.Generic;
using System.Linq;
using Nuke.Common.IO;
using static Nuke.Common.Constants;

namespace Nuke.Common.Execution
{
Expand All @@ -18,9 +19,9 @@ public void OnBeforeLogo(
{
var completionItems = new SortedDictionary<string, string[]>();

var targetNames = build.ExecutableTargets.Select(x => x.Name).OrderBy(x => x).ToList();
completionItems[Constants.InvokedTargetsParameterName] = targetNames.ToArray();
completionItems[Constants.SkippedTargetsParameterName] = targetNames.ToArray();
var targets = build.ExecutableTargets.OrderBy(x => x.Name).ToList();
completionItems[InvokedTargetsParameterName] = targets.Where(x => x.Listed).Select(x => x.Name).ToArray();
completionItems[SkippedTargetsParameterName] = targets.Select(x => x.Name).ToArray();

var parameters = InjectionUtility.GetParameterMembers(build.GetType(), includeUnlisted: false);
foreach (var parameter in parameters)
Expand All @@ -33,9 +34,9 @@ public void OnBeforeLogo(
completionItems[parameterName] = subItems?.ToArray();
}

SerializationTasks.YamlSerializeToFile(completionItems, Constants.GetCompletionFile(NukeBuild.RootDirectory));
SerializationTasks.YamlSerializeToFile(completionItems, GetCompletionFile(NukeBuild.RootDirectory));

if (EnvironmentInfo.GetParameter<bool>(Constants.CompletionParameterName))
if (EnvironmentInfo.GetParameter<bool>(CompletionParameterName))
Environment.Exit(exitCode: 0);
}
}
Expand Down
Loading

0 comments on commit f8de265

Please sign in to comment.