forked from cake-contrib/Cake.Issues.Recipe
-
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.
(GH-17) Add support for loading generic reporter dynamically
- Loading branch information
1 parent
c2d76ea
commit 51ad9e3
Showing
6 changed files
with
151 additions
and
71 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
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
38 changes: 38 additions & 0 deletions
38
Cake.Issues.Recipe/Content/reporters/GenericReporterData.cake
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,38 @@ | ||
public class GenericReporterData : AddinData | ||
{ | ||
private static GenericReporterData _reporter = null; | ||
|
||
private GenericReporterData(ICakeContext context) | ||
: base(context, "Cake.Issues.Reporting.Generic", CakeIssuesReportingGenericVersion) | ||
{ | ||
_reporter = this; | ||
} | ||
|
||
public static GenericReporterData GetReporter(ICakeContext context) | ||
{ | ||
return _reporter ?? new GenericReporterData(context); | ||
} | ||
|
||
public static IIssueReportFormat CreateIssueFormatFromEmbeddedTemplate(ICakeContext context, IssuesParametersReporting parameters) | ||
{ | ||
var reporter = GetReporter(context); | ||
|
||
var settings = reporter.CallStaticMethod("FromEmbeddedTemplate", "HtmlDxDataGrid"); | ||
|
||
var theme = "DevExtremeTheme.MaterialBlueLight"; // Should be changed to be set on IssuesParametersReporting settings class. | ||
reporter.CallStaticMethod("WithOption", settings, "HtmlDxDataGridOption.Theme", theme); | ||
|
||
var issueFormat = (IIssueReportFormat)reporter.CallStaticMethod("GenericIssueReportFormat", context, settings); | ||
|
||
return issueFormat; | ||
} | ||
|
||
public static IIssueReportFormat CreateIssueFormatFromFilePath(ICakeContext context, IssuesParametersReporting parameters, FilePath reportPath) | ||
{ | ||
var reporter = GetReporter(context); | ||
|
||
var issueFormat = (IIssueReportFormat)reporter.CallStaticMethod("GenericIssueReportFormatFromFilePath", context, reportPath); | ||
|
||
return issueFormat; | ||
} | ||
} |
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 @@ | ||
#load ./GenericReporterData.cake |
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