Skip to content

Commit

Permalink
Set Cake.Issues version in documentation using macro (#870)
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalberger authored Dec 29, 2024
1 parent b04c365 commit 62c9efc
Show file tree
Hide file tree
Showing 27 changed files with 115 additions and 147 deletions.
6 changes: 2 additions & 4 deletions docs/docs/documentation/issue-providers/docfx/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ use the [Cake.DocFx](https://cakebuild.net/extensions/cake-docfx/){target="_blan
To read issues from DocFx log files you need to import the core addin and the DocFx support:

```csharp
#addin "Cake.Issues" // (1)!
#addin "Cake.Issues.DocFx"
#addin nuget:?package=Cake.Issues&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.DocFx&version={{ cake_issues_version }}
```

--8<-- "snippets/pinning.md"

We need some global variables:

```csharp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ The following example prints the number of binary files which are not tracked by
To analyze Git repositories you need to import the core addin and the Git repository support:

```csharp
#addin "Cake.Issues" // (1)!
#addin "Cake.Issues.GitRepository"
#addin nuget:?package=Cake.Issues&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.GitRepository&version={{ cake_issues_version }}
```

--8<-- "snippets/pinning.md"

We need some global variables:

```csharp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ To call [JetBrains InspectCode] from a Cake script you need to add the `JetBrain
To read issues from InspectCode log files you need to import the core addin and the InspectCode support:

```csharp
#addin "Cake.Issues" // (1)!
#addin "Cake.Issues.InspectCode"
#addin nuget:?package=Cake.Issues&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.InspectCode&version={{ cake_issues_version }}
```

--8<-- "snippets/pinning.md"

We need some global variables:

```csharp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ To call [markdownlint-cli] from a Cake script you can use the [Cake.Markdownlint
To read issues from markdownlint-cli log files you need to import the core addin and the markdownlint support:

```csharp
#addin "Cake.Issues" // (1)!
#addin "Cake.Issues.Markdownlint"
#addin nuget:?package=Cake.Issues&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.Markdownlint&version={{ cake_issues_version }}
```

--8<-- "snippets/pinning.md"

We need some global variables:

```csharp
Expand Down
6 changes: 2 additions & 4 deletions docs/docs/documentation/issue-providers/msbuild/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ The following example will call MsBuild to build the solution and outputs the nu
To read issues from MsBuild log files you need to import the core addin and the MsBuild support:

```csharp
#addin "Cake.Issues" // (1)!
#addin "Cake.Issues.MsBuild"
#addin nuget:?package=Cake.Issues&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.MsBuild&version={{ cake_issues_version }}
```

--8<-- "snippets/pinning.md"

In this example the log file is written by the `XmlFileLogger` class from [MSBuild Extension Pack].
In order to use the above logger, the following line will download and install the tool from NuGet.org:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: GitHub pull request integration
description: Example how to write AppVeyor message to GitHub pull requests.
render_macros: false
---

This example shows how to write AppVeyor messages created by Cake.Issues to GitHub pull requests.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ the core pull request addin, the AppVeyor support and one or more issue provider
in this example for JetBrains InspectCode:

```csharp
#addin "Cake.Issues" // (1)!
#addin "Cake.Issues.InspectCode"
#addin "Cake.Issues.PullRequests"
#addin "Cake.Issues.PullRequests.AppVeyor"
#addin nuget:?package=Cake.Issues&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.InspectCode&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.PullRequests&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.PullRequests.AppVeyor&version={{ cake_issues_version }}
```

--8<-- "snippets/pinning.md"

In the following task we'll first determine the remote repository URL and
source branch of the pull request and with this information call the
[AppVeyorBuilds](https://cakebuild.net/api/Cake.Issues.PullRequests.AppVeyor/AppVeyorBuildsAliases/){target="_blank"} alias:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ the core pull request addin, the Azure DevOps support including the Cake.AzureDe
in this example for JetBrains InspectCode:

```csharp
#addin "Cake.Issues" // (1)!
#addin "Cake.Issues.InspectCode"
#addin "Cake.Issues.PullRequests"
#addin "Cake.Issues.PullRequests.AzureDevOps"
#addin "Cake.AzureDevOps"
#addin nuget:?package=Cake.Issues&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.InspectCode&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.PullRequests&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.PullRequests.AzureDevOps&version={{ cake_issues_version }}
#addin "Cake.AzureDevOps" // (1)!
```

--8<-- "snippets/pinning.md"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,21 @@ This example shows how to write issues as comments to an Azure DevOps pull reque
To determine the remote repository URL you need the [Cake.Git](https://cakebuild.net/extensions/cake-git/){target="_blank"} addin:

```csharp
#addin "Cake.Git"
#addin "Cake.Git" // (1)!
```

--8<-- "snippets/pinning.md"

To write issues as comments to Azure DevOps pull requests you need to import the core addin,
the core pull request addin, the Azure DevOps support including the Cake.AzureDevOps addin, and one or more issue providers,
in this example for JetBrains InspectCode:

```csharp
#addin "Cake.Issues" // (1)!
#addin "Cake.Issues.InspectCode"
#addin "Cake.Issues.PullRequests"
#addin "Cake.Issues.PullRequests.AzureDevOps"
#addin "Cake.AzureDevOps"
#addin nuget:?package=Cake.Issues&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.InspectCode&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.PullRequests&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.PullRequests.AzureDevOps&version={{ cake_issues_version }}
#addin "Cake.AzureDevOps" // (1)!
```

--8<-- "snippets/pinning.md"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,21 @@ To determine the remote repository URL and source branch of the pull request you
addin:

```csharp
#addin "Cake.Git"
#addin "Cake.Git" // (1)!
```

--8<-- "snippets/pinning.md"

To write issues as comments to Azure DevOps pull requests you need to import the core addin,
the core pull request addin, the Azure DevOps support including the Cake.AzureDevOps addin, and one or more issue providers,
in this example for JetBrains InspectCode:

```csharp
#addin "Cake.Issues" // (1)!
#addin "Cake.Issues.InspectCode"
#addin "Cake.Issues.PullRequests"
#addin "Cake.Issues.PullRequests.AzureDevOps"
#addin "Cake.AzureDevOps"
#addin nuget:?package=Cake.Issues&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.InspectCode&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.PullRequests&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.PullRequests.AzureDevOps&version={{ cake_issues_version }}
#addin "Cake.AzureDevOps" // (1)!
```

--8<-- "snippets/pinning.md"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ the core pull request addin, the GitHub Actions support and one or more issue pr
in this example for JetBrains InspectCode:

```csharp
#addin "Cake.Issues" // (1)!
#addin "Cake.Issues.InspectCode"
#addin "Cake.Issues.PullRequests"
#addin "Cake.Issues.PullRequests.GitHubActions"
#addin nuget:?package=Cake.Issues&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.InspectCode&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.PullRequests&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.PullRequests.GitHubActions&version={{ cake_issues_version }}
```

--8<-- "snippets/pinning.md"

In the following task we'll first determine the remote repository URL and
source branch of the pull request and with this information call the
[GitHubActionsBuilds](https://cakebuild.net/api/Cake.Issues.PullRequests.GitHubActions/GitHubActionsBuildsAliases/){target="_blank"} alias:
Expand Down
68 changes: 34 additions & 34 deletions docs/docs/documentation/recipe/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,43 +37,43 @@ Cake.Issues recipes will add the following addins to your build:

=== "Cake.Issues.Recipe"

| Addin | Version | Remarks |
|-----------------------------------------------------------|---------|-|
| [Cake.Git]{target="_blank"} | 5.0.1 | Only used if `RepositoryInfoProvider` type is set to `RepositoryInfoProviderType.CakeGit`. See [Git repository information configuration] for details. |
| [Cake.Issues]{target="_blank"} | 5.0.1 | |
| [Cake.Issues.MsBuild]{target="_blank"} | 5.0.1 | |
| [Cake.Issues.InspectCode]{target="_blank"} | 5.0.1 | |
| [Cake.Issues.Markdownlint]{target="_blank"} | 5.0.1 | |
| [Cake.Issues.EsLint]{target="_blank"} | 5.0.1 | |
| [Cake.Issues.Sarif]{target="_blank"} | 5.0.1 | |
| [Cake.Issues.Reporting]{target="_blank"} | 5.0.1 | |
| [Cake.Issues.Reporting.Generic]{target="_blank"} | 5.0.1 | |
| [Cake.Issues.Reporting.Sarif]{target="_blank"} | 5.0.1 | |
| [Cake.Issues.PullRequests]{target="_blank"} | 5.0.1 | |
| [Cake.Issues.PullRequests.AppVeyor]{target="_blank"} | 5.0.1 | |
| [Cake.Issues.PullRequests.AzureDevOps]{target="_blank"} | 5.0.1 | |
| [Cake.Issues.PullRequests.GitHubActions]{target="_blank"} | 5.0.1 | |
| [Cake.AzureDevOps]{target="_blank"} | 5.0.0 | |
| Addin | Version | Remarks |
|-----------------------------------------------------------|---------------------------|-|
| [Cake.Git]{target="_blank"} | 5.0.1 | Only used if `RepositoryInfoProvider` type is set to `RepositoryInfoProviderType.CakeGit`. See [Git repository information configuration] for details. |
| [Cake.Issues]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.Issues.MsBuild]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.Issues.InspectCode]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.Issues.Markdownlint]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.Issues.EsLint]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.Issues.Sarif]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.Issues.Reporting]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.Issues.Reporting.Generic]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.Issues.Reporting.Sarif]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.Issues.PullRequests]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.Issues.PullRequests.AppVeyor]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.Issues.PullRequests.AzureDevOps]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.Issues.PullRequests.GitHubActions]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.AzureDevOps]{target="_blank"} | 5.0.0 | |

=== "Cake.Frosting.Issues.Recipe"

| Addin | Version | Remarks |
|--------------------------------------------------------------------------|---------|-|
| [Cake.Frosting.Git]{target="_blank"} | 5.0.1 | Only used if `RepositoryInfoProvider` type is set to `RepositoryInfoProviderType.CakeGit`. See [Git repository information configuration] for details. |
| [Cake.Issues]{target="_blank"} | 5.0.1 | |
| [Cake.Frosting.Issues.MsBuild]{target="_blank"} | 5.0.1 | |
| [Cake.Frosting.Issues.InspectCode]{target="_blank"} | 5.0.1 | |
| [Cake.Frosting.Issues.Markdownlint]{target="_blank"} | 5.0.1 | |
| [Cake.Frosting.Issues.EsLint]{target="_blank"} | 5.0.1 | |
| [Cake.Frosting.Issues.Sarif]{target="_blank"} | 5.0.1 | |
| [Cake.Frosting.Issues.Reporting]{target="_blank"} | 5.0.1 | |
| [Cake.Frosting.Issues.Reporting.Generic]{target="_blank"} | 5.0.1 | |
| [Cake.Frosting.Issues.Reporting.Sarif]{target="_blank"} | 5.0.1 | |
| [Cake.Frosting.Issues.PullRequests]{target="_blank"} | 5.0.1 | |
| [Cake.Frosting.Issues.PullRequests.AppVeyor]{target="_blank"} | 5.0.1 | |
| [Cake.Frosting.Issues.PullRequests.AzureDevOps]{target="_blank"} | 5.0.1 | |
| [Cake.Frosting.Issues.PullRequests.GitHubActions]{target="_blank"} | 5.0.1 | |
| [Cake.AzureDevOps]{target="_blank"} | 5.0.0 | |
| Addin | Version | Remarks |
|--------------------------------------------------------------------|---------------------------|-|
| [Cake.Frosting.Git]{target="_blank"} | 5.0.1 | Only used if `RepositoryInfoProvider` type is set to `RepositoryInfoProviderType.CakeGit`. See [Git repository information configuration] for details. |
| [Cake.Issues]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.Frosting.Issues.MsBuild]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.Frosting.Issues.InspectCode]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.Frosting.Issues.Markdownlint]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.Frosting.Issues.EsLint]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.Frosting.Issues.Sarif]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.Frosting.Issues.Reporting]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.Frosting.Issues.Reporting.Generic]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.Frosting.Issues.Reporting.Sarif]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.Frosting.Issues.PullRequests]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.Frosting.Issues.PullRequests.AppVeyor]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.Frosting.Issues.PullRequests.AzureDevOps]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.Frosting.Issues.PullRequests.GitHubActions]{target="_blank"} | {{ cake_issues_version }} | |
| [Cake.AzureDevOps]{target="_blank"} | 5.0.0 | |

[Cake.Issues.Recipe]: https://www.nuget.org/packages/Cake.Issues.Recipe
[Cake.Frosting.Issues.Recipe]: https://www.nuget.org/packages/Cake.Frosting.Issues.Recipe
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/documentation/report-formats/console/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ The following example will print issues logged as warnings by MsBuild to the con

```csharp
#tool "nuget:?package=MSBuild.Extension.Pack" // (1)!
#addin "Cake.Issues"
#addin "Cake.Issues.MsBuild"
#addin "Cake.Issues.Reporting"
#addin "Cake.Issues.Reporting.Console"
#addin nuget:?package=Cake.Issues&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.MsBuild&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.Reporting&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.Reporting.Console&version={{ cake_issues_version }}

Task("Create-IssueReport").Does(() =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ The following example will create a HTML report for issues logged as warnings by

```csharp
#tool "nuget:?package=MSBuild.Extension.Pack" // (1)!
#addin "Cake.Issues"
#addin "Cake.Issues.MsBuild"
#addin "Cake.Issues.Reporting"
#addin "Cake.Issues.Reporting.Generic"
#addin nuget:?package=Cake.Issues&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.MsBuild&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.Reporting&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.Reporting.Generic&version={{ cake_issues_version }}

Task("Create-IssueReport").Does(() =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ The following example will create a HTML report for issues logged as warnings by

```csharp
#tool "nuget:?package=MSBuild.Extension.Pack" // (1)!
#addin "Cake.Issues"
#addin "Cake.Issues.MsBuild"
#addin "Cake.Issues.Reporting"
#addin "Cake.Issues.Reporting.Generic"
#addin nuget:?package=Cake.Issues&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.MsBuild&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.Reporting&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.Reporting.Generic&version={{ cake_issues_version }}

Task("Create-IssueReport").Does(() =>
{
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/documentation/report-formats/sarif/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ The following example will create a SARIF report for issues logged as warnings b

```csharp
#tool "nuget:?package=MSBuild.Extension.Pack" // (1)!
#addin "Cake.Issues"
#addin "Cake.Issues.MsBuild"
#addin "Cake.Issues.Reporting"
#addin "Cake.Issues.Reporting.Sarif"
#addin nuget:?package=Cake.Issues&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.MsBuild&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.Reporting&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.Reporting.Sarif&version={{ cake_issues_version }}

Task("Create-IssueReport").Does(() =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ The `Cake.Issues` addin can be used to break builds if specific issues were repo
To break builds you need to import the following core addin:

```csharp
#addin "Cake.Issues" // (1)!
#addin nuget:?package=Cake.Issues&version={{ cake_issues_version }}
```

--8<-- "snippets/pinning.md"

The following task will fail the build if any issues were added to the `issues` global variable:

```csharp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ This issues can for example be used to create reports.
To create issues you need to import the following core addin:

```csharp
#addin "Cake.Issues" // (1)!
#addin nuget:?package=Cake.Issues&version={{ cake_issues_version }}
```

--8<-- "snippets/pinning.md"

In the following task a new warning for the myfile.txt file on line 42 is created:

```csharp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,19 @@ description: Usage instructions how to create reports.
To create report for issues you need to import the following core addins:

```csharp
#addin "Cake.Issues" // (1)!
#addin "Cake.Issues.Reporting"
#addin nuget:?package=Cake.Issues&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.Reporting&version={{ cake_issues_version }}
```

--8<-- "snippets/pinning.md"

Also you need to import at least one issue provider and report format.
In the following example the issue provider for reading warnings from MsBuild log files
and generic report format is imported:

```csharp
#addin "Cake.Issues.MsBuild" // (1)!
#addin "Cake.Issues.Reporting.Generic"
#addin nuget:?package=Cake.Issues.MsBuild&version={{ cake_issues_version }}
#addin nuget:?package=Cake.Issues.Reporting.Generic&version={{ cake_issues_version }}
```

--8<-- "snippets/pinning.md"

Finally you can define a task where you call the reporting addin with the desired issue provider and report format:

```csharp
Expand Down
Loading

0 comments on commit 62c9efc

Please sign in to comment.