Skip to content

Commit

Permalink
Merge branch 'hotfix/8.1.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
matkoch committed Nov 5, 2024
2 parents e782a00 + 79269f4 commit 45063fd
Show file tree
Hide file tree
Showing 17 changed files with 1,457 additions and 896 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [vNext]

## [8.1.3] / 2024-11-05
- Fixed naming from `NukeBuild.IsSucessful` to `IsSucceeding`
- Fixed `NukeBuild.IsSucceeding` to negate `IsFailing`
- Fixed NJsonSchema reference version
- Fixed `:secrets` command to find secret parameters
- Fixed argument format in `DotNetTasks`
- Fixed definite argument in `EntityFrameworkTasks`
- Fixed deprecated argument in `MinVerTasks`

## [8.1.2] / 2024-10-13
- Fixed exclusion of skipped target from lookup for skippable dependencies
- Fixed resolution of empty environment variables to false
Expand Down Expand Up @@ -1162,7 +1171,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/8.1.2...HEAD
[vNext]: https://github.com/nuke-build/nuke/compare/8.1.3...HEAD
[8.1.3]: https://github.com/nuke-build/nuke/compare/8.1.2...8.1.3
[8.1.2]: https://github.com/nuke-build/nuke/compare/8.1.1...8.1.2
[8.1.1]: https://github.com/nuke-build/nuke/compare/8.1.0...8.1.1
[8.1.0]: https://github.com/nuke-build/nuke/compare/8.0.0...8.1.0
Expand Down
37 changes: 19 additions & 18 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,24 @@
</PropertyGroup>

<ItemGroup>
<PackageVersion Include="Azure.Identity" Version="1.12.1" />
<PackageVersion Include="Azure.Security.KeyVault.Certificates" Version="4.6.0" />
<PackageVersion Include="Azure.Security.KeyVault.Keys" Version="4.6.0" />
<PackageVersion Include="Azure.Security.KeyVault.Secrets" Version="4.6.0" />
<PackageVersion Include="Basic.Reference.Assemblies.NetStandard20" Version="1.7.2" />
<PackageVersion Include="Azure.Identity" Version="1.13.1" />
<PackageVersion Include="Azure.Security.KeyVault.Certificates" Version="4.7.0" />
<PackageVersion Include="Azure.Security.KeyVault.Keys" Version="4.7.0" />
<PackageVersion Include="Azure.Security.KeyVault.Secrets" Version="4.7.0" />
<PackageVersion Include="Basic.Reference.Assemblies.NetStandard20" Version="1.7.9" />
<PackageVersion Include="Glob" Version="1.1.9" />
<PackageVersion Include="HtmlAgilityPack" Version="1.11.67" />
<PackageVersion Include="HtmlAgilityPack" Version="1.11.70" />
<PackageVersion Include="Humanizer" Version="2.14.1" />
<PackageVersion Include="JetBrains.Annotations" Version="2024.2.0" />
<PackageVersion Include="JetBrains.Annotations" Version="2024.3.0" />
<PackageVersion Include="Microsoft.ApplicationInsights" Version="2.22.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyModel" Version="8.0.2" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="NJsonSchema" Version="10.9.0" />
<PackageVersion Include="NJsonSchema" Version="11.0.2" />
<PackageVersion Include="NJsonSchema.NewtonsoftJson" Version="11.0.2" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="NuGet.Packaging" Version="6.11.1" />
<PackageVersion Include="Octokit" Version="13.0.1" />
<PackageVersion Include="Serilog" Version="4.0.2" />
<PackageVersion Include="Serilog" Version="4.1.0" />
<PackageVersion Include="Serilog.Formatting.Compact" Version="3.0.0" />
<PackageVersion Include="Serilog.Formatting.Compact.Reader" Version="4.0.0" />
<PackageVersion Include="Serilog.Sinks.Console" Version="6.0.0" />
Expand All @@ -37,24 +38,24 @@
<!-- Testing -->
<ItemGroup>
<PackageVersion Include="coverlet.msbuild" Version="6.0.2" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="FluentAssertions" Version="6.12.1" />
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageVersion Include="TeamCity.VSTest.TestAdapter" Version="1.0.40" />
<PackageVersion Include="TeamCity.VSTest.TestAdapter" Version="1.0.41" />
<PackageVersion Include="Verify.Xunit" Version="25.0.2" />
<PackageVersion Include="Verify.DiffPlex" Version="2.3.0" />
<PackageVersion Include="Verify.SourceGenerators" Version="2.2.0" />
<PackageVersion Include="xunit" Version="2.8.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.1" />
<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
</ItemGroup>

<!-- Roslyn (Nuke.SourceGenerator + Nuke.GlobalTool) -->
<ItemGroup>
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.10.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.10.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.10.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.11.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.11.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.11.0" />
</ItemGroup>

<!-- MSBuild (Nuke.ProjectModel + Nuke.MSBuildTasks) -->
Expand Down
22 changes: 16 additions & 6 deletions source/Nuke.Build.Shared/CompletionUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,21 @@ namespace Nuke.Common.Utilities;

public static class CompletionUtility
{
public static IReadOnlyDictionary<string, string[]> GetItemsFromSchema(AbsolutePath schemaFile, IEnumerable<string> profileNames)
public static IReadOnlyDictionary<string, string[]> GetItemsFromSchema(
AbsolutePath schemaFile,
IEnumerable<string> profileNames = null,
Func<JsonProperty, bool> filter = null)
{
var schema = JsonDocument.Parse(schemaFile.ReadAllText());
return GetItemsFromSchema(schema, profileNames);
return GetItemsFromSchema(schema, profileNames, filter);
}

public static IReadOnlyDictionary<string, string[]> GetItemsFromSchema(JsonDocument schema, IEnumerable<string> profileNames)
public static IReadOnlyDictionary<string, string[]> GetItemsFromSchema(
JsonDocument schema,
IEnumerable<string> profileNames = null,
Func<JsonProperty, bool> filter = null)
{
filter ??= _ => true;
var definitions = schema.RootElement.GetProperty("definitions").EnumerateObject().ToDictionary(x => x.Name, x => x);

var parameterProperties = schema.RootElement.GetProperty("definitions").TryGetProperty("NukeBuild", out var nukebuildProperty)
Expand All @@ -30,19 +37,22 @@ public static IReadOnlyDictionary<string, string[]> GetItemsFromSchema(JsonDocum
: definitions["build"].Value.GetProperty("properties").EnumerateObject();

return parameterProperties
.Where(filter)
.Select(x => (x.Name, Values: GetValues(x)))
.Where(x => x.Values != null)
.ToDictionary(x => x.Name, x => x.Values)
.SetKeyValue(Constants.LoadedLocalProfilesParameterName, profileNames.ToArray()).AsReadOnly();
.ToDictionary(x => x.Name, x => x.Values).AsReadOnly();

string[] GetValues(JsonProperty property)
{
if (property.Name == Constants.LoadedLocalProfilesParameterName)
return profileNames.ToArray();

if (property.Value.TryGetProperty("type", out var typeProperty))
{
var types = typeProperty.ValueKind != JsonValueKind.Array
? [typeProperty.GetString()]
: typeProperty.EnumerateArray().Select(x => x.GetString()).ToArray();
if (types.ContainsAnyOrdinalIgnoreCase(["string", "boolean", "integer"]))
if (types.ContainsAnyOrdinalIgnoreCase("string", "boolean", "integer"))
{
return property.Value.TryGetProperty("enum", out var enumProperty)
? enumProperty.EnumerateArray().Select(x => x.GetString()).ToArray()
Expand Down
2 changes: 1 addition & 1 deletion source/Nuke.Build/Execution/BuildManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static int Execute<T>(Expression<Func<T, Target>>[] defaultTargetExpressi
build,
ParameterService.GetParameter<string[]>(() => build.SkippedTargets));

return build.ExitCode ??= build.IsSuccessful ? 0 : ErrorExitCode;
return build.ExitCode ??= build.IsSucceeding ? 0 : ErrorExitCode;
}
catch (Exception exception)
{
Expand Down
2 changes: 1 addition & 1 deletion source/Nuke.Build/Host.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ static string GetInformation(ExecutableTarget target)
protected internal virtual void WriteBuildOutcome(INukeBuild build)
{
Debug();
if (build.IsSuccessful)
if (build.IsSucceeding)
Success($"Build succeeded on {DateTime.Now.ToString(CultureInfo.CurrentCulture)}. \(^ᴗ^)/");
else
Error($"Build failed on {DateTime.Now.ToString(CultureInfo.CurrentCulture)}. (╯°□°)╯︵ ┻━┻");
Expand Down
2 changes: 1 addition & 1 deletion source/Nuke.Build/INukeBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public interface INukeBuild
IReadOnlyCollection<ExecutableTarget> SucceededTargets { get; }
IReadOnlyCollection<ExecutableTarget> FinishedTargets { get; }

bool IsSuccessful { get; }
bool IsSucceeding { get; }
bool IsFailing { get; }
bool IsFinished { get; }
int? ExitCode { get; set; }
Expand Down
1 change: 1 addition & 0 deletions source/Nuke.Build/Nuke.Build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<PackageReference Include="Microsoft.ApplicationInsights" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" />
<PackageReference Include="NJsonSchema" />
<PackageReference Include="NJsonSchema.NewtonsoftJson" />
<PackageReference Include="Serilog.Formatting.Compact" />
<PackageReference Include="Serilog.Formatting.Compact.Reader" />
<PackageReference Include="Serilog.Sinks.Console" />
Expand Down
5 changes: 1 addition & 4 deletions source/Nuke.Build/NukeBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,7 @@ protected static int Execute<T>(params Expression<Func<T, Target>>[] defaultTarg
internal IEnumerable<string> TargetNames => ExecutableTargetFactory.GetTargetProperties(GetType()).Select(x => x.GetDisplayShortName());
internal IEnumerable<string> HostNames => Host.AvailableTypes.Select(x => x.Name);

public bool IsSuccessful => ExecutionPlan.All(x => x.Status is
ExecutionStatus.Succeeded or
ExecutionStatus.Skipped or
ExecutionStatus.Collective);
public bool IsSucceeding => !IsFailing;

public bool IsFailing => ExecutionPlan.Any(x => x.Status is
ExecutionStatus.Failed or
Expand Down
3 changes: 2 additions & 1 deletion source/Nuke.Build/Utilities/SchemaUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using Newtonsoft.Json.Serialization;
using NJsonSchema;
using NJsonSchema.Generation;
using NJsonSchema.NewtonsoftJson.Generation;
using NuGet.Packaging;
using Nuke.Common.Utilities;
using Nuke.Common.ValueInjection;
Expand All @@ -38,7 +39,7 @@ public static JsonSchema Generate<T>(T build) where T : INukeBuild
{
return new SchemaGenerator(
build,
new JsonSchemaGeneratorSettings
new NewtonsoftJsonSchemaGeneratorSettings
{
FlattenInheritanceHierarchy = true,
SerializerSettings =
Expand Down
Loading

0 comments on commit 45063fd

Please sign in to comment.