forked from cake-contrib/Cake.Issues
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request cake-contrib#42 from cake-contrib/feature/cake-isu…
…es-0-5 Update to Cake.Issues 0.5.0
- Loading branch information
Showing
10 changed files
with
21 additions
and
62 deletions.
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
39 changes: 5 additions & 34 deletions
39
src/Cake.Issues.MsBuild.Tests/MsBuildIssuesProviderFixture.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 |
---|---|---|
@@ -1,45 +1,16 @@ | ||
namespace Cake.Issues.MsBuild.Tests | ||
{ | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using Cake.Testing; | ||
using Core.Diagnostics; | ||
using Cake.Issues.Testing; | ||
|
||
internal class MsBuildIssuesProviderFixture | ||
: BaseMultiFormatIssueProviderFixture<MsBuildIssuesProvider, MsBuildIssuesSettings, XmlFileLoggerFormat> | ||
{ | ||
public MsBuildIssuesProviderFixture(string fileResourceName) | ||
: base(fileResourceName) | ||
{ | ||
this.Log = new FakeLog { Verbosity = Verbosity.Normal }; | ||
|
||
using (var ms = new MemoryStream()) | ||
using (var stream = this.GetType().Assembly.GetManifestResourceStream("Cake.Issues.MsBuild.Tests.Testfiles." + fileResourceName)) | ||
{ | ||
stream.CopyTo(ms); | ||
this.MsBuildIssuesSettings = | ||
new MsBuildIssuesSettings(ms.ToArray(), new XmlFileLoggerFormat(this.Log)); | ||
} | ||
|
||
this.RepositorySettings = | ||
new RepositorySettings(@"c:\Source\Cake.Issues.MsBuild"); | ||
} | ||
|
||
public FakeLog Log { get; set; } | ||
|
||
public MsBuildIssuesSettings MsBuildIssuesSettings { get; set; } | ||
|
||
public RepositorySettings RepositorySettings { get; set; } | ||
|
||
public MsBuildIssuesProvider Create() | ||
{ | ||
var provider = new MsBuildIssuesProvider(this.Log, this.MsBuildIssuesSettings); | ||
provider.Initialize(this.RepositorySettings); | ||
return provider; | ||
this.RepositorySettings = new RepositorySettings(@"c:\Source\Cake.Issues.MsBuild"); | ||
} | ||
|
||
public IEnumerable<IIssue> ReadIssues() | ||
{ | ||
var issueProvider = this.Create(); | ||
return issueProvider.ReadIssues(IssueCommentFormat.PlainText); | ||
} | ||
protected override string FileResourceNamespace => "Cake.Issues.MsBuild.Tests.Testfiles."; | ||
} | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,23 @@ | ||
namespace Cake.Issues.MsBuild | ||
{ | ||
using System.Collections.Generic; | ||
using Core.Diagnostics; | ||
|
||
/// <summary> | ||
/// Provider for issues reported as MsBuild warnings. | ||
/// </summary> | ||
public class MsBuildIssuesProvider : IssueProvider | ||
public class MsBuildIssuesProvider : BaseMultiFormatIssueProvider<MsBuildIssuesSettings, MsBuildIssuesProvider> | ||
{ | ||
private readonly MsBuildIssuesSettings msBuildIssuesSettings; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="MsBuildIssuesProvider"/> class. | ||
/// </summary> | ||
/// <param name="log">The Cake log context.</param> | ||
/// <param name="settings">Settings for reading the log file.</param> | ||
public MsBuildIssuesProvider(ICakeLog log, MsBuildIssuesSettings settings) | ||
: base(log) | ||
: base(log, settings) | ||
{ | ||
settings.NotNull(nameof(settings)); | ||
|
||
this.msBuildIssuesSettings = settings; | ||
} | ||
|
||
/// <inheritdoc /> | ||
public override string ProviderName => "MSBuild"; | ||
|
||
/// <inheritdoc /> | ||
protected override IEnumerable<IIssue> InternalReadIssues(IssueCommentFormat format) | ||
{ | ||
return this.msBuildIssuesSettings.Format.ReadIssues(this, this.Settings, this.msBuildIssuesSettings); | ||
} | ||
} | ||
} |
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