Skip to content

Commit

Permalink
Merge branch 'hotfix/0.24.10'
Browse files Browse the repository at this point in the history
  • Loading branch information
matkoch committed Apr 23, 2020
2 parents 9c52572 + c51180e commit 8e2b11b
Show file tree
Hide file tree
Showing 66 changed files with 151 additions and 263 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [vNext]

## [0.24.10] / 2020-04-24
- Fixed MSBuild targets to switch on `MSBuildRuntimeType` again
- Fixed default includes for `NukeSpecificationFiles` and `NukeExternalFiles`
- Fixed indentation for GitHubActions scheduled triggers
- Fixed assertion message for GitHubActions trigger definitions
- Fixed default `RootNamespace`

## [0.24.9] / 2020-04-16
- Fixed MSBuild targets directories

Expand Down Expand Up @@ -571,7 +578,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.9...HEAD
[vNext]: https://github.com/nuke-build/nuke/compare/0.24.10...HEAD
[0.24.10]: https://github.com/nuke-build/nuke/compare/0.24.9...0.24.10
[0.24.9]: https://github.com/nuke-build/nuke/compare/0.24.8...0.24.9
[0.24.8]: https://github.com/nuke-build/nuke/compare/0.24.7...0.24.8
[0.24.7]: https://github.com/nuke-build/nuke/compare/0.24.6...0.24.7
Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<!-- Thanks to Thomas Frenzel (https://github.com/dotnet/sdk/issues/1151#issuecomment-385133284) -->
<PropertyGroup>
<ReplacePackageReferences Condition="$(ReplacePackageReferences) == ''">false</ReplacePackageReferences>
<ReplacePackageReferences Condition="$(ReplacePackageReferences) == ''">true</ReplacePackageReferences>
<SolutionPath>$(MSBuildThisFileDirectory)\nuke.sln</SolutionPath>
</PropertyGroup>

Expand Down Expand Up @@ -38,4 +38,4 @@
</When>
</Choose>

</Project>
</Project>
3 changes: 1 addition & 2 deletions build/Build.CodeGeneration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
using static Nuke.CodeGeneration.ReferenceUpdater;
using static Nuke.CodeGeneration.SchemaGenerator;
using static Nuke.Common.IO.FileSystemTasks;
using static Nuke.Common.IO.PathConstruction;
using static Nuke.Common.Tools.Git.GitTasks;

partial class Build
Expand Down Expand Up @@ -39,7 +38,7 @@ partial class Build
GitRepository.GetGitHubDownloadUrl(ToolSchemaFile, MasterBranch),
"Tool specification schema file by NUKE");
GenerateCode(
GenerateCodeFromDirectory(
SpecificationsDirectory,
outputFileProvider: x => GenerationDirectory / x.Name / x.DefaultOutputFileName,
namespaceProvider: x => $"Nuke.Common.Tools.{x.Name}",
Expand Down
1 change: 0 additions & 1 deletion build/Build.GitFlow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

using System.IO;
using System.Linq;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Nuke.Common;
using Nuke.Common.Git;
Expand Down
5 changes: 2 additions & 3 deletions build/Build.GlobalSolution.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
using Nuke.Common.IO;
using Nuke.Common.ProjectModel;
using Nuke.Common.Tools.GitHub;
using Nuke.Common.Utilities.Collections;
using static Nuke.Common.ControlFlow;
using static Nuke.Common.IO.FileSystemTasks;
using static Nuke.Common.IO.PathConstruction;
using static Nuke.Common.IO.SerializationTasks;
using static Nuke.Common.ProjectModel.ProjectModelTasks;
using static Nuke.Common.Tools.Git.GitTasks;
Expand Down Expand Up @@ -56,9 +54,10 @@ partial class Build
.Executes(() =>
{
var global = CreateSolution(
GlobalSolution,
solutions: new[] { Solution }.Concat(ExternalSolutions),
folderNameProvider: x => x == Solution ? null : x.Name);
global.SaveAs(GlobalSolution);
global.Save();
if (File.Exists(RootDirectory / $"{Solution.FileName}.DotSettings"))
{
Expand Down
1 change: 0 additions & 1 deletion build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

<!-- Test properties for MSBuild integration -->
<NukeMSBuildIntegration Condition="'$(NukeMSBuildIntegration)' == ''">False</NukeMSBuildIntegration>
<NukeDefaultIncludes>False</NukeDefaultIncludes>
<!-- <PackAsTool>True</PackAsTool>-->
<!-- <ToolCommandName>build</ToolCommandName>-->
</PropertyGroup>
Expand Down
2 changes: 2 additions & 0 deletions build/_build.csproj.DotSettings
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=HeapView_002EDelegateAllocation/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=VariableHidesOuterVariable/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ClassNeverInstantiated_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=MemberCanBeMadeStatic_002ELocal/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/DEFAULT_INTERNAL_MODIFIER/@EntryValue">Implicit</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/DEFAULT_PRIVATE_MODIFIER/@EntryValue">Implicit</s:String>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/METHOD_OR_OPERATOR_BODY/@EntryValue">ExpressionBody</s:String>
Expand Down
6 changes: 3 additions & 3 deletions build/specifications/VSWhere.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/nuke-build/nuke/master/source/Nuke.CodeGeneration/schema.json",
"references": [
"https://raw.githubusercontent.com/Microsoft/vswhere/develop/README.md"
"https://github.com/microsoft/vswhere/blob/master/src/vswhere.lib/vswhere.lib.rc"
],
"name": "VSWhere",
"officialUrl": "https://github.com/Microsoft/vswhere",
Expand All @@ -23,7 +23,7 @@
"name": "Format",
"type": "VSWhereFormat",
"format": "-format {value}",
"help": "A version range for instances to find. Example: <c>[15.0,16.0)</c> will find versions <em>15.*</em>."
"help": "Return information about instances found in a format described below:<ul><li><c>text</c>: Colon-delimited properties in separate blocks for each instance (default).</li><li><c>json</c>: An array of JSON objects for each instance (no logo).</li><li><c>value</c>: A single property specified by the -property parameter (no logo).</li><li><c>xml</c>: An XML data set containing instances (no logo).</li></ul>"
},
{
"name": "NoLogo",
Expand Down Expand Up @@ -254,4 +254,4 @@
]
}
]
}
}
3 changes: 1 addition & 2 deletions source/Nuke.CodeGeneration/CodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// https://github.com/nuke-build/nuke/blob/master/LICENSE

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using JetBrains.Annotations;
Expand Down Expand Up @@ -62,7 +61,7 @@ public static void GenerateCode(Tool tool, string outputFile)
Logger.Info($"Generated code for {tool.Name} from {Path.GetFileName(tool.SpecificationFile) ?? "<in-memory>"}.");
}

