Skip to content

Commit

Permalink
Merge branch 'release/6.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
matkoch committed Aug 18, 2022
2 parents 12a091b + 3f3617a commit fa8aae5
Show file tree
Hide file tree
Showing 72 changed files with 1,390 additions and 9,470 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ jobs:
with:
name: packages
path: output/packages
macOS-latest:
name: macOS-latest
runs-on: macOS-latest
macos-latest:
name: macos-latest
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
Expand Down
35 changes: 0 additions & 35 deletions .github/workflows/website.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
"ReportDuplicates",
"ReportIssues",
"Restore",
"RunTargetInDockerImageTest",
"SignPackages",
"Test",
"UpdateContributors",
Expand Down Expand Up @@ -182,6 +183,7 @@
"ReportDuplicates",
"ReportIssues",
"Restore",
"RunTargetInDockerImageTest",
"SignPackages",
"Test",
"UpdateContributors",
Expand Down
24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,26 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [vNext]

## [6.2.0] / 2022-08-19
- Added support for intercepted targets
- Added target interception for Docker
- Added support for context components
- Added `DisableDefaultOutputAttribute`
- Added `InstallNpmToolsAttribute` and `NpmExecutableAttribute`
- Added `EnvironmentInfo.IsArm64`
- Added `SetProcessExecutionTimeout` overload for `TimeSpan`
- Added `DotNetRuntimeIdentifiers`
- Fixed telemetry
- Fixed `GetPathExecutable` to manually search `PATH` environment variable if locator executable is not available
- Fixed resolution of surrogate arguments in Visual Studio
- Fixed performance of `NuGetPackageResolver`
- Fixed `GitTasks.GitIsDetached`
- Fixed missing members in `GitHubActionsImage`
- Fixed missing members in `AzurePipelinesRepositoryType`
- Fixed detection for Bamboo
- Fixed missing arguments in `KubernetesTasks`
- Fixed missing arguments in `DockerTasks`

## [6.1.2] / 2022-07-02
- Removed `Newtonsoft.Json.Schema` dependency
- Fixed `Nuke.GlobalTool` to target `net6.0`
Expand Down Expand Up @@ -948,7 +968,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/6.1.2...HEAD
[vNext]: https://github.com/nuke-build/nuke/compare/6.2.0...HEAD
[6.2.0]: https://github.com/nuke-build/nuke/compare/6.1.2...6.2.0
[6.1.2]: https://github.com/nuke-build/nuke/compare/6.1.1...6.1.2
[6.1.1]: https://github.com/nuke-build/nuke/compare/6.1.0...6.1.1
[6.1.0]: https://github.com/nuke-build/nuke/compare/6.0.3...6.1.0
Expand Down Expand Up @@ -1039,3 +1060,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
[0.3.1]: https://github.com/nuke-build/nuke/compare/0.2.10...0.3.1
[0.2.10]: https://github.com/nuke-build/nuke/compare/0.2.0...0.2.10
[0.2.0]: https://github.com/nuke-build/nuke/tree/0.2.0

32 changes: 32 additions & 0 deletions build/Build.RunTargetInDockerTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright 2021 Maintainers of NUKE.
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE

using System;
using JetBrains.Annotations;
using Nuke.Common;
using Nuke.Common.Tooling;
using Nuke.Common.Tools.Docker;
using Serilog;

partial class Build
{
[UsedImplicitly]
Target RunTargetInDockerImageTest => _ => _
.DockerRun(_ => _
.EnableBuildCaching()
.SetImage("mcr.microsoft.com/dotnet/sdk:6.0")
.When(EnvironmentInfo.IsArm64, _ => _
.SetPlatform("linux/arm64")
.SetDotNetRuntime("linux-arm64"))
.When(EnvironmentInfo.IsWin, _ => _
.SetPlatform("windows/amd64")
.SetDotNetRuntime("win-x64"))
.When(EnvironmentInfo.IsLinux, _ => _
.SetPlatform("linux/amd64")
.SetDotNetRuntime("linux-x64")))
.Executes(() =>
{
Log.Information("Hello, the computer name is {Name}", Environment.MachineName);
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ on:
- cron: '* 0 * * *'

jobs:
macOS-latest:
name: macOS-latest
runs-on: macOS-latest
macos-latest:
name: macos-latest
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ name: test
on: [push, pull_request]

jobs:
macOS-latest:
name: macOS-latest
runs-on: macOS-latest
macos-latest:
name: macos-latest
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Cache .nuke/temp, ~/.nuget/packages
Expand Down
2 changes: 1 addition & 1 deletion source/Nuke.Common.Tests/SettingsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void TestCommon()
var settings = new DotNetRunSettings()
.SetProcessToolPath("/path/to/dotnet")
.SetProcessEnvironmentVariable("key", "value")
.SetProcessExecutionTimeout(1_000)
.SetProcessExecutionTimeout(TimeSpan.FromMilliseconds(1_000))
.SetProcessArgumentConfigurator(_ => _
.Add("/switch"))
.EnableProcessLogInvocation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public enum AzurePipelinesRepositoryType
/// <summary>
/// Subversion.
/// </summary>
Svn
Svn,

TfsGit
}
}
2 changes: 1 addition & 1 deletion source/Nuke.Common/CI/Bamboo/Bamboo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class Bamboo : Host, IBuildServer
{
public new static Bamboo Instance => Host.Instance as Bamboo;

internal static bool IsRunningBamboo => !Environment.GetEnvironmentVariable("BAMBOO_SERVER").IsNullOrEmpty();
internal static bool IsRunningBamboo => !Environment.GetEnvironmentVariable("bamboo_planKey").IsNullOrEmpty();

internal Bamboo()
{
Expand Down
15 changes: 7 additions & 8 deletions source/Nuke.Common/CI/GitHubActions/GitHubActionsImage.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Maintainers of NUKE.
// Copyright 2021 Maintainers of NUKE.
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE

Expand All @@ -10,22 +10,21 @@
namespace Nuke.Common.CI.GitHubActions
{
/// <summary>
/// See <a href="https://help.github.com/en/articles/virtual-environments-for-github-actions#about-virtual-environments">Virtual environments for GitHub Actions</a>
/// See <a href="https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners">Virtual environments for GitHub Actions</a>
/// </summary>
[PublicAPI]
public enum GitHubActionsImage
{
[EnumValue("windows-2022")] WindowsServer2022,
[EnumValue("windows-2019")] WindowsServer2019,
[EnumValue("windows-2016")] WindowsServer2016R2,
[EnumValue("ubuntu-22.04")] Ubuntu2204,
[EnumValue("ubuntu-20.04")] Ubuntu2004,
[EnumValue("ubuntu-18.04")] Ubuntu1804,
[EnumValue("ubuntu-16.04")] Ubuntu1604,
[EnumValue("macOS-11")] MacOs11,
[EnumValue("macOS-10.15")] MacOs1015,
[EnumValue("macOS-10.14")] MacOs1014,
[EnumValue("macos-12")] MacOs12,
[EnumValue("macos-11")] MacOs11,
[EnumValue("macos-10.15")] MacOs1015,
[EnumValue("windows-latest")] WindowsLatest,
[EnumValue("ubuntu-latest")] UbuntuLatest,
[EnumValue("macOS-latest")] MacOsLatest
[EnumValue("macos-latest")] MacOsLatest
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class InvokeBuildServerConfigurationGenerationAttribute
{
public void OnBuildCreated(NukeBuild build, IReadOnlyCollection<ExecutableTarget> executableTargets)
{
if (NukeBuild.IsServerBuild)
if (NukeBuild.IsServerBuild || NukeBuild.IsInterceptorExecution)
return;

var hasConfigurationChanged = GetGenerators(build)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ public class ShutdownDotNetAfterServerBuildAttribute : BuildExtensionAttributeBa

public void OnBuildFinished(NukeBuild build)
{
if (NukeBuild.IsServerBuild)
if (NukeBuild.IsServerBuild &&
// NOTE: this should only be necessary if the interceptor build has no .NET CLI installed
!NukeBuild.IsInterceptorExecution)
DotNetTasks.DotNet("build-server shutdown", logInvocation: EnableLogging, logOutput: EnableLogging, timeout: 15_000);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE

using Nuke.Common.Execution;

namespace Nuke.Common.CI.SpaceAutomation
{
public partial class SpaceAutomation
{
internal override string OutputTemplate => "[{Level:u3}] {Message:l}{NewLine}{Exception}";
internal override string OutputTemplate => Logging.StandardOutputTemplate;
}
}
3 changes: 2 additions & 1 deletion source/Nuke.Common/CI/TeamCity/TeamCity.Theming.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// https://github.com/nuke-build/nuke/blob/master/LICENSE

using System;
using Nuke.Common.Execution;
using Nuke.Common.Execution.Theming;
using Nuke.Common.Utilities;

Expand All @@ -11,7 +12,7 @@ namespace Nuke.Common.CI.TeamCity
public partial class TeamCity
{
internal override IHostTheme Theme => AnsiConsoleHostTheme.Default256AnsiColorTheme;
internal override string OutputTemplate => "[{Level:u3}] {Message:l}{NewLine}{Exception}";
internal override string OutputTemplate => Logging.StandardOutputTemplate;

protected internal override IDisposable WriteBlock(string text)
{
Expand Down
1 change: 1 addition & 0 deletions source/Nuke.Common/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ internal static class Constants

internal const string GlobalToolVersionEnvironmentKey = "NUKE_GLOBAL_TOOL_VERSION";
internal const string GlobalToolStartTimeEnvironmentKey = "NUKE_GLOBAL_TOOL_START_TIME";
internal const string InterceptorEnvironmentKey = "NUKE_INTERNAL_INTERCEPTOR";

internal static AbsolutePath GlobalTemporaryDirectory => (AbsolutePath) Path.GetTempPath();
internal static AbsolutePath GlobalNukeDirectory => (AbsolutePath) EnvironmentInfo.SpecialFolder(SpecialFolders.UserProfile) / ".nuke";
Expand Down
35 changes: 35 additions & 0 deletions source/Nuke.Common/DisableDefaultOutputAttrbute.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Copyright 2022 Maintainers of NUKE.
// Distributed under the MIT License.
// https://github.com/nuke-build/nuke/blob/master/LICENSE

using System;
using System.Linq;
using JetBrains.Annotations;

namespace Nuke.Common
{
[PublicAPI]
[AttributeUsage(AttributeTargets.Class)]
public class DisableDefaultOutputAttribute : Attribute
{
public DisableDefaultOutputAttribute(params DefaultOutput[] disabledOutputs)
{
DisabledOutputs = disabledOutputs.Length > 0
? disabledOutputs
: Enum.GetValues(typeof(DefaultOutput)).Cast<DefaultOutput>().ToArray();
}

public DefaultOutput[] DisabledOutputs { get; }
}

public enum DefaultOutput
{
Logo,
TargetHeader,
TargetCollapse,
ErrorsAndWarnings,
TargetOutcome,
BuildOutcome,
Timestamps
}
}
2 changes: 1 addition & 1 deletion source/Nuke.Common/EnvironmentInfo.Others.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private static string[] GetSurrogateArguments()
}

var splittedArguments = ParseCommandLineArguments(argumentLines.Single());
return new[] { NukeBuild.BuildAssemblyFile.ToString() }.Concat(splittedArguments).ToArray();
return new[] { entryAssemblyLocation }.Concat(splittedArguments).ToArray();
}

internal static string[] ParseCommandLineArguments(string commandLine)
Expand Down
9 changes: 7 additions & 2 deletions source/Nuke.Common/EnvironmentInfo.Platform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,18 @@ public enum PlatformFamily
partial class EnvironmentInfo
{
/// <summary>
/// Returns whether the operating system is x64 or not.
/// Returns whether the operating system is arm64 or not.
/// </summary>
public static bool IsArm64 => RuntimeInformation.OSArchitecture == Architecture.Arm64;

/// <summary>
/// Returns whether the operating system is 64-bit or not.
/// </summary>
public static bool Is64Bit => RuntimeInformation.OSArchitecture == Architecture.X64 ||
RuntimeInformation.OSArchitecture == Architecture.Arm64;

/// <summary>
/// Returns whether the operating system is x86 or not.
/// Returns whether the operating system is 32-bit or not.
/// </summary>
public static bool Is32Bit => !Is64Bit;

Expand Down
4 changes: 3 additions & 1 deletion source/Nuke.Common/Execution/BuildExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ private static void Execute(
build.ExecuteExtension<IOnTargetRunning>(x => x.OnTargetRunning(build, target));
try
{
target.Actions.ForEach(x => x());
if (target.Intercept == null || !target.Intercept.Invoke())
target.Actions.ForEach(x => x());

target.Stopwatch.Stop();
target.Status = ExecutionStatus.Succeeded;
build.ExecuteExtension<IOnTargetSucceeded>(x => x.OnTargetSucceeded(build, target));
Expand Down
4 changes: 3 additions & 1 deletion source/Nuke.Common/Execution/BuildManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ void Finish()
};
}

build.WriteSummary();
build.WriteErrorsAndWarnings();
build.WriteTargetOutcome();
build.WriteBuildOutcome();
build.ExecuteExtension<IOnBuildFinished>(x => x.OnBuildFinished(build));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public void OnBuildInitialized(
IReadOnlyCollection<ExecutableTarget> executableTargets,
IReadOnlyCollection<ExecutableTarget> executionPlan)
{
if (NukeBuild.IsInterceptorExecution)
return;

if (!Task.Run(CheckConfiguration).Wait(TimeoutInMilliseconds))
Log.Warning("Could not complete checking build configurations within {Timeout} milliseconds", TimeoutInMilliseconds);

Expand Down
Loading

0 comments on commit fa8aae5

Please sign in to comment.