Skip to content

Commit

Permalink
Merge branch 'release/0.3.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger committed Jul 14, 2020
2 parents 3a3267d + 1a2e45a commit d54e012
Show file tree
Hide file tree
Showing 12 changed files with 81 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
install:
# Update to latest NuGet version since we require 5.3.0 for embedded icon
- ps: nuget update -self
- ps: Install-Product node 14
- ps: choco install markdownlint-cli --no-progress

build_script:
- ps: .\build.ps1 -Target AppVeyor
Expand All @@ -27,4 +29,4 @@ branches:
# Build Cache #
#---------------------------------#
cache:
- tools -> setup.cake
- tools -> recipe.cake
2 changes: 1 addition & 1 deletion Cake.Issues.Recipe/Cake.Issues.Recipe.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ See the Project Site for documentation and an overview of the whole ecosystem of
<repository type="git" url="https://github.com/cake-contrib/Cake.Issues.Recipe.git"/>
<copyright>Copyright © Pascal Berger</copyright>
<tags>Build Cake Cake.Issues Recipe</tags>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues.Recipe/releases/tag/0.3.3</releaseNotes>
<releaseNotes>https://github.com/cake-contrib/Cake.Issues.Recipe/releases/tag/0.3.4</releaseNotes>
</metadata>
</package>
1 change: 1 addition & 0 deletions Cake.Issues.Recipe/Content/addins.cake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#addin nuget:?package=Cake.Issues&version=0.8.1
#addin nuget:?package=Cake.Issues.MsBuild&version=0.8.0
#addin nuget:?package=Cake.Issues.InspectCode&version=0.8.0
#addin nuget:?package=Cake.Issues.Markdownlint&version=0.8.2
#addin nuget:?package=Cake.Issues.Reporting&version=0.8.0
#addin nuget:?package=Cake.Issues.Reporting.Generic&version=0.8.2
#addin nuget:?package=Cake.Issues.PullRequests&version=0.8.1
Expand Down
18 changes: 17 additions & 1 deletion Cake.Issues.Recipe/Content/build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,22 @@ IssuesBuildTasks.ReadIssuesTask = Task("Read-Issues")
IssuesParameters.InputFiles.InspectCodeLogFilePath));
}

if (IssuesParameters.InputFiles.MarkdownlintCliLogFilePath != null)
{
issueProviders.Add(
MarkdownlintIssuesFromFilePath(
IssuesParameters.InputFiles.MarkdownlintCliLogFilePath,
MarkdownlintCliLogFileFormat));
}

if (IssuesParameters.InputFiles.MarkdownlintV1LogFilePath != null)
{
issueProviders.Add(
MarkdownlintIssuesFromFilePath(
IssuesParameters.InputFiles.MarkdownlintV1LogFilePath,
MarkdownlintLogFileFormat));
}

if (!issueProviders.Any())
{
Information("No files to process...");
Expand Down Expand Up @@ -98,7 +114,7 @@ IssuesBuildTasks.CreateFullIssuesReportTask = Task("Create-FullIssuesReport")
EnsureDirectoryExists(IssuesParameters.OutputDirectory);

// Create HTML report using DevExpress template.
var settings =
var settings =
GenericIssueReportFormatSettings
.FromEmbeddedTemplate(GenericIssueReportTemplate.HtmlDxDataGrid)
.WithOption(HtmlDxDataGridOption.Theme, DevExtremeTheme.MaterialBlueLight);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,14 @@ public class IssuesParametersInputFiles
/// Gets or sets the path to the InspectCode log file.
/// </summary>
public FilePath InspectCodeLogFilePath { get; set; }

/// <summary>
/// Gets or sets the path to the markdownlint-cli log file.
/// </summary>
public FilePath MarkdownlintCliLogFilePath { get; set; }

/// <summary>
/// Gets or sets the path to the markdownlint log file in version 1.
/// </summary>
public FilePath MarkdownlintV1LogFilePath { get; set; }
}
13 changes: 12 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,25 @@ jobs:
pool:
vmImage: 'vs2017-win2016'
steps:
- task: NodeTool@0
inputs:
versionSpec: '14.x'
- powershell: choco install markdownlint-cli --no-progress
displayName: 'Install required tools'
- powershell: ./build.ps1 -target Run-Integration-Tests
displayName: 'Integration Tests'
- job: macOS
pool:
vmImage: 'macOS-10.14'
steps:
- task: NodeTool@0
inputs:
versionSpec: '14.x'
- bash: |
npm install -g markdownlint-cli
displayName: 'Install required tools'
# To manually select a Xamarin SDK version on the Hosted macOS agent, enable this script with the SDK version you want to target
# https://go.microsoft.com/fwlink/?linkid=871629
# https://go.microsoft.com/fwlink/?linkid=871629
- bash: |
sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 5_18_1
displayName: 'Select Mono 5.18.1'
Expand Down
4 changes: 3 additions & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ and behavior of Cake.Issues.Recipe.
|---------------------------------------------------------------|---------------|--------------------------------------------------------|
| `IssuesParameters.InputFiles.MsBuildXmlFileLoggerLogFilePath` | `null` | Path to the MSBuild log file created by XmlFileLogger. |
| `IssuesParameters.InputFiles.MsBuildBinaryLogFilePath` | `null` | Path to the MSBuild binary log file. |
| `IssuesParameters.InputFiles.InspectCodeLogFilePath` | `null` | Path to the JetBrains InspectCoe log file. |
| `IssuesParameters.InputFiles.InspectCodeLogFilePath` | `null` | Path to the JetBrains InspectCode log file. |
| `IssuesParameters.InputFiles.MarkdownlintCliLogFilePath` | `null` | Path to the markdownlint-cli log file. |
| `IssuesParameters.InputFiles.MarkdownlintV1LogFilePath` | `null` | Path to the markdownlint log file in version 1. |

# Report creation

Expand Down
4 changes: 4 additions & 0 deletions docs/supported-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ Cake.Issues.Recipe supports reading issues from output of the following tools:
| MsBuild | [MSBuild Extension Pack XmlFileLogger] | `IssuesParameters.InputFiles.MsBuildXmlFileLoggerLogFilePath` |
| MsBuild | Binary Log File | `IssuesParameters.InputFiles.MsBuildBinaryLogFilePath` |
| JetBrains InspectCode (ReSharper) | | `IssuesParameters.InputFiles.InspectCodeLogFilePath` |
| markdownlint | [markdownlint-cli] | `IssuesParameters.InputFiles.MarkdownlintCliLogFilePath` |
| markdownlint | [markdownlint] version 1 | `IssuesParameters.InputFiles.MarkdownlintV1LogFilePath` |

[MSBuild Extension Pack XmlFileLogger]: http://www.msbuildextensionpack.com/help/4.0.5.0/html/242ab4fd-c2e2-f6aa-325b-7588725aed24.htm
[markdownlint-cli]: https://github.com/igorshubovych/markdownlint-cli
[markdownlint]: https://github.com/DavidAnson/markdownlint

# Build systems

Expand Down
2 changes: 1 addition & 1 deletion recipe.cake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#load nuget:?package=Cake.Recipe&version=1.0.0
#load nuget:https://www.myget.org/F/cake-contrib/api/v2?package=Cake.Recipe&version=1.1.2-beta0001&prerelease

Environment.SetVariableNames();

Expand Down
3 changes: 3 additions & 0 deletions tests/integration/buildData.cake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ public class BuildData

public FilePath InspectCodeLogFilePath { get; }

public FilePath MarkdownlintCliLogFilePath { get; }

public BuildData(ICakeContext context)
{
if (context == null)
Expand All @@ -17,5 +19,6 @@ public class BuildData

this.MsBuildLogFilePath = IssuesParameters.OutputDirectory.CombineWithFilePath("msbuild.log");
this.InspectCodeLogFilePath = IssuesParameters.OutputDirectory.CombineWithFilePath("inspectCode.log");
this.MarkdownlintCliLogFilePath = IssuesParameters.OutputDirectory.CombineWithFilePath("markdownlintCli.log");
}
}
7 changes: 7 additions & 0 deletions tests/integration/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# foo
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean fermentum dictum mauris, sed feugiat nibh rutrum eget. Fusce sed purus nec sem faucibus semper sed id est. Cras vestibulum leo nec ipsum posuere eleifend. Nullam iaculis quam in sapien efficitur consequat. In hac habitasse platea dictumst. Interdum et malesuada fames ac ante ipsum primis in faucibus. Vivamus pulvinar bibendum sapien ac ultrices. Sed imperdiet mi non felis imperdiet, at interdum ante volutpat. Pellentesque eu cursus dolor, non iaculis ipsum. Quisque in tortor viverra, sodales nibh vitae, vehicula urna. Integer dolor mauris, condimentum ac accumsan quis, placerat eget tellus. Duis volutpat interdum nisi, vel efficitur nisl viverra vitae. Maecenas eget lacus vel lacus congue lobortis. Etiam ornare dictum nulla nec commodo.

# bar
```
Praesent euismod est vel quam volutpat ultrices. Cras luctus lorem quis nibh tincidunt, a auctor velit fermentum. Cras et nisl neque. Sed mi lorem, efficitur et purus eu, vehicula ornare felis. Aliquam sagittis ultricies sem, nec dignissim erat porta at. Suspendisse in justo lacus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Pellentesque ornare neque porttitor tortor auctor lobortis posuere id dui. Phasellus et felis a nibh viverra cursus ut blandit ante. Suspendisse lacus tortor, pharetra non pulvinar vulputate, semper sed augue. Aenean feugiat finibus quam quis iaculis. Maecenas ac quam quis risus scelerisque rhoncus. Donec eget aliquam metus. Nam feugiat sem dui, quis consectetur lorem lobortis in. Maecenas eu bibendum sapien.
```
21 changes: 19 additions & 2 deletions tests/integration/tests.cake
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#load "../../Cake.Issues.Recipe/Content/build.cake"
#load "buildData.cake"

#addin "Cake.Markdownlint"

#tool "nuget:?package=JetBrains.ReSharper.CommandLineTools"
#tool "nuget:?package=MSBuild.Extension.Pack"

Expand Down Expand Up @@ -47,7 +49,7 @@ Task("Build")
data.IssuesData.RepositoryRootDirectory
.Combine("src")
.CombineWithFilePath("ClassLibrary1.sln");

Information("Restoring NuGet package for {0}...", solutionFile);
NuGetRestore(solutionFile);

Expand Down Expand Up @@ -90,8 +92,23 @@ Task("Run-InspectCode")
IssuesParameters.InputFiles.InspectCodeLogFilePath = data.InspectCodeLogFilePath;
});

Task("Lint-Documentation")
.Does<BuildData>((data) =>
{
var settings =
MarkdownlintNodeJsRunnerSettings.ForDirectory(
data.IssuesData.RepositoryRootDirectory.Combine("docs"));
settings.OutputFile = data.MarkdownlintCliLogFilePath;
settings.ThrowOnIssue = false;
RunMarkdownlintNodeJs(settings);

// Pass path to markdownlint-cli log file to Cake.Issues.Recipe
IssuesParameters.InputFiles.MarkdownlintCliLogFilePath = data.MarkdownlintCliLogFilePath;
});

Task("Lint")
.IsDependentOn("Run-InspectCode");
.IsDependentOn("Run-InspectCode")
.IsDependentOn("Lint-Documentation");

// Make sure build and linters run before issues task.
IssuesBuildTasks.ReadIssuesTask
Expand Down

0 comments on commit d54e012

Please sign in to comment.