// ReSharper disable once CyclomaticComplexity
// ReSharper disable once CognitiveComplexity
private static void ApplyRuntimeInformation(
Tool tool,
string specificationFile,
Expand Down
5 changes: 0 additions & 5 deletions source/Nuke.CodeGeneration/Generators/DataClassGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,6 @@ private static string GetPublicPropertyType(Property property)
return property.GetNullableType();
}

private static string AssertionWithValue(string assertion, string propertyName)
{
return $"{assertion} [{propertyName} = {{{propertyName}}}]".DoubleQuoteInterpolated();
}

private static DataClassWriter WriteConfigureArguments(this DataClassWriter writer)
{
var formatProperties = writer.DataClass.Properties.Where(x => x.Format != null).ToList();
Expand Down
4 changes: 1 addition & 3 deletions source/Nuke.CodeGeneration/Generators/WriterExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ string GetArgument(Property property)
var argument = valueIndex == -1
? property.Format
: valueIndex != 0
? property.Format.Substring(0, valueIndex).TrimEnd(':', '=', ' ')
? property.Format.Substring(startIndex: 0, valueIndex).TrimEnd(':', '=', ' ')
: $"&lt;{property.Name.ToInstance()}&gt;";
if (!argument.Any(char.IsLetter))
Logger.Warn($"Format for property {property.Name} in {property.DataClass.Tool.Name} is all non-letters.");
Expand All @@ -82,9 +82,7 @@ string GetArgument(Property property)
.OrderBy(x => !x.Argument.StartsWith("&lt;"))
.ThenBy(x => x.Argument);
foreach (var pair in propertiesWithArgument)
{
yield return $" <li><c>{pair.Argument}</c> via {pair.Property.ToSeeCref()}</li>";
}

yield return "</ul>";
}
Expand Down
1 change: 1 addition & 0 deletions source/Nuke.CodeGeneration/ToolSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public static void Save(Tool tool, string file)

private class CustomContractResolver : CamelCasePropertyNamesContractResolver
{
// ReSharper disable once CognitiveComplexity
protected override JsonProperty CreateProperty([NotNull] MemberInfo member, MemberSerialization memberSerialization)
{
var property = base.CreateProperty(member, memberSerialization);
Expand Down
17 changes: 0 additions & 17 deletions source/Nuke.Common.Tests/CITest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,6 @@ private static void AssertProperty(object instance, PropertyInfo property)
Guid.TryParse(strValue, out _).Should().BeFalse("Guid");
}

private static T CreateInstance<T>()
{
return (T) CreateInstance(typeof(T));
}

private static object CreateInstance(Type type)
{
var bindingFlags = BindingFlags.CreateInstance | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.OptionalParamBinding;
Expand All @@ -141,17 +136,5 @@ public CITheoryAttribute(Type type)

public override string Skip => !IsRunning(_type) ? $"Only applies to {_type.Name}." : null;
}

private class BuildServerFactAttribute : FactAttribute
{
private readonly Type _type;

public BuildServerFactAttribute(Type type)
{
_type = type;
}

public override string Skip => !IsRunning(_type) ? $"Only applies to {_type.Name}." : null;
}
}
}
12 changes: 1 addition & 11 deletions source/Nuke.Common.Tests/Execution/BuildExecutorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void TestDynamicCondition()

private void ExecuteBuild(ExecutableTarget[] skippedTargets = null)
{
string[] SelectNames(ExecutableTarget[] targets) => targets?.Select(x => x.Name).ToArray();
static string[] SelectNames(ExecutableTarget[] targets) => targets?.Select(x => x.Name).ToArray();

var build = new TestBuild();
build.ExecutableTargets = new[] { A, B, C };
Expand All @@ -115,16 +115,6 @@ private static void AssertSkipped(params ExecutableTarget[] targets)
targets.ForEach(x => x.Status.Should().Be(ExecutionStatus.Skipped));
}

private static void AssertUnscheduled(params ExecutableTarget[] targets)
{
targets.ForEach(x => x.Status.Should().BeNull());
}

private static void AssertNotRun(params ExecutableTarget[] targets)
{
targets.ForEach(x => x.Status.Should().Be(ExecutionStatus.NotRun));
}

private class TestBuild : NukeBuild
{
}
Expand Down
2 changes: 1 addition & 1 deletion source/Nuke.Common.Tests/Execution/ExecutionPlannerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public void TestMixedDependencies()

private IEnumerable<ExecutableTarget> GetPlan(ExecutableTarget[] invokedTargets = null)
{
string[] SelectNames(ExecutableTarget[] targets) => targets?.Select(x => x.Name).ToArray();
static string[] SelectNames(ExecutableTarget[] targets) => targets?.Select(x => x.Name).ToArray();

return ExecutionPlanner.GetExecutionPlan(new[] { A, B, C }, SelectNames(invokedTargets));
}
Expand Down
1 change: 0 additions & 1 deletion source/Nuke.Common.Tests/ProjectModelTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using Nuke.Common.IO;
using Nuke.Common.ProjectModel;
using Xunit;
using static Nuke.Common.IO.PathConstruction;

