From 7aa1a4876676c9c2f61950121b665ebffdd6c2f1 Mon Sep 17 00:00:00 2001 From: Jakub Chrzanowski Date: Mon, 12 Oct 2020 17:56:08 +0200 Subject: [PATCH] Introduced `platformPlugins` property in `gradle.properties` for configuring dependencies to bundled/external plugins --- .github/workflows/build.yml | 4 ++-- CHANGELOG.md | 3 +++ README.md | 21 +++++++++++---------- build.gradle.kts | 7 +++---- gradle.properties | 3 +++ 5 files changed, 22 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 63fb1b8..624c143 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,7 +53,7 @@ jobs: uses: actions/cache@v2 with: path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }} + key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }} # Cache Gradle Wrapper - name: Setup Gradle Wrapper Cache @@ -98,7 +98,7 @@ jobs: uses: actions/cache@v2 with: path: ~/.gradle/caches - key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }} + key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }} # Cache Gradle Wrapper - name: Setup Gradle Wrapper Cache diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bb24df..ca8c9f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ # IntelliJ Platform Plugin Template Changelog ## [Unreleased] +### Added +- Introduced `platformPlugins` property in `gradle.properties` for configuring dependencies to bundled/external plugins + ### Changed - Disable "Release Draft" job for pull requests in the "Build" GitHub Actions Workflow - Dependencies - upgrade `org.jetbrains.intellij` to 0.5.0 diff --git a/README.md b/README.md index ce052a5..9cd8b40 100644 --- a/README.md +++ b/README.md @@ -71,16 +71,17 @@ The most significant parts of the current configuration are: The project-specific configuration file [gradle.properties][file:gradle.properties] contains: -| Property name | Description | -| ------------------------- | ------------------------------------------------------------------------------------------ | -| `pluginGroup` | Package name - after *using* the template, this will be set to `com.github.username.repo`. | -| `pluginName` | Plugin name displayed in the Marketplace and the Plugins Repository. | -| `pluginVersion` | The current version of the plugin. | -| `pluginSinceBuild` | The `since-build` attribute of the tag. | -| `pluginUntilBuild` | The `until-build` attribute of the tag. | -| `platformType` | The type of IDE distribution. | -| `platformVersion` | The version of the IntelliJ Platform IDE that will be used to build the plugin. | -| `platformDownloadSources` | IDE sources downloaded while initializing the Gradle build. | +| Property name | Description | +| ------------------------- | --------------------------------------------------------------------------------------------------------- | +| `pluginGroup` | Package name - after *using* the template, this will be set to `com.github.username.repo`. | +| `pluginName` | Plugin name displayed in the Marketplace and the Plugins Repository. | +| `pluginVersion` | The current version of the plugin. | +| `pluginSinceBuild` | The `since-build` attribute of the tag. | +| `pluginUntilBuild` | The `until-build` attribute of the tag. | +| `platformType` | The type of IDE distribution. | +| `platformVersion` | The version of the IntelliJ Platform IDE that will be used to build the plugin. | +| `platformDownloadSources` | IDE sources downloaded while initializing the Gradle build. | +| `platformPlugins` | Comma-separated list of dependencies to the bundled IDE plugins and plugins from the Plugin Repositories. | The properties listed define the plugin itself or configure the [gradle-intellij-plugin][gh:gradle-intellij-plugin] – check its documentation for more details. diff --git a/build.gradle.kts b/build.gradle.kts index 0147266..02a4527 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -29,6 +29,7 @@ val pluginUntilBuild: String by project val platformType: String by project val platformVersion: String by project +val platformPlugins: String by project val platformDownloadSources: String by project group = pluginGroup @@ -52,10 +53,8 @@ intellij { downloadSources = platformDownloadSources.toBoolean() updateSinceUntilBuild = true -// Plugin Dependencies: -// https://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_dependencies.html -// -// setPlugins("java") + // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file. + setPlugins(*platformPlugins.split(',').map(String::trim).filter(String::isNotEmpty).toTypedArray()) } // Configure detekt plugin. diff --git a/gradle.properties b/gradle.properties index c31346c..5b8e34a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,6 +10,9 @@ pluginUntilBuild = 202.* platformType = IC platformVersion = 2019.3 platformDownloadSources = true +# Plugin Dependencies -> https://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_dependencies.html +# Example: platformPlugins = com.intellij.java,com.jetbrains.php:203.4449.22 +platformPlugins = # Opt-out flag for bundling Kotlin standard library. # See https://kotlinlang.org/docs/reference/using-gradle.html#dependency-on-the-standard-library for details.