Skip to content

Commit

Permalink
Merge branch 'release/0.3.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger committed Jun 20, 2018
2 parents 47d4ad0 + 9f61f47 commit 3857301
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 12 deletions.
2 changes: 1 addition & 1 deletion nuspec/nuget/Cake.Issues.Testing.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Common helpers for testing add-ins based on Cake.Issues
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<copyright>Copyright © BBT Software AG and contributors</copyright>
<tags>Cake Script Cake-Issues Issues Testing</tags>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues/releases/tag/0.3.0</releaseNotes>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues/releases/tag/0.3.1</releaseNotes>
</metadata>
<files>
<file src="netstandard2.0\Cake.Issues.Testing.dll" target="lib\netstandard2.0" />
Expand Down
2 changes: 1 addition & 1 deletion nuspec/nuget/Cake.Issues.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ See the Project Site for an overview of the whole ecosystem of addins for workin
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<copyright>Copyright © BBT Software AG and contributors</copyright>
<tags>Cake Script Cake-Issues CodeAnalysis Linting Issues</tags>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues/releases/tag/0.3.0</releaseNotes>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues/releases/tag/0.3.1</releaseNotes>
</metadata>
<files>
<file src="netstandard2.0\Cake.Issues.dll" target="lib\netstandard2.0" />
Expand Down
39 changes: 39 additions & 0 deletions src/Cake.Issues/Aliases.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,45 @@
[CakeAliasCategory(IssuesAliasConstants.MainCakeAliasCategory)]
public static class Aliases
{
/// <summary>
/// Initiates the creation of a new <see cref="IIssue"/>.
/// </summary>
/// <param name="context">The context.</param>
/// <param name="message">The message of the issue.</param>
/// <param name="providerType">The unique identifier of the issue provider.</param>
/// <param name="providerName">The human friendly name of the issue provider.</param>
/// <returns>Builder class for creating a new <see cref="IIssue"/>.</returns>
/// <example>
/// <para>Create a new warning for the myfile.txt file on line 42:</para>
/// <code>
/// <![CDATA[
/// var issue =
/// NewIssue(
/// "Something went wrong",
/// "MyCakeScript",
/// "My Cake Script")
/// .InFile("myfile.txt", 42)
/// .WithPriority(IssuePriority.Warning)
/// .Create();
/// ]]>
/// </code>
/// </example>
[CakeMethodAlias]
[CakeAliasCategory(IssuesAliasConstants.CreateCakeAliasCategory)]
public static IssueBuilder NewIssue(
this ICakeContext context,
string message,
string providerType,
string providerName)
{
context.NotNull(nameof(context));
message.NotNullOrWhiteSpace(nameof(message));
providerType.NotNullOrWhiteSpace(nameof(providerType));
providerName.NotNullOrWhiteSpace(nameof(providerName));

return IssueBuilder.NewIssue(message, providerType, providerName);
}

/// <summary>
/// Reads issues from a single issue provider.
/// </summary>
Expand Down
20 changes: 10 additions & 10 deletions src/Cake.Issues/IssueBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System;

/// <summary>
/// Class to create instances of <see cref="Issue"/> with a fluent API.
/// Class to create instances of <see cref="IIssue"/> with a fluent API.
/// </summary>
public class IssueBuilder
{
Expand Down Expand Up @@ -39,12 +39,12 @@ public class IssueBuilder
}

/// <summary>
/// Creates a new instance of the <see cref="Issue"/> class.
/// Initiates the creation of a new <see cref="IIssue"/>.
/// </summary>
/// <param name="message">The message of the issue.</param>
/// <param name="providerType">The type of the issue provider.</param>
/// <param name="providerName">The human friendly name of the issue provider.</param>
/// <returns>New issue</returns>
/// <returns>Builder class for creating a new issue.</returns>
public static IssueBuilder NewIssue(
string message,
string providerType,
Expand All @@ -58,12 +58,12 @@ public class IssueBuilder
}

/// <summary>
/// Creates a new instance of the <see cref="Issue"/> class.
/// Initiates the creation of a new <see cref="IIssue"/>.
/// </summary>
/// <typeparam name="T">Type of the issue provider which has the issue created.</typeparam>
/// <param name="message">The message of the issue.</param>
/// <param name="issueProvider">Issue provider which has the issue created.</param>
/// <returns>New issue</returns>
/// <returns>Builder class for creating a new issue.</returns>
public static IssueBuilder NewIssue<T>(
string message,
T issueProvider)
Expand Down Expand Up @@ -126,19 +126,19 @@ public IssueBuilder InFile(string filePath, int? line)
}

/// <summary>
/// Sets the priority of the message.
/// Sets the priority of the issue.
/// </summary>
/// <param name="priority">The priority of the message.</param>
/// <param name="priority">The priority of the issue.</param>
/// <returns>Issue Builder instance.</returns>
public IssueBuilder WithPriority(IssuePriority priority)
{
return this.WithPriority((int)priority, priority.ToString());
}

/// <summary>
/// Sets the priority of the message.
/// Sets the priority of the issue.
/// </summary>
/// <param name="value">The priority of the message.
/// <param name="value">The priority of the issue.
/// <c>null</c> if no priority should be assigned.</param>
/// <param name="name">The human friendly name of the priority.
/// <c>null</c> or <see cref="string.Empty"/> if no priority should be assigned.</param>
Expand Down Expand Up @@ -181,7 +181,7 @@ public IssueBuilder OfRule(string name, Uri uri)
}

/// <summary>
/// Creates a new <see cref="Issue"/>.
/// Creates a new <see cref="IIssue"/>.
/// </summary>
/// <returns>New issue object.</returns>
public IIssue Create()
Expand Down
5 changes: 5 additions & 0 deletions src/Cake.Issues/IssuesAliasConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ public static class IssuesAliasConstants
/// </summary>
public const string MainCakeAliasCategory = "Issues";

/// <summary>
/// Category to use for all Cake aliases providing functionality for creating issues.
/// </summary>
public const string CreateCakeAliasCategory = "Creating Issues";

/// <summary>
/// Category to use for all Cake aliases providing functionality for reading issues.
/// </summary>
Expand Down

0 comments on commit 3857301

Please sign in to comment.