Skip to content

Commit

Permalink
chore: remove obsolete members
Browse files Browse the repository at this point in the history
  • Loading branch information
matkoch committed Jan 15, 2025
1 parent d00231b commit 0ed3284
Show file tree
Hide file tree
Showing 26 changed files with 62 additions and 1,390 deletions.
2 changes: 1 addition & 1 deletion build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ void DeletePackage(string id, string version)
.DependsOn<IPack>()
.Executes(() =>
{
SuppressErrors(() => DotNet($"tool uninstall -g {Solution.Nuke_GlobalTool.Name}"));
SuppressErrors(() => DotNet($"tool uninstall -g {Solution.Nuke_GlobalTool.Name}"), logWarning: false);
DotNet($"tool install -g {Solution.Nuke_GlobalTool.Name} --add-source {OutputDirectory} --version {DefaultDeploymentVersion}");
});

Expand Down
40 changes: 2 additions & 38 deletions source/Nuke.Build/ControlFlow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,42 +21,6 @@ namespace Nuke.Common;
[DebuggerStepThrough]
public static class ControlFlow
{
[Obsolete("Use " + nameof(Common.Assert) + "." + nameof(Common.Assert.Fail))]
public static void Fail(string format, params object[] args)
{
Fail(string.Format(format, args));
}

[Obsolete("Use " + nameof(Common.Assert) + "." + nameof(Common.Assert.Fail))]
public static void Fail(object value, Exception exception = null)
{
Fail(value.ToString(), exception);
}

[Obsolete("Use " + nameof(Common.Assert) + "." + nameof(Common.Assert.Fail))]
public static void Fail(string text, Exception exception = null)
{
Common.Assert.Fail(text, exception);
}

[Obsolete("Use " + nameof(Common.Assert) + "." + nameof(Common.Assert.True) +
" or " + nameof(Common.Assert) + "." + nameof(Common.Assert.False))]
public static void Assert(
[AssertionCondition(AssertionConditionType.IS_TRUE)]
bool condition,
string text)
{
Common.Assert.True(condition, text);
}

[Obsolete("Use " + nameof(Common.Assert) + "." + nameof(Common.Assert.NotNullOrEmpty))]
public static IReadOnlyCollection<T> NotEmpty<T>([CanBeNull] this IEnumerable<T> enumerable, string message = null)
{
var collection = enumerable.NotNull().ToList().AsReadOnly();
Common.Assert.NotEmpty(collection);
return collection;
}

public static void SuppressErrors(Action action, bool includeStackTrace = false, bool logWarning = true)
{
SuppressErrorsIf(condition: true, action, includeStackTrace: includeStackTrace, logWarning: logWarning);
Expand Down Expand Up @@ -106,7 +70,7 @@ public static void ExecuteWithRetry(
TimeSpan? delay = null,
Action<string> logAction = null)
{
Assert(retryAttempts > 0, "retryAttempts > 0");
Assert.True(retryAttempts > 0);

logAction ??= Log.Warning;
Exception lastException = null;
Expand Down Expand Up @@ -138,7 +102,7 @@ public static void ExecuteWithRetry(
}
}

Fail(new[]
Assert.Fail(new[]
{
$"Execution failed permanently after {retryAttempts} attempts.",
$"Last attempt failed with: {lastException!.Message}"
Expand Down
316 changes: 0 additions & 316 deletions source/Nuke.Build/Logger.cs

This file was deleted.

Loading

0 comments on commit 0ed3284

Please sign in to comment.