From fd5a6b101f36469d91424fb9081eef21f72ec828 Mon Sep 17 00:00:00 2001 From: Pascal Berger Date: Mon, 18 Sep 2017 11:14:29 +0200 Subject: [PATCH] Rename to Cake.Issues.Reporting.Generic --- README.md | 16 ++-- ...c => Cake.Issues.Reporting.Generic.nuspec} | 22 ++--- setup.cake | 6 +- ...ake.Issues.Reporting.Generic.Tests.ruleset | 8 ++ ...ake.Issues.Reporting.Generic.Tests.csproj} | 20 ++--- .../GenericIssueReportFixture.cs} | 24 ++--- .../GenericIssueReportFormatSettingsTests.cs} | 22 ++--- .../GenericIssueReportGeneratorTests.cs} | 16 ++-- ...ericIssueReportTemplateExtensionsTests.cs} | 6 +- .../Properties/AssemblyInfo.cs | 4 +- .../Templates/TestTemplate.cshtml | 0 .../packages.config | 0 ... => Cake.Issues.Reporting.Generic.ruleset} | 2 +- ....sln => Cake.Issues.Reporting.Generic.sln} | 6 +- ....Issues.Reporting.Generic.sln.DotSettings} | 0 .../Cake.Issues.Reporting.Generic.csproj} | 22 ++--- .../FodyWeavers.xml | 0 .../GenericIssueReportFormatAliases.cs} | 58 ++++++------ .../GenericIssueReportFormatSettings.cs | 90 +++++++++++++++++++ .../GenericIssueReportGenerator.cs} | 16 ++-- .../GenericIssueReportTemplate.cs | 13 +++ .../GenericIssueReportTemplateExtensions.cs} | 10 +-- .../Properties/AssemblyInfo.cs | 6 +- .../RazorEngineReferenceResolver.cs | 2 +- .../Templates/Diagnostic.cshtml | 0 .../packages.config | 0 src/Cake.Issues.Reporting.Html.Tests.ruleset | 8 -- .../HtmlIssueReportFormatSettings.cs | 90 ------------------- .../HtmlIssueReportTemplate.cs | 13 --- 29 files changed, 240 insertions(+), 240 deletions(-) rename nuspec/nuget/{Cake.Issues.Reporting.Html.nuspec => Cake.Issues.Reporting.Generic.nuspec} (63%) create mode 100644 src/Cake.Issues.Reporting.Generic.Tests.ruleset rename src/{Cake.Issues.Reporting.Html.Tests/Cake.Issues.Reporting.Html.Tests.csproj => Cake.Issues.Reporting.Generic.Tests/Cake.Issues.Reporting.Generic.Tests.csproj} (88%) rename src/{Cake.Issues.Reporting.Html.Tests/HtmlIssueReportFixture.cs => Cake.Issues.Reporting.Generic.Tests/GenericIssueReportFixture.cs} (60%) rename src/{Cake.Issues.Reporting.Html.Tests/HtmlIssueReportFormatSettingsTests.cs => Cake.Issues.Reporting.Generic.Tests/GenericIssueReportFormatSettingsTests.cs} (81%) rename src/{Cake.Issues.Reporting.Html.Tests/HtmlIssueReportGeneratorTests.cs => Cake.Issues.Reporting.Generic.Tests/GenericIssueReportGeneratorTests.cs} (75%) rename src/{Cake.Issues.Reporting.Html.Tests/HtmlIssueReportTemplateExtensionsTests.cs => Cake.Issues.Reporting.Generic.Tests/GenericIssueReportTemplateExtensionsTests.cs} (69%) rename src/{Cake.Issues.Reporting.Html.Tests => Cake.Issues.Reporting.Generic.Tests}/Properties/AssemblyInfo.cs (94%) rename src/{Cake.Issues.Reporting.Html.Tests => Cake.Issues.Reporting.Generic.Tests}/Templates/TestTemplate.cshtml (100%) rename src/{Cake.Issues.Reporting.Html.Tests => Cake.Issues.Reporting.Generic.Tests}/packages.config (100%) rename src/{Cake.Issues.Reporting.Html.ruleset => Cake.Issues.Reporting.Generic.ruleset} (98%) rename src/{Cake.Issues.Reporting.Html.sln => Cake.Issues.Reporting.Generic.sln} (83%) rename src/{Cake.Issues.Reporting.Html.sln.DotSettings => Cake.Issues.Reporting.Generic.sln.DotSettings} (100%) rename src/{Cake.Issues.Reporting.Html/Cake.Issues.Reporting.Html.csproj => Cake.Issues.Reporting.Generic/Cake.Issues.Reporting.Generic.csproj} (87%) rename src/{Cake.Issues.Reporting.Html => Cake.Issues.Reporting.Generic}/FodyWeavers.xml (100%) rename src/{Cake.Issues.Reporting.Html/HtmlIssueReportFormatAliases.cs => Cake.Issues.Reporting.Generic/GenericIssueReportFormatAliases.cs} (60%) create mode 100644 src/Cake.Issues.Reporting.Generic/GenericIssueReportFormatSettings.cs rename src/{Cake.Issues.Reporting.Html/HtmlIssueReportGenerator.cs => Cake.Issues.Reporting.Generic/GenericIssueReportGenerator.cs} (79%) create mode 100644 src/Cake.Issues.Reporting.Generic/GenericIssueReportTemplate.cs rename src/{Cake.Issues.Reporting.Html/HtmlIssueReportTemplateExtensions.cs => Cake.Issues.Reporting.Generic/GenericIssueReportTemplateExtensions.cs} (62%) rename src/{Cake.Issues.Reporting.Html => Cake.Issues.Reporting.Generic}/Properties/AssemblyInfo.cs (82%) rename src/{Cake.Issues.Reporting.Html => Cake.Issues.Reporting.Generic}/RazorEngineReferenceResolver.cs (97%) rename src/{Cake.Issues.Reporting.Html => Cake.Issues.Reporting.Generic}/Templates/Diagnostic.cshtml (100%) rename src/{Cake.Issues.Reporting.Html => Cake.Issues.Reporting.Generic}/packages.config (100%) delete mode 100644 src/Cake.Issues.Reporting.Html.Tests.ruleset delete mode 100644 src/Cake.Issues.Reporting.Html/HtmlIssueReportFormatSettings.cs delete mode 100644 src/Cake.Issues.Reporting.Html/HtmlIssueReportTemplate.cs diff --git a/README.md b/README.md index a1d78799..a3bd6307 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,29 @@ -# HTML Reports for Cake Issues Addin +# Generic text reports for Cake Issues Addin -This addin for the Cake Build Automation System allows you to create HTML reports for issues found -using any code analyzer or linter using the [Cake Issues addin](https://github.com/cake-contrib/Cake.Issues). +This addin for the Cake Build Automation System allows you to create reports in any text based format (HTML, Markdown, ...) +for issues found using any code analyzer or linter using the [Cake Issues addin](https://github.com/cake-contrib/Cake.Issues). For more information about this add-in see the [Cake.Issues website](https://cake-contrib.github.io/Cake.Issues.Website) and for general information about the Cake build automation system see the [Cake website](http://cakebuild.net) -[![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/cake-contrib/Cake.Issues.Reporting.Html/blob/feature/build/LICENSE) +[![License](http://img.shields.io/:license-mit-blue.svg)](https://github.com/cake-contrib/Cake.Issues.Reporting.Generic/blob/feature/build/LICENSE) ## Information | | Stable | Pre-release | |:--:|:--:|:--:| -|GitHub Release|-|[![GitHub release](https://img.shields.io/github/release/cake-contrib/Cake.Issues.Reporting.Html.svg)](https://github.com/cake-contrib/Cake.Issues.Reporting.Html/releases/latest)| -|NuGet|[![NuGet](https://img.shields.io/nuget/v/Cake.Issues.Reporting.Html.svg)](https://www.nuget.org/packages/Cake.Issues.Reporting.Html)|[![NuGet](https://img.shields.io/nuget/vpre/Cake.Issues.Reporting.Html.svg)](https://www.nuget.org/packages/Cake.Issues.Reporting.Html)| +|GitHub Release|-|[![GitHub release](https://img.shields.io/github/release/cake-contrib/Cake.Issues.Reporting.Generic.svg)](https://github.com/cake-contrib/Cake.Issues.Reporting.Generic/releases/latest)| +|NuGet|[![NuGet](https://img.shields.io/nuget/v/Cake.Issues.Reporting.Generic.svg)](https://www.nuget.org/packages/Cake.Issues.Reporting.Generic)|[![NuGet](https://img.shields.io/nuget/vpre/Cake.Issues.Reporting.Generic.svg)](https://www.nuget.org/packages/Cake.Issues.Reporting.Generic)| ## Build Status |Develop|Master| |:--:|:--:| -|[![Build status](https://ci.appveyor.com/api/projects/status/1bnglf1kihgqorvy/branch/develop?svg=true)](https://ci.appveyor.com/project/cakecontrib/cake-issues-reporting-html/branch/develop)|[![Build status](https://ci.appveyor.com/api/projects/status/1bnglf1kihgqorvy/branch/develop?svg=true)](https://ci.appveyor.com/project/cakecontrib/cake-issues-reporting-html/branch/master)| +|[![Build status](https://ci.appveyor.com/api/projects/status/1bnglf1kihgqorvy/branch/develop?svg=true)](https://ci.appveyor.com/project/cakecontrib/cake-issues-reporting-generic/branch/develop)|[![Build status](https://ci.appveyor.com/api/projects/status/1bnglf1kihgqorvy/branch/develop?svg=true)](https://ci.appveyor.com/project/cakecontrib/cake-issues-reporting-generic/branch/master)| ## Code Coverage -[![Coverage Status](https://coveralls.io/repos/github/cake-contrib/Cake.Issues.Reporting.Html/badge.svg?branch=develop)](https://coveralls.io/github/cake-contrib/Cake.Issues.Reporting.Html?branch=develop) +[![Coverage Status](https://coveralls.io/repos/github/cake-contrib/Cake.Issues.Reporting.Generic/badge.svg?branch=develop)](https://coveralls.io/github/cake-contrib/Cake.Issues.Reporting.Generic?branch=develop) ## Quick Links diff --git a/nuspec/nuget/Cake.Issues.Reporting.Html.nuspec b/nuspec/nuget/Cake.Issues.Reporting.Generic.nuspec similarity index 63% rename from nuspec/nuget/Cake.Issues.Reporting.Html.nuspec rename to nuspec/nuget/Cake.Issues.Reporting.Generic.nuspec index 107b0dae..3e331d45 100644 --- a/nuspec/nuget/Cake.Issues.Reporting.Html.nuspec +++ b/nuspec/nuget/Cake.Issues.Reporting.Generic.nuspec @@ -1,32 +1,32 @@  - Cake.Issues.Reporting.Html - Cake.Issues.Reporting.Html + Cake.Issues.Reporting.Generic + Cake.Issues.Reporting.Generic 0.0.0 Pascal Berger pascalberger, cake-contrib - HTML reporting support for the Cake.Issues addin for Cake Build Automation System + Support for creating any reports in any text based format (HTML, Markdown, ...) for the Cake.Issues addin for Cake Build Automation System -The HTML reporting support for the Cake.Issues addin for Cake allows you to create HTML issue reports. +The generic report support for the Cake.Issues addin for Cake allows you to create issue reports in any text format (HTML, Markdown, ...). -This addin provides the aliases for the HTML report format. +This addin provides the aliases for any text based report format. It also requires the core Cake.Issues and Cake.Issues.Reporting addins and one or more issue providers. See the Project Site for an overview of the whole ecosystem of addins for working with issues in Cake scripts. - https://github.com/cake-contrib/Cake.Issues.Reporting.Html/blob/develop/LICENSE + https://github.com/cake-contrib/Cake.Issues.Reporting.Generic/blob/develop/LICENSE http://cake-contrib.github.io/Cake.Issues.Website https://cdn.rawgit.com/cake-contrib/graphics/a5cf0f881c390650144b2243ae551d5b9f836196/png/cake-contrib-medium.png false Copyright © 2017 Pascal Berger - Cake Script Cake-Issues Cake-ReportFormat Issues Reporting Html - https://github.com/cake-contrib/Cake.Issues.Reporting.Html/releases/tag/0.1.0 + Cake Script Cake-Issues Cake-ReportFormat Issues Reporting Html Markdown + https://github.com/cake-contrib/Cake.Issues.Reporting.Generic/releases/tag/0.1.0 - - - + + + diff --git a/setup.cake b/setup.cake index c041e488..6a74312c 100644 --- a/setup.cake +++ b/setup.cake @@ -6,16 +6,16 @@ BuildParameters.SetParameters( context: Context, buildSystem: BuildSystem, sourceDirectoryPath: "./src", - title: "Cake.Issues.Reporting.Html", + title: "Cake.Issues.Reporting.Generic", repositoryOwner: "cake-contrib", - repositoryName: "Cake.Issues.Reporting.Html", + repositoryName: "Cake.Issues.Reporting.Generic", appVeyorAccountName: "cakecontrib"); BuildParameters.PrintParameters(Context); ToolSettings.SetToolSettings( context: Context, - dupFinderExcludePattern: new string[] { BuildParameters.RootDirectoryPath + "/src/Cake.Issues.Reporting.Html.Tests/*.cs" }, + dupFinderExcludePattern: new string[] { BuildParameters.RootDirectoryPath + "/src/Cake.Issues.Reporting.Generic.Tests/*.cs" }, testCoverageFilter: "+[*]* -[xunit.*]* -[Cake.Core]* -[Cake.Testing]* -[*.Tests]* -[Cake.Issues]* -[Cake.Issues.Testing]* -[Cake.Issues.Reporting]*", testCoverageExcludeByAttribute: "*.ExcludeFromCodeCoverage*", testCoverageExcludeByFile: "*/*Designer.cs;*/*.g.cs;*/*.g.i.cs"); diff --git a/src/Cake.Issues.Reporting.Generic.Tests.ruleset b/src/Cake.Issues.Reporting.Generic.Tests.ruleset new file mode 100644 index 00000000..ecd54ecf --- /dev/null +++ b/src/Cake.Issues.Reporting.Generic.Tests.ruleset @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/src/Cake.Issues.Reporting.Html.Tests/Cake.Issues.Reporting.Html.Tests.csproj b/src/Cake.Issues.Reporting.Generic.Tests/Cake.Issues.Reporting.Generic.Tests.csproj similarity index 88% rename from src/Cake.Issues.Reporting.Html.Tests/Cake.Issues.Reporting.Html.Tests.csproj rename to src/Cake.Issues.Reporting.Generic.Tests/Cake.Issues.Reporting.Generic.Tests.csproj index 33517784..9e47ed54 100644 --- a/src/Cake.Issues.Reporting.Html.Tests/Cake.Issues.Reporting.Html.Tests.csproj +++ b/src/Cake.Issues.Reporting.Generic.Tests/Cake.Issues.Reporting.Generic.Tests.csproj @@ -8,8 +8,8 @@ {1E92A970-E905-4DF8-8ECA-5529B701E8E3} Library Properties - Cake.Issues.Reporting.Html.Tests - Cake.Issues.Reporting.Html.Tests + Cake.Issues.Reporting.Generic.Tests + Cake.Issues.Reporting.Generic.Tests v4.6 512 @@ -24,7 +24,7 @@ DEBUG;TRACE prompt 4 - ..\Cake.Issues.Reporting.Html.Tests.ruleset + ..\Cake.Issues.Reporting.Generic.Tests.ruleset pdbonly @@ -33,7 +33,7 @@ TRACE prompt 4 - ..\Cake.Issues.Reporting.Html.Tests.ruleset + ..\Cake.Issues.Reporting.Generic.Tests.ruleset @@ -76,16 +76,16 @@ - - - - + + + + - + {b514788a-8596-41ca-92b6-86199549dc2a} - Cake.Issues.Reporting.Html + Cake.Issues.Reporting.Generic diff --git a/src/Cake.Issues.Reporting.Html.Tests/HtmlIssueReportFixture.cs b/src/Cake.Issues.Reporting.Generic.Tests/GenericIssueReportFixture.cs similarity index 60% rename from src/Cake.Issues.Reporting.Html.Tests/HtmlIssueReportFixture.cs rename to src/Cake.Issues.Reporting.Generic.Tests/GenericIssueReportFixture.cs index 7e809da5..2655516d 100644 --- a/src/Cake.Issues.Reporting.Html.Tests/HtmlIssueReportFixture.cs +++ b/src/Cake.Issues.Reporting.Generic.Tests/GenericIssueReportFixture.cs @@ -1,40 +1,40 @@ -namespace Cake.Issues.Reporting.Html.Tests +namespace Cake.Issues.Reporting.Generic.Tests { using System.Collections.Generic; using System.IO; using Cake.Testing; using Core.Diagnostics; - internal class HtmlIssueReportFixture + internal class GenericIssueReportFixture { - public HtmlIssueReportFixture() + public GenericIssueReportFixture() { this.Log = new FakeLog { Verbosity = Verbosity.Normal }; - this.HtmlIssueReportFormatSettings = - HtmlIssueReportFormatSettings.FromEmbeddedTemplate(HtmlIssueReportTemplate.Diagnostic); + this.GenericIssueReportFormatSettings = + GenericIssueReportFormatSettings.FromEmbeddedTemplate(GenericIssueReportTemplate.HtmlDiagnostic); } - public HtmlIssueReportFixture(string templateContent) + public GenericIssueReportFixture(string templateContent) { this.Log = new FakeLog { Verbosity = Verbosity.Normal }; - this.HtmlIssueReportFormatSettings = - HtmlIssueReportFormatSettings.FromContent(templateContent); + this.GenericIssueReportFormatSettings = + GenericIssueReportFormatSettings.FromContent(templateContent); } public FakeLog Log { get; set; } - public HtmlIssueReportFormatSettings HtmlIssueReportFormatSettings { get; set; } + public GenericIssueReportFormatSettings GenericIssueReportFormatSettings { get; set; } public string CreateReport(IEnumerable issues) { var generator = - new HtmlIssueReportGenerator(this.Log, this.HtmlIssueReportFormatSettings); + new GenericIssueReportGenerator(this.Log, this.GenericIssueReportFormatSettings); - var reportFile = System.IO.Path.GetTempFileName(); + var reportFile = Path.GetTempFileName(); try { var createIssueReportSettings = - new CreateIssueReportSettings(@"c:\Source\Cake.Issues.Reporting.Html", reportFile); + new CreateIssueReportSettings(@"c:\Source\Cake.Issues.Reporting.Generic", reportFile); generator.Initialize(createIssueReportSettings); generator.CreateReport(issues); diff --git a/src/Cake.Issues.Reporting.Html.Tests/HtmlIssueReportFormatSettingsTests.cs b/src/Cake.Issues.Reporting.Generic.Tests/GenericIssueReportFormatSettingsTests.cs similarity index 81% rename from src/Cake.Issues.Reporting.Html.Tests/HtmlIssueReportFormatSettingsTests.cs rename to src/Cake.Issues.Reporting.Generic.Tests/GenericIssueReportFormatSettingsTests.cs index 6ed0eb58..2186ccdf 100644 --- a/src/Cake.Issues.Reporting.Html.Tests/HtmlIssueReportFormatSettingsTests.cs +++ b/src/Cake.Issues.Reporting.Generic.Tests/GenericIssueReportFormatSettingsTests.cs @@ -1,4 +1,4 @@ -namespace Cake.Issues.Reporting.Html.Tests +namespace Cake.Issues.Reporting.Generic.Tests { using System; using System.IO; @@ -9,7 +9,7 @@ using Testing; using Xunit; - public sealed class HtmlIssueReportFormatSettingsTests + public sealed class GenericIssueReportFormatSettingsTests { public sealed class TheCtor { @@ -21,7 +21,7 @@ public void Should_Throw_If_TemplatePath_Is_Null() // When var result = Record.Exception(() => - HtmlIssueReportFormatSettings.FromFilePath(templatePath)); + GenericIssueReportFormatSettings.FromFilePath(templatePath)); // Then result.IsArgumentNullException("templatePath"); @@ -35,7 +35,7 @@ public void Should_Throw_If_TemplateContent_Is_Null() // When var result = Record.Exception(() => - HtmlIssueReportFormatSettings.FromContent(templateContent)); + GenericIssueReportFormatSettings.FromContent(templateContent)); // Then result.IsArgumentNullException("templateContent"); @@ -49,7 +49,7 @@ public void Should_Throw_If_TemplateContent_Is_Empty() // When var result = Record.Exception(() => - HtmlIssueReportFormatSettings.FromContent(templateContent)); + GenericIssueReportFormatSettings.FromContent(templateContent)); // Then result.IsArgumentOutOfRangeException("templateContent"); @@ -63,7 +63,7 @@ public void Should_Throw_If_TemplateContent_Is_WhiteSpace() // When var result = Record.Exception(() => - HtmlIssueReportFormatSettings.FromContent(templateContent)); + GenericIssueReportFormatSettings.FromContent(templateContent)); // Then result.IsArgumentOutOfRangeException("templateContent"); @@ -76,7 +76,7 @@ public void Should_Set_Template() var templateContent = "foo"; // When - var settings = HtmlIssueReportFormatSettings.FromContent(templateContent); + var settings = GenericIssueReportFormatSettings.FromContent(templateContent); // Then settings.Template.ShouldBe(templateContent); @@ -86,10 +86,10 @@ public void Should_Set_Template() public void Should_Set_Embedded_Template() { // Given - var template = HtmlIssueReportTemplate.Diagnostic; + var template = GenericIssueReportTemplate.HtmlDiagnostic; // When - var settings = HtmlIssueReportFormatSettings.FromEmbeddedTemplate(template); + var settings = GenericIssueReportFormatSettings.FromEmbeddedTemplate(template); // Then settings.Template.ShouldNotBeNullOrWhiteSpace(); @@ -104,7 +104,7 @@ public void Should_Read_Template_From_Disk() // Given string expected; using (var ms = new MemoryStream()) - using (var stream = this.GetType().Assembly.GetManifestResourceStream("Cake.Issues.Reporting.Html.Tests.Templates.TestTemplate.cshtml")) + using (var stream = this.GetType().Assembly.GetManifestResourceStream("Cake.Issues.Reporting.Generic.Tests.Templates.TestTemplate.cshtml")) { stream.CopyTo(ms); var data = ms.ToArray(); @@ -119,7 +119,7 @@ public void Should_Read_Template_From_Disk() // When var settings = - HtmlIssueReportFormatSettings.FromFilePath(fileName); + GenericIssueReportFormatSettings.FromFilePath(fileName); // Then settings.Template.ShouldBe(expected); diff --git a/src/Cake.Issues.Reporting.Html.Tests/HtmlIssueReportGeneratorTests.cs b/src/Cake.Issues.Reporting.Generic.Tests/GenericIssueReportGeneratorTests.cs similarity index 75% rename from src/Cake.Issues.Reporting.Html.Tests/HtmlIssueReportGeneratorTests.cs rename to src/Cake.Issues.Reporting.Generic.Tests/GenericIssueReportGeneratorTests.cs index c680a6d6..ebe38dd4 100644 --- a/src/Cake.Issues.Reporting.Html.Tests/HtmlIssueReportGeneratorTests.cs +++ b/src/Cake.Issues.Reporting.Generic.Tests/GenericIssueReportGeneratorTests.cs @@ -1,4 +1,4 @@ -namespace Cake.Issues.Reporting.Html.Tests +namespace Cake.Issues.Reporting.Generic.Tests { using System.Collections.Generic; using Cake.Testing; @@ -6,7 +6,7 @@ using Testing; using Xunit; - public sealed class HtmlIssueReportGeneratorTests + public sealed class GenericIssueReportGeneratorTests { public sealed class TheCtor { @@ -15,9 +15,9 @@ public void Should_Throw_If_Log_Is_Null() { // Given / When var result = Record.Exception(() => - new HtmlIssueReportGenerator( + new GenericIssueReportGenerator( null, - HtmlIssueReportFormatSettings.FromContent("Foo"))); + GenericIssueReportFormatSettings.FromContent("Foo"))); // Then result.IsArgumentNullException("log"); @@ -28,7 +28,7 @@ public void Should_Throw_If_Settings_Are_Null() { // Given / When var result = Record.Exception(() => - new HtmlIssueReportGenerator( + new GenericIssueReportGenerator( new FakeLog(), null)); @@ -43,19 +43,19 @@ public sealed class TheInternalCreateReportMethod public void Should_Generate_Report() { // Given - var fixture = new HtmlIssueReportFixture("
    @foreach(var issue in Model){
  • @issue.Message
  • }
"); + var fixture = new GenericIssueReportFixture("
    @foreach(var issue in Model){
  • @issue.Message
  • }
"); var issues = new List { new Issue( - @"src\Cake.Issues.Reporting.Html.Tests\Foo.cs", + @"src\Cake.Issues.Reporting.Generic.Tests\Foo.cs", 10, "Foo", 0, "Foo", "Foo"), new Issue( - @"src\Cake.Issues.Reporting.Html.Tests\Foo.cs", + @"src\Cake.Issues.Reporting.Generic.Tests\Foo.cs", 12, "Bar", 0, diff --git a/src/Cake.Issues.Reporting.Html.Tests/HtmlIssueReportTemplateExtensionsTests.cs b/src/Cake.Issues.Reporting.Generic.Tests/GenericIssueReportTemplateExtensionsTests.cs similarity index 69% rename from src/Cake.Issues.Reporting.Html.Tests/HtmlIssueReportTemplateExtensionsTests.cs rename to src/Cake.Issues.Reporting.Generic.Tests/GenericIssueReportTemplateExtensionsTests.cs index 48f1ee47..7dbaf8f7 100644 --- a/src/Cake.Issues.Reporting.Html.Tests/HtmlIssueReportTemplateExtensionsTests.cs +++ b/src/Cake.Issues.Reporting.Generic.Tests/GenericIssueReportTemplateExtensionsTests.cs @@ -1,9 +1,9 @@ -namespace Cake.Issues.Reporting.Html.Tests +namespace Cake.Issues.Reporting.Generic.Tests { using Shouldly; using Xunit; - public sealed class HtmlIssueReportTemplateExtensionsTests + public sealed class GenericIssueReportTemplateExtensionsTests { public sealed class TheGetTemplateResourceNameMethod { @@ -11,7 +11,7 @@ public sealed class TheGetTemplateResourceNameMethod public void Should_Return_ResourceName() { // Given - var template = HtmlIssueReportTemplate.Diagnostic; + var template = GenericIssueReportTemplate.HtmlDiagnostic; // When var result = template.GetTemplateResourceName(); diff --git a/src/Cake.Issues.Reporting.Html.Tests/Properties/AssemblyInfo.cs b/src/Cake.Issues.Reporting.Generic.Tests/Properties/AssemblyInfo.cs similarity index 94% rename from src/Cake.Issues.Reporting.Html.Tests/Properties/AssemblyInfo.cs rename to src/Cake.Issues.Reporting.Generic.Tests/Properties/AssemblyInfo.cs index 19ba90a5..d63955ef 100644 --- a/src/Cake.Issues.Reporting.Html.Tests/Properties/AssemblyInfo.cs +++ b/src/Cake.Issues.Reporting.Generic.Tests/Properties/AssemblyInfo.cs @@ -4,8 +4,8 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("Cake.Issues.Reporting.Html.Tests")] -[assembly: AssemblyDescription("Tests for the Cake.Issues.Reporting.Html addin")] +[assembly: AssemblyTitle("Cake.Issues.Reporting.Generic.Tests")] +[assembly: AssemblyDescription("Tests for the Cake.Issues.Reporting.Generic addin")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("BBT Software AG")] [assembly: AssemblyProduct("Cake.Issues")] diff --git a/src/Cake.Issues.Reporting.Html.Tests/Templates/TestTemplate.cshtml b/src/Cake.Issues.Reporting.Generic.Tests/Templates/TestTemplate.cshtml similarity index 100% rename from src/Cake.Issues.Reporting.Html.Tests/Templates/TestTemplate.cshtml rename to src/Cake.Issues.Reporting.Generic.Tests/Templates/TestTemplate.cshtml diff --git a/src/Cake.Issues.Reporting.Html.Tests/packages.config b/src/Cake.Issues.Reporting.Generic.Tests/packages.config similarity index 100% rename from src/Cake.Issues.Reporting.Html.Tests/packages.config rename to src/Cake.Issues.Reporting.Generic.Tests/packages.config diff --git a/src/Cake.Issues.Reporting.Html.ruleset b/src/Cake.Issues.Reporting.Generic.ruleset similarity index 98% rename from src/Cake.Issues.Reporting.Html.ruleset rename to src/Cake.Issues.Reporting.Generic.ruleset index 9836e5a5..3a79c801 100644 --- a/src/Cake.Issues.Reporting.Html.ruleset +++ b/src/Cake.Issues.Reporting.Generic.ruleset @@ -1,5 +1,5 @@  - + diff --git a/src/Cake.Issues.Reporting.Html.sln b/src/Cake.Issues.Reporting.Generic.sln similarity index 83% rename from src/Cake.Issues.Reporting.Html.sln rename to src/Cake.Issues.Reporting.Generic.sln index 3c413832..4d6a6cc7 100644 --- a/src/Cake.Issues.Reporting.Html.sln +++ b/src/Cake.Issues.Reporting.Generic.sln @@ -3,9 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26730.8 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.Issues.Reporting.Html", "Cake.Issues.Reporting.Html\Cake.Issues.Reporting.Html.csproj", "{B514788A-8596-41CA-92B6-86199549DC2A}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.Issues.Reporting.Generic", "Cake.Issues.Reporting.Generic\Cake.Issues.Reporting.Generic.csproj", "{B514788A-8596-41CA-92B6-86199549DC2A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.Issues.Reporting.Html.Tests", "Cake.Issues.Reporting.Html.Tests\Cake.Issues.Reporting.Html.Tests.csproj", "{1E92A970-E905-4DF8-8ECA-5529B701E8E3}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.Issues.Reporting.Generic.Tests", "Cake.Issues.Reporting.Generic.Tests\Cake.Issues.Reporting.Generic.Tests.csproj", "{1E92A970-E905-4DF8-8ECA-5529B701E8E3}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{CCC3591D-69C0-4140-8E33-D0E2703DB8C5}" ProjectSection(SolutionItems) = preProject @@ -14,7 +14,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{CCC3591D EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "nuget", "nuget", "{78523A6B-9A2C-43AB-BD00-0D7994F28A5B}" ProjectSection(SolutionItems) = preProject - ..\nuspec\nuget\Cake.Issues.Reporting.Html.nuspec = ..\nuspec\nuget\Cake.Issues.Reporting.Html.nuspec + ..\nuspec\nuget\Cake.Issues.Reporting.Generic.nuspec = ..\nuspec\nuget\Cake.Issues.Reporting.Generic.nuspec EndProjectSection EndProject Global diff --git a/src/Cake.Issues.Reporting.Html.sln.DotSettings b/src/Cake.Issues.Reporting.Generic.sln.DotSettings similarity index 100% rename from src/Cake.Issues.Reporting.Html.sln.DotSettings rename to src/Cake.Issues.Reporting.Generic.sln.DotSettings diff --git a/src/Cake.Issues.Reporting.Html/Cake.Issues.Reporting.Html.csproj b/src/Cake.Issues.Reporting.Generic/Cake.Issues.Reporting.Generic.csproj similarity index 87% rename from src/Cake.Issues.Reporting.Html/Cake.Issues.Reporting.Html.csproj rename to src/Cake.Issues.Reporting.Generic/Cake.Issues.Reporting.Generic.csproj index 3926f63e..b94f1b0c 100644 --- a/src/Cake.Issues.Reporting.Html/Cake.Issues.Reporting.Html.csproj +++ b/src/Cake.Issues.Reporting.Generic/Cake.Issues.Reporting.Generic.csproj @@ -7,8 +7,8 @@ {B514788A-8596-41CA-92B6-86199549DC2A} Library Properties - Cake.Issues.Reporting.Html - Cake.Issues.Reporting.Html + Cake.Issues.Reporting.Generic + Cake.Issues.Reporting.Generic v4.6 512 @@ -23,8 +23,8 @@ DEBUG;TRACE prompt 4 - bin\Debug\Cake.Issues.Reporting.Html.xml - ..\Cake.Issues.Reporting.Html.ruleset + bin\Debug\Cake.Issues.Reporting.Generic.xml + ..\Cake.Issues.Reporting.Generic.ruleset pdbonly @@ -33,8 +33,8 @@ TRACE prompt 4 - bin\Release\Cake.Issues.Reporting.Html.xml - ..\Cake.Issues.Reporting.Html.ruleset + bin\Release\Cake.Issues.Reporting.Generic.xml + ..\Cake.Issues.Reporting.Generic.ruleset @@ -66,12 +66,12 @@ - - - + + + - - + + diff --git a/src/Cake.Issues.Reporting.Html/FodyWeavers.xml b/src/Cake.Issues.Reporting.Generic/FodyWeavers.xml similarity index 100% rename from src/Cake.Issues.Reporting.Html/FodyWeavers.xml rename to src/Cake.Issues.Reporting.Generic/FodyWeavers.xml diff --git a/src/Cake.Issues.Reporting.Html/HtmlIssueReportFormatAliases.cs b/src/Cake.Issues.Reporting.Generic/GenericIssueReportFormatAliases.cs similarity index 60% rename from src/Cake.Issues.Reporting.Html/HtmlIssueReportFormatAliases.cs rename to src/Cake.Issues.Reporting.Generic/GenericIssueReportFormatAliases.cs index ba3b314a..0128a160 100644 --- a/src/Cake.Issues.Reporting.Html/HtmlIssueReportFormatAliases.cs +++ b/src/Cake.Issues.Reporting.Generic/GenericIssueReportFormatAliases.cs @@ -1,28 +1,28 @@ -namespace Cake.Issues.Reporting.Html +namespace Cake.Issues.Reporting.Generic { using Core; using Core.Annotations; using Core.IO; /// - /// Contains functionality for creating issue reports int HTML format. + /// Contains functionality for creating issue reports in any text based format (HTML, Markdown, ...). /// [CakeAliasCategory(IssuesAliasConstants.MainCakeAliasCategory)] - public static class HtmlIssueReportFormatAliases + public static class GenericIssueReportFormatAliases { /// - /// Gets an instance of a the HTML report format using an embedded template. + /// Gets an instance of a the generic report format using an embedded template. /// /// The context. - /// Template to use for generating the HTML report. - /// Instance of a the HTML report format. + /// Template to use for generating the report. + /// Instance of a the generic report format. /// /// Create HTML report using the diagnostic template: /// /// @@ -30,28 +30,28 @@ public static class HtmlIssueReportFormatAliases /// [CakeMethodAlias] [CakeAliasCategory(ReportingAliasConstants.ReportingFormatCakeAliasCategory)] - public static IIssueReportFormat HtmlIssueReportFormatFromEmbeddedTemplate( + public static IIssueReportFormat GenericIssueReportFormatFromEmbeddedTemplate( this ICakeContext context, - HtmlIssueReportTemplate template) + GenericIssueReportTemplate template) { context.NotNull(nameof(context)); - return context.HtmlIssueReportFormat(HtmlIssueReportFormatSettings.FromEmbeddedTemplate(template)); + return context.GenericIssueReportFormat(GenericIssueReportFormatSettings.FromEmbeddedTemplate(template)); } /// - /// Gets an instance of a the HTML report format using a local template. + /// Gets an instance of a the generic report format using a local template. /// /// The context. - /// Path to the template to use for generating the HTML report. - /// Instance of a the HTML report format. + /// Path to the template to use for generating the report. + /// Instance of a the generic report format. /// /// Create HTML report from local template file: /// /// @@ -59,22 +59,22 @@ public static class HtmlIssueReportFormatAliases /// [CakeMethodAlias] [CakeAliasCategory(ReportingAliasConstants.ReportingFormatCakeAliasCategory)] - public static IIssueReportFormat HtmlIssueReportFormatFromFilePath( + public static IIssueReportFormat GenericIssueReportFormatFromFilePath( this ICakeContext context, FilePath templatePath) { context.NotNull(nameof(context)); templatePath.NotNull(nameof(templatePath)); - return context.HtmlIssueReportFormat(HtmlIssueReportFormatSettings.FromFilePath(templatePath)); + return context.GenericIssueReportFormat(GenericIssueReportFormatSettings.FromFilePath(templatePath)); } /// - /// Gets an instance of a the HTML report format using a template string. + /// Gets an instance of a the generic report format using a template string. /// /// The context. - /// Content of the template to use for generating the HTML report. - /// Instance of a the HTML report format. + /// Content of the template to use for generating the report. + /// Instance of a the generic report format. /// /// Create HTML report from a template string: /// @@ -83,7 +83,7 @@ public static class HtmlIssueReportFormatAliases /// "
    @foreach(var issue in Model){
  • @issue.Message
  • }
"; /// CreateIssueReport( /// issues, - /// HtmlIssueReportFormatFromEmbeddedTemplate(template), + /// GenericIssueReportFormatFromContent(template), /// @"c:\repo", /// @"c:\report.html"); /// ]]> @@ -91,32 +91,32 @@ public static class HtmlIssueReportFormatAliases ///
[CakeMethodAlias] [CakeAliasCategory(ReportingAliasConstants.ReportingFormatCakeAliasCategory)] - public static IIssueReportFormat HtmlIssueReportFormatFromFilePath( + public static IIssueReportFormat GenericIssueReportFormatFromContent( this ICakeContext context, string templateContent) { context.NotNull(nameof(context)); templateContent.NotNullOrWhiteSpace(nameof(templateContent)); - return context.HtmlIssueReportFormat(HtmlIssueReportFormatSettings.FromContent(templateContent)); + return context.GenericIssueReportFormat(GenericIssueReportFormatSettings.FromContent(templateContent)); } /// - /// Gets an instance of a the HTML report format using specified settings. + /// Gets an instance of a the generic report format using specified settings. /// /// The context. /// Settings for reading the MSBuild log. - /// Instance of a the HTML report format. + /// Instance of a the generic report format. /// /// Create HTML report: /// /// @@ -124,14 +124,14 @@ public static class HtmlIssueReportFormatAliases /// [CakeMethodAlias] [CakeAliasCategory(ReportingAliasConstants.ReportingFormatCakeAliasCategory)] - public static IIssueReportFormat HtmlIssueReportFormat( + public static IIssueReportFormat GenericIssueReportFormat( this ICakeContext context, - HtmlIssueReportFormatSettings settings) + GenericIssueReportFormatSettings settings) { context.NotNull(nameof(context)); settings.NotNull(nameof(settings)); - return new HtmlIssueReportGenerator(context.Log, settings); + return new GenericIssueReportGenerator(context.Log, settings); } } } diff --git a/src/Cake.Issues.Reporting.Generic/GenericIssueReportFormatSettings.cs b/src/Cake.Issues.Reporting.Generic/GenericIssueReportFormatSettings.cs new file mode 100644 index 00000000..a4f05f13 --- /dev/null +++ b/src/Cake.Issues.Reporting.Generic/GenericIssueReportFormatSettings.cs @@ -0,0 +1,90 @@ +namespace Cake.Issues.Reporting.Generic +{ + using System.IO; + using Core.IO; + + /// + /// Settings for . + /// + public class GenericIssueReportFormatSettings + { + /// + /// Initializes a new instance of the class. + /// + /// Template to use for generating the report. + protected GenericIssueReportFormatSettings(GenericIssueReportTemplate template) + { + using (var stream = this.GetType().Assembly.GetManifestResourceStream("Cake.Issues.Reporting.Generic.Templates." + template.GetTemplateResourceName())) + { + using (var sr = new StreamReader(stream)) + { + this.Template = sr.ReadToEnd(); + } + } + } + + /// + /// Initializes a new instance of the class. + /// + /// Path to the template to use for generating the report. + protected GenericIssueReportFormatSettings(FilePath templatePath) + { + templatePath.NotNull(nameof(templatePath)); + + using (var stream = new FileStream(templatePath.FullPath, FileMode.Open, FileAccess.Read)) + { + using (var sr = new StreamReader(stream)) + { + this.Template = sr.ReadToEnd(); + } + } + } + + /// + /// Initializes a new instance of the class. + /// + /// Content of the template to use for generating the report. + protected GenericIssueReportFormatSettings(string templateContent) + { + templateContent.NotNullOrWhiteSpace(nameof(templateContent)); + + this.Template = templateContent; + } + + /// + /// Gets the template to use for generating the report. + /// + public string Template { get; private set; } + + /// + /// Returns a new instance of the class from a template file on disk. + /// + /// Template to use for generating the report. + /// Instance of the class. + public static GenericIssueReportFormatSettings FromEmbeddedTemplate(GenericIssueReportTemplate template) + { + return new GenericIssueReportFormatSettings(template); + } + + /// + /// Returns a new instance of the class from a template file on disk. + /// + /// Path to the template to use for generating the report. + /// Instance of the class. + public static GenericIssueReportFormatSettings FromFilePath(FilePath templatePath) + { + return new GenericIssueReportFormatSettings(templatePath); + } + + /// + /// Returns a new instance of the class from the content + /// of a template file. + /// + /// Content of the template to use for generating the report. + /// Instance of the class. + public static GenericIssueReportFormatSettings FromContent(string templateContent) + { + return new GenericIssueReportFormatSettings(templateContent); + } + } +} diff --git a/src/Cake.Issues.Reporting.Html/HtmlIssueReportGenerator.cs b/src/Cake.Issues.Reporting.Generic/GenericIssueReportGenerator.cs similarity index 79% rename from src/Cake.Issues.Reporting.Html/HtmlIssueReportGenerator.cs rename to src/Cake.Issues.Reporting.Generic/GenericIssueReportGenerator.cs index 61db8722..0853b836 100644 --- a/src/Cake.Issues.Reporting.Html/HtmlIssueReportGenerator.cs +++ b/src/Cake.Issues.Reporting.Generic/GenericIssueReportGenerator.cs @@ -1,4 +1,4 @@ -namespace Cake.Issues.Reporting.Html +namespace Cake.Issues.Reporting.Generic { using System; using System.Collections.Generic; @@ -10,23 +10,23 @@ using RazorEngine.Templating; /// - /// Generator for creating HTML issue reports. + /// Generator for creating text based issue reports. /// - internal class HtmlIssueReportGenerator : IssueReportFormat + internal class GenericIssueReportGenerator : IssueReportFormat { - private readonly HtmlIssueReportFormatSettings htmlIssueReportFormatSettings; + private readonly GenericIssueReportFormatSettings genericIssueReportFormatSettings; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The Cake log context. /// Settings for reading the log file. - public HtmlIssueReportGenerator(ICakeLog log, HtmlIssueReportFormatSettings settings) + public GenericIssueReportGenerator(ICakeLog log, GenericIssueReportFormatSettings settings) : base(log) { settings.NotNull(nameof(settings)); - this.htmlIssueReportFormatSettings = settings; + this.genericIssueReportFormatSettings = settings; this.ConfigureRazorEngine(); } @@ -40,7 +40,7 @@ protected override FilePath InternalCreateReport(IEnumerable issues) { var result = Engine.Razor.RunCompile( - this.htmlIssueReportFormatSettings.Template, + this.genericIssueReportFormatSettings.Template, Guid.NewGuid().ToString(), typeof(IEnumerable), issues); diff --git a/src/Cake.Issues.Reporting.Generic/GenericIssueReportTemplate.cs b/src/Cake.Issues.Reporting.Generic/GenericIssueReportTemplate.cs new file mode 100644 index 00000000..1bb72093 --- /dev/null +++ b/src/Cake.Issues.Reporting.Generic/GenericIssueReportTemplate.cs @@ -0,0 +1,13 @@ +namespace Cake.Issues.Reporting.Generic +{ + /// + /// Default templates provided by this addin. + /// + public enum GenericIssueReportTemplate + { + /// + /// Template for a HTML report containing a list of all issues with all properties. + /// + HtmlDiagnostic + } +} diff --git a/src/Cake.Issues.Reporting.Html/HtmlIssueReportTemplateExtensions.cs b/src/Cake.Issues.Reporting.Generic/GenericIssueReportTemplateExtensions.cs similarity index 62% rename from src/Cake.Issues.Reporting.Html/HtmlIssueReportTemplateExtensions.cs rename to src/Cake.Issues.Reporting.Generic/GenericIssueReportTemplateExtensions.cs index dd94ee0b..5fa3996c 100644 --- a/src/Cake.Issues.Reporting.Html/HtmlIssueReportTemplateExtensions.cs +++ b/src/Cake.Issues.Reporting.Generic/GenericIssueReportTemplateExtensions.cs @@ -1,22 +1,22 @@ -namespace Cake.Issues.Reporting.Html +namespace Cake.Issues.Reporting.Generic { using System; /// - /// Extensions for enumeration. + /// Extensions for enumeration. /// - internal static class HtmlIssueReportTemplateExtensions + internal static class GenericIssueReportTemplateExtensions { /// /// Returns the name of the embedded template file. /// /// Template for which the embedded file name should be returned. /// Name of the template file - public static string GetTemplateResourceName(this HtmlIssueReportTemplate template) + public static string GetTemplateResourceName(this GenericIssueReportTemplate template) { switch (template) { - case HtmlIssueReportTemplate.Diagnostic: + case GenericIssueReportTemplate.HtmlDiagnostic: return "Diagnostic.cshtml"; default: diff --git a/src/Cake.Issues.Reporting.Html/Properties/AssemblyInfo.cs b/src/Cake.Issues.Reporting.Generic/Properties/AssemblyInfo.cs similarity index 82% rename from src/Cake.Issues.Reporting.Html/Properties/AssemblyInfo.cs rename to src/Cake.Issues.Reporting.Generic/Properties/AssemblyInfo.cs index 82b94eb4..558fc450 100644 --- a/src/Cake.Issues.Reporting.Html/Properties/AssemblyInfo.cs +++ b/src/Cake.Issues.Reporting.Generic/Properties/AssemblyInfo.cs @@ -6,8 +6,8 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("Cake.Issues.Reporting.Html")] -[assembly: AssemblyDescription("Support for creating HTML issue reports from the Cake.Issues Addin for Cake Build Automation System")] +[assembly: AssemblyTitle("Cake.Issues.Reporting.Generic")] +[assembly: AssemblyDescription("Support for creating issue reports in any text based format (HTML, Markdown, ...) from the Cake.Issues Addin for Cake Build Automation System")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("BBT Software AG")] [assembly: AssemblyProduct("Cake.Issues")] @@ -37,4 +37,4 @@ [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: CLSCompliant(true)] -[assembly: InternalsVisibleTo("Cake.Issues.Reporting.Html.Tests")] \ No newline at end of file +[assembly: InternalsVisibleTo("Cake.Issues.Reporting.Generic.Tests")] \ No newline at end of file diff --git a/src/Cake.Issues.Reporting.Html/RazorEngineReferenceResolver.cs b/src/Cake.Issues.Reporting.Generic/RazorEngineReferenceResolver.cs similarity index 97% rename from src/Cake.Issues.Reporting.Html/RazorEngineReferenceResolver.cs rename to src/Cake.Issues.Reporting.Generic/RazorEngineReferenceResolver.cs index eb88226c..64b7bab9 100644 --- a/src/Cake.Issues.Reporting.Html/RazorEngineReferenceResolver.cs +++ b/src/Cake.Issues.Reporting.Generic/RazorEngineReferenceResolver.cs @@ -1,4 +1,4 @@ -namespace Cake.Issues.Reporting.Html +namespace Cake.Issues.Reporting.Generic { using System.Collections.Generic; using System.IO; diff --git a/src/Cake.Issues.Reporting.Html/Templates/Diagnostic.cshtml b/src/Cake.Issues.Reporting.Generic/Templates/Diagnostic.cshtml similarity index 100% rename from src/Cake.Issues.Reporting.Html/Templates/Diagnostic.cshtml rename to src/Cake.Issues.Reporting.Generic/Templates/Diagnostic.cshtml diff --git a/src/Cake.Issues.Reporting.Html/packages.config b/src/Cake.Issues.Reporting.Generic/packages.config similarity index 100% rename from src/Cake.Issues.Reporting.Html/packages.config rename to src/Cake.Issues.Reporting.Generic/packages.config diff --git a/src/Cake.Issues.Reporting.Html.Tests.ruleset b/src/Cake.Issues.Reporting.Html.Tests.ruleset deleted file mode 100644 index 86bde9f1..00000000 --- a/src/Cake.Issues.Reporting.Html.Tests.ruleset +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/Cake.Issues.Reporting.Html/HtmlIssueReportFormatSettings.cs b/src/Cake.Issues.Reporting.Html/HtmlIssueReportFormatSettings.cs deleted file mode 100644 index 69dfd0a7..00000000 --- a/src/Cake.Issues.Reporting.Html/HtmlIssueReportFormatSettings.cs +++ /dev/null @@ -1,90 +0,0 @@ -namespace Cake.Issues.Reporting.Html -{ - using System.IO; - using Core.IO; - - /// - /// Settings for . - /// - public class HtmlIssueReportFormatSettings - { - /// - /// Initializes a new instance of the class. - /// - /// Template to use for generating the HTML report. - protected HtmlIssueReportFormatSettings(HtmlIssueReportTemplate template) - { - using (var stream = this.GetType().Assembly.GetManifestResourceStream("Cake.Issues.Reporting.Html.Templates." + template.GetTemplateResourceName())) - { - using (var sr = new StreamReader(stream)) - { - this.Template = sr.ReadToEnd(); - } - } - } - - /// - /// Initializes a new instance of the class. - /// - /// Path to the template to use for generating the HTML report. - protected HtmlIssueReportFormatSettings(FilePath templatePath) - { - templatePath.NotNull(nameof(templatePath)); - - using (var stream = new FileStream(templatePath.FullPath, FileMode.Open, FileAccess.Read)) - { - using (var sr = new StreamReader(stream)) - { - this.Template = sr.ReadToEnd(); - } - } - } - - /// - /// Initializes a new instance of the class. - /// - /// Content of the template to use for generating the HTML report. - protected HtmlIssueReportFormatSettings(string templateContent) - { - templateContent.NotNullOrWhiteSpace(nameof(templateContent)); - - this.Template = templateContent; - } - - /// - /// Gets the template to use for generating the HTML report. - /// - public string Template { get; private set; } - - /// - /// Returns a new instance of the class from a template file on disk. - /// - /// Template to use for generating the HTML report. - /// Instance of the class. - public static HtmlIssueReportFormatSettings FromEmbeddedTemplate(HtmlIssueReportTemplate template) - { - return new HtmlIssueReportFormatSettings(template); - } - - /// - /// Returns a new instance of the class from a template file on disk. - /// - /// Path to the template to use for generating the HTML report. - /// Instance of the class. - public static HtmlIssueReportFormatSettings FromFilePath(FilePath templatePath) - { - return new HtmlIssueReportFormatSettings(templatePath); - } - - /// - /// Returns a new instance of the class from the content - /// of a template file. - /// - /// Content of the template to use for generating the HTML report. - /// Instance of the class. - public static HtmlIssueReportFormatSettings FromContent(string templateContent) - { - return new HtmlIssueReportFormatSettings(templateContent); - } - } -} diff --git a/src/Cake.Issues.Reporting.Html/HtmlIssueReportTemplate.cs b/src/Cake.Issues.Reporting.Html/HtmlIssueReportTemplate.cs deleted file mode 100644 index 92be14b2..00000000 --- a/src/Cake.Issues.Reporting.Html/HtmlIssueReportTemplate.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace Cake.Issues.Reporting.Html -{ - /// - /// Default templates provided by this addin. - /// - public enum HtmlIssueReportTemplate - { - /// - /// List of all issues with all properties. - /// - Diagnostic - } -}