namespace Nuke.Common.Tests
{
Expand Down
2 changes: 1 addition & 1 deletion source/Nuke.Common.Tests/SerializationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static IEnumerable<object[]> Serializers
[UsedImplicitly]
get
{
object[] GetSerialization(string name, Func<Data, Data> serialization) => new object[] { name, serialization };
static object[] GetSerialization(string name, Func<Data, Data> serialization) => new object[] { name, serialization };

yield return GetSerialization("Json", x => SerializationTasks.JsonDeserialize<Data>(SerializationTasks.JsonSerialize(x)));
yield return GetSerialization("Yaml", x => SerializationTasks.YamlDeserialize<Data>(SerializationTasks.YamlSerialize(x)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@ public class GitHubActionsScheduledTrigger : GitHubActionsDetailedTrigger

public override void Write(CustomFileWriter writer)
{
writer.WriteLine("schedule:");
using (writer.Indent())
{
writer.WriteLine("schedule:");
using (writer.Indent())
{
writer.WriteLine($" - cron: '{Cron}'");
}
writer.WriteLine($"- cron: '{Cron}'");
}
}
}
Expand Down
7 changes: 3 additions & 4 deletions source/Nuke.Common/CI/GitHubActions/GitHubActionsAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
using Nuke.Common.Tooling;
using Nuke.Common.Utilities;
using Nuke.Common.Utilities.Collections;
using static Nuke.Common.IO.PathConstruction;

namespace Nuke.Common.CI.GitHubActions
{
Expand Down Expand Up @@ -75,8 +74,8 @@ public override CustomFileWriter CreateWriter()
DetailedTriggers = GetTriggers().ToArray(),
Jobs = _images.Select(x => GetJobs(x, relevantTargets)).ToArray()
};
ControlFlow.Assert(configuration.ShortTriggers == null || configuration.DetailedTriggers.Length == 0,
"configuration.ShortTriggers == null || configuration.DetailedTriggers.Length == 0");
ControlFlow.Assert(configuration.ShortTriggers.Length == 0 || configuration.DetailedTriggers.Length == 0,
"configuration.ShortTriggers.Length == 0 || configuration.DetailedTriggers.Length == 0");

return configuration;
}
Expand Down Expand Up @@ -122,7 +121,7 @@ private IEnumerable<GitHubActionsStep> GetSteps(GitHubActionsImage image, IReadO

protected virtual IEnumerable<(string key, string value)> GetImports()
{
string GetSecretValue(string secret) => $"${{{{ secrets.{secret} }}}}";
static string GetSecretValue(string secret) => $"${{{{ secrets.{secret} }}}}";

if (ImportGitHubTokenAs != null)
yield return (ImportGitHubTokenAs, GetSecretValue("GITHUB_TOKEN"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class TeamCitySnapshotDependency : TeamCityDependency

public override void Write(CustomFileWriter writer)
{
string FormatAction(TeamCityDependencyFailureAction action)
static string FormatAction(TeamCityDependencyFailureAction action)
=> "FailureAction." +
action.ToString().SplitCamelHumpsWithSeparator("_").ToUpperInvariant();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

using System;
using System.Linq;
using Microsoft.Azure.KeyVault.Models;
using Nuke.Common.Utilities;

namespace Nuke.Common.CI.TeamCity.Configuration
Expand Down
1 change: 0 additions & 1 deletion source/Nuke.Common/CI/TeamCity/TeamCityAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using JetBrains.Annotations;
using Nuke.Common.CI.TeamCity.Configuration;
using Nuke.Common.Execution;
using Nuke.Common.Git;
using Nuke.Common.IO;
using Nuke.Common.ProjectModel;
using Nuke.Common.Tooling;
Expand Down
6 changes: 3 additions & 3 deletions source/Nuke.Common/ChangeLog/ChangeLogTasks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,13 @@ public static IEnumerable<string> ExtractChangelogSectionNotes(string changelogF

private static IEnumerable<ReleaseSection> GetReleaseSections(List<string> content)
{
bool IsReleaseHead(string str)
static bool IsReleaseHead(string str)
=> str.StartsWith("## ");

bool IsReleaseContent(string str)
static bool IsReleaseContent(string str)
=> str.StartsWith("###") || str.Trim().StartsWith("-");

string GetCaption(string str)
static string GetCaption(string str)
=> str
.TrimStart('#', ' ', '[')
.Split(' ')
Expand Down

0 comments on commit 8e2b11b

Please sign in to comment.