Skip to content

Commit

Permalink
Merge pull request #126 from nils-a/release/0.3.0
Browse files Browse the repository at this point in the history
Release/0.3.0
  • Loading branch information
nils-a authored May 15, 2024
2 parents 626b528 + 0175b4d commit fee1464
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 56 deletions.
3 changes: 2 additions & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["github>cake-contrib/renovate-presets"],
"ignoreDeps": ["cake.tool"],
"packageRules": [
{
"description": "Do not update cake references inside the actual Cake.IntelliJ.Recipe",
"matchFileNames": ["**/Cake.IntelliJ.Recipe/Content/**/*"],
"matchFileNames": ["src/Cake.IntelliJ.Recipe/Content/**"],
"matchManagers": ["cake"],
"enabled": false
}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,39 +43,39 @@ jobs:

steps:
- name: Checkout the repository
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
- name: Fetch all tags and branches
run: git fetch --prune --unshallow
- name: Install .net
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0
uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0
with:
# gitReleaseManager needs 3.1, gitVersion needs 5.0
dotnet-version: |
3.1.x
5.0.x
7.0.x
- name: Cache Tools
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
with:
path: tools
key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }}
- name: Build project
uses: cake-build/cake-action@a6eb054329257c9e70a6c6bf01747ad6e1d9d52b # v1.4.1
uses: cake-build/cake-action@1223b6fa067ad192159f43b50cd4f953679b0934 # v2.0.0
with:
script-path: recipe.cake
target: CI
cake-version: tool-manifest
# currently, Cake.Recipe does not upload artifacts when run on gh-actions
- name: Upload Issues
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4
with:
if-no-files-found: warn
name: ${{ matrix.os }} Issues
path: |
BuildArtifacts/report.html
BuildArtifacts/**/coverlet/*.xml
- name: Upload Packages
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4
if: runner.os == 'Linux'
with:
if-no-files-found: warn
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/dependabot-cake.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/publishDocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ jobs:

steps:
- name: checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
with:
fetch-depth: 0 # GitVersion is somewhat irritated when fetch-depth is "1"....
ref: ${{ github.event.ref }}

- name: Cache Tools
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
with:
path: tools
key: ${{ runner.os }}-doc-tools-${{ hashFiles('recipe.cake') }}

- name: Publishing documentaiton
uses: cake-build/cake-action@a6eb054329257c9e70a6c6bf01747ad6e1d9d52b # v1.4.1
uses: cake-build/cake-action@1223b6fa067ad192159f43b50cd4f953679b0934 # v2.0.0
with:
script-path: recipe.cake
target: Force-Publish-Documentation
Expand Down
99 changes: 71 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,35 @@ Convention based Cake scripts for building IntelliJ plugins.

## Table of Contents

- [Install](#install)
- [Usage](#usage)
- [Discussion](#discussion)
- [Settings](#settings)
- [Publishing](#publishing)
- [Marketplace-ID](#marketplace-id)
- [Grade-Verbosity](#grade-verbosity)
- [Channels](#channels)
- [Changes to the template](#changes-to-the-template)
- [Readme](#user-content-readme)
- [Changelog](#user-content-changelog)
- [Releases and PreReleases](#releases-and-prereleases)
- [CI Systems](#ci-systems)
- [GitHub Actions](#github-actions)
- [AppVeyor](#appveyor)
- [Maintainer](#maintainer)
- [Contributing](#contributing)
- [Contributors](#contributors)
- [License](#license)
- [Cake.IntelliJ.Recipe](#cakeintellijrecipe)
- [Table of Contents](#table-of-contents)
- [Install](#install)
- [Usage](#usage)
- [Discussion](#discussion)
- [Settings](#settings)
- [Analyze](#analyze)
- [Channels](#channels)
- [Grade-Verbosity](#grade-verbosity)
- [Marketplace-ID](#marketplace-id)
- [PluginVerifier](#pluginverifier)
- [Publishing](#publishing)
- [Changes to the template](#changes-to-the-template)
- [Readme](#readme)
- [Changelog](#changelog)
- [Releases and PreReleases](#releases-and-prereleases)
- [CI Systems](#ci-systems)
- [GitHub Actions](#github-actions)
- [operating systems](#operating-systems)
- [java version](#java-version)
- [gradle](#gradle)
- [AppVeyor](#appveyor)
- [operating systems](#operating-systems-1)
- [java version](#java-version-1)
- [gradle](#gradle-1)
- [Maintainer](#maintainer)
- [Contributing](#contributing)
- [Contributors](#contributors)
- [License](#license)

## Install

Expand Down Expand Up @@ -69,14 +79,22 @@ If you have questions, search for an existing one, or create a new discussion on

## Settings

### Publishing
### Analyze

To publish the plugin to the [JetBrains Marketplace](https://plugins.jetbrains.com/) a [token](https://plugins.jetbrains.com/author/me/tokens) is required.
The token must be supplied in an environment variable and then picked up in the `gradle` build.
Default for plugins created from https://github.com/JetBrains/intellij-platform-plugin-template is to use the `PUBLISH_TOKEN` variable name.
The Cake target `IntelliJAnalyze` is run on every build and is used to run code analysis.

Also, as with the "normal" gradle-based publishing, the first publish of the plugin must be made manually.
The default in this target is to run the following gradle tasks:
`detekt`, `ktlintCheck`, and `verifyPlugin`.

If for some reason this should be changed (e.g. for plugins that do not use detekt and ktlint but rather depend on something different),
the tasks to invoke can be configured using the `intelliJAnalyzerTasks` setting.

```csharp
IntelliJBuildParameters.SetParameters(
// ... all other parameters ...
intelliJAnalyzerTasks: new[]{ "check", "verifyPlugin" }
);
```
### Channels

Settings with regard to publishing channels are:
Expand All @@ -89,19 +107,44 @@ Settings with regard to publishing channels are:

See [Releases and PreReleases](#releases-and-prereleases) for their meaning.

### Grade-Verbosity

The verbosity of running gradle has it's own setting: `gradleVerbosity`. (Default is set to `GradleLogLevel.Default`)

Keep in mind, that while setting Cake verbosity to `diagnostic`, secrets will still be secret.
However, setting gradle verbosity to `GradleLogLevel.Debug` will print out all secrets in the logs.

### Marketplace-ID

When publishing is automated, Twitter and Gitter messages can be created. To have them link to the plugin-page in the marketplace,
a setting of `marketplaceId` is needed. The `marketplaceId` can be fetched from the URL in the marketplace, e.g. for `https://plugins.jetbrains.com/plugin/15698-test-rider`, the `marketplaceId` is `15698-test-rider`.

All other settings for Twitter, Gitter and such follow [Cake.Recipe](https://cake-contrib.github.io/Cake.Recipe/docs/fundamentals/environment-variables#twitter).

### Grade-Verbosity
### PluginVerifier

The verbosity of running gradle has it's own setting: `gradleVerbosity`. (Default is set to `GradleLogLevel.Default`)
The gradle task `runPluginVerifier` runs the [JetBrains plugin verifier](https://github.com/JetBrains/intellij-plugin-verifier).
This task is "mapped" to the Cake target `Run-Plugin-Verifier` which runs on `CI` builds.
If running on CI builds is not desired for any reason, the setting `shouldRunPluginVerifier` can be used to disable the run.

Keep in mind, that while setting Cake verbosity to `diagnostic`, secrets will still be secret.
However, setting gradle verbosity to `GradleLogLevel.Debug` will print out all secrets in the logs.

Example: Do not run the plugin verifier, if the build runs on Linux (e.g. beacuse the GitHub actions Linux runner does not have enough
free space for the plugin verifier.)

```csharp
IntelliJBuildParameters.SetParameters(
// ... all other parameters ...
shouldRunPluginVerifier: !IsRunningOnLinux()
);
```

### Publishing

To publish the plugin to the [JetBrains Marketplace](https://plugins.jetbrains.com/) a [token](https://plugins.jetbrains.com/author/me/tokens) is required.
The token must be supplied in an environment variable and is then picked up in the `gradle` build.
Default for plugins created from https://github.com/JetBrains/intellij-platform-plugin-template is to use the `PUBLISH_TOKEN` variable name.

Also, as with the "normal" gradle-based publishing, the first publish of the plugin must be made manually.

## Changes to the template

Expand Down
3 changes: 3 additions & 0 deletions recipe.cake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ BuildParameters.SetParameters(

BuildParameters.PrintParameters(Context);

ToolSettings.SetToolPreprocessorDirectives(
gitReleaseManagerGlobalTool: "#tool dotnet:?package=GitReleaseManager.Tool&version=0.17.0");

ToolSettings.SetToolSettings(context: Context);

BuildParameters.Tasks.CleanTask
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.IntelliJ.Recipe/Cake.IntelliJ.Recipe.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CakeContrib.Guidelines" Version="1.4.0">
<PackageReference Include="CakeContrib.Guidelines" Version="1.5.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
5 changes: 2 additions & 3 deletions src/Cake.IntelliJ.Recipe/Content/analyzing.cake
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@ BuildParameters.Tasks.AnalyzeTask = Task("IntelliJAnalyze")
.FromPath(BuildParameters.SourceDirectoryPath)
.WithLogLevel(IntelliJBuildParameters.GradleVerbosity)
.WithProjectProperty("pluginVersion", buildVersion.SemVersion)
.WithTask("detekt")
.WithTask("ktlintCheck")
.WithTask("verifyPlugin")
.WithTask(IntelliJBuildParameters.IntelliJAnalyzerTasks)
.Run();
});


IntelliJBuildParameters.Tasks.RunPluginVerifierTask = Task("Run-Plugin-Verifier")
.IsDependentOn("IntelliJBuild")
.WithCriteria(() => IntelliJBuildParameters.ShouldRunPluginVerifier, "Plugin Verifier is disabled")
.Does<BuildVersion>((context, buildVersion) =>
{
Gradle
Expand Down
10 changes: 9 additions & 1 deletion src/Cake.IntelliJ.Recipe/Content/parameters.cake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public static class IntelliJBuildParameters
public static FilePath IntegrationTestScriptPath { get; private set; }
public static IntelliJBuildTasks Tasks { get; private set; }
public static IntelliJBuildPaths Paths { get; private set; }
public static bool ShouldRunPluginVerifier { get; private set; }
public static string[] IntelliJAnalyzerTasks { get; private set; }
static IntelliJBuildParameters()
{
Tasks = new IntelliJBuildTasks();
Expand All @@ -38,6 +40,8 @@ public static class IntelliJBuildParameters
context.Information("ShouldPublishPluginCiBuilds: {0}", ShouldPublishPluginCiBuilds);
context.Information("PluginChannelGradleProperty: {0}", PluginChannelGradleProperty);
context.Information("PluginVersionGradleProperty: {0}", PluginVersionGradleProperty);
context.Information("ShouldRunPluginVerifier: {0}", ShouldRunPluginVerifier);
context.Information("IntelliJAnalyzerTasks: {0}", string.Join(", ", IntelliJAnalyzerTasks));
}

public static void SetParameters(
Expand Down Expand Up @@ -118,7 +122,9 @@ public static class IntelliJBuildParameters
string marketplaceId = null,
GradleLogLevel gradleVerbosity = GradleLogLevel.Default,
DirectoryPath pluginBuildOutputPath = null,
DirectoryPath pluginPackOutputPath = null
DirectoryPath pluginPackOutputPath = null,
bool shouldRunPluginVerifier = true,
string[] intelliJAnalyzerTasks = null
)
{
if (context == null)
Expand Down Expand Up @@ -227,5 +233,7 @@ public static class IntelliJBuildParameters
PluginChannelGradleProperty = pluginChannelGradleProperty;
PluginVersionGradleProperty = pluginVersionGradleProperty;
Paths = IntelliJBuildPaths.GetPaths(context);
ShouldRunPluginVerifier = shouldRunPluginVerifier;
IntelliJAnalyzerTasks = intelliJAnalyzerTasks ?? new[] { "detekt", "ktlintCheck", "verifyPlugin" };
}
}

0 comments on commit fee1464

Please sign in to comment.