-
-
Notifications
You must be signed in to change notification settings - Fork 731
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
273 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/Cake.Common/Build/AppVeyor/AppVeyorMessageCategoryType.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
namespace Cake.Common.Build.AppVeyor | ||
{ | ||
/// <summary> | ||
/// AppVeyor AddMessage categories | ||
/// </summary> | ||
public enum AppVeyorMessageCategoryType | ||
{ | ||
/// <summary> | ||
/// Informational message | ||
/// </summary> | ||
Information, | ||
|
||
/// <summary> | ||
/// Warning message | ||
/// </summary> | ||
Warning, | ||
|
||
/// <summary> | ||
/// Error message | ||
/// </summary> | ||
Error | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/Cake.Common/Build/AppVeyor/AppVeyorProviderAddMessageExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using System; | ||
|
||
namespace Cake.Common.Build.AppVeyor | ||
{ | ||
/// <summary> | ||
/// AddMessage extension methods for the IAppVeyorProvider | ||
/// </summary> | ||
public static class AppVeyorProviderAddMessageExtensions | ||
{ | ||
/// <summary> | ||
/// Adds an informational message to the AppVeyor build log | ||
/// </summary> | ||
/// <param name="provider">The AppVeyor provider</param> | ||
/// <param name="format">The message</param> | ||
/// <param name="args">The args</param> | ||
public static void AddInformationalMessage(this IAppVeyorProvider provider, string format, params object[] args) | ||
{ | ||
provider.AddMessage(string.Format(format, args)); | ||
} | ||
|
||
/// <summary> | ||
/// Adds a warning message to the AppVeyor build log | ||
/// </summary> | ||
/// <param name="provider">The AppVeyor provider</param> | ||
/// <param name="format">The message</param> | ||
/// <param name="args">The args</param> | ||
public static void AddWarningMessage(this IAppVeyorProvider provider, string format, params object[] args) | ||
{ | ||
provider.AddMessage(string.Format(format, args), AppVeyorMessageCategoryType.Warning); | ||
} | ||
|
||
/// <summary> | ||
/// Adds a warning message to the AppVeyor build log | ||
/// </summary> | ||
/// <param name="provider">The AppVeyor provider</param> | ||
/// <param name="format">The message</param> | ||
/// <param name="args">The args</param> | ||
public static void AddErrorMessage(this IAppVeyorProvider provider, string format, params object[] args) | ||
{ | ||
provider.AddMessage(string.Format(format, args), AppVeyorMessageCategoryType.Error); | ||
} | ||
|
||
/// <summary> | ||
/// Adds a warning message to the AppVeyor build log | ||
/// </summary> | ||
/// <param name="provider">The AppVeyor provider</param> | ||
/// <param name="message">The message</param> | ||
/// <param name="exception">The exception</param> | ||
public static void AddErrorMessage(this IAppVeyorProvider provider, string message, Exception exception) | ||
{ | ||
provider.AddMessage(message, AppVeyorMessageCategoryType.Error, exception.ToString()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters