From 2401c70b78b7d8ca5a62365c05e5be27b2a90922 Mon Sep 17 00:00:00 2001 From: Darren Reid Date: Tue, 6 Jul 2021 15:58:49 +1000 Subject: [PATCH 1/2] Migrate to new intellij plugin version and to Kotlin script for gradle build.gradle.kts. --- src/ServiceStackIDEA/build.gradle | 38 ------------- src/ServiceStackIDEA/build.gradle.kts | 74 ++++++++++++++++++++++++++ src/ServiceStackIDEA/gradle.properties | 27 ++++++++++ 3 files changed, 101 insertions(+), 38 deletions(-) delete mode 100644 src/ServiceStackIDEA/build.gradle create mode 100644 src/ServiceStackIDEA/build.gradle.kts create mode 100644 src/ServiceStackIDEA/gradle.properties diff --git a/src/ServiceStackIDEA/build.gradle b/src/ServiceStackIDEA/build.gradle deleted file mode 100644 index a0386db..0000000 --- a/src/ServiceStackIDEA/build.gradle +++ /dev/null @@ -1,38 +0,0 @@ -plugins { - id "org.jetbrains.intellij" version "0.6.5" -} -version = '1.0.43' -repositories { - mavenCentral() -} -tasks.buildSearchableOptions { - enabled = false -} -apply plugin: 'org.jetbrains.intellij' -dependencies { - -} -Properties properties = System.properties -if(System.env.BUILD_NUMBER != null && System.env.SERVICESTACKIDEA_PUBLISH_NIGHTLY != null) { - // Append build number to version for a new nightly build version to be published. - version = "${version}.$System.env.BUILD_NUMBER" -} - -String jbToken - -if (properties.getProperty("jetbrains.plugins.user", null) == null) { - properties.load(project.file('./local.properties').newDataInputStream()) -} -jbToken = properties.getProperty("jetbrains.plugins.token") - -intellij { - version '2019.2' - plugins = ['maven','java'] - pluginName 'ServiceStackIDEA' - updateSinceUntilBuild false - - publishPlugin { - token jbToken - channels 'beta' - } -} diff --git a/src/ServiceStackIDEA/build.gradle.kts b/src/ServiceStackIDEA/build.gradle.kts new file mode 100644 index 0000000..4c85f3c --- /dev/null +++ b/src/ServiceStackIDEA/build.gradle.kts @@ -0,0 +1,74 @@ +import io.gitlab.arturbosch.detekt.Detekt +import org.jetbrains.changelog.markdownToHTML +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import java.io.FileInputStream +import java.util.* + +fun properties(key: String) = project.findProperty(key).toString() + +plugins { + id("org.jetbrains.kotlin.jvm") version "1.5.10" + // gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin + id("org.jetbrains.intellij") version "1.0" + // gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin + id("org.jetbrains.changelog") version "1.1.2" + // detekt linter - read more: https://detekt.github.io/detekt/gradle.html + id("io.gitlab.arturbosch.detekt") version "1.17.1" + // ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle + id("org.jlleitschuh.gradle.ktlint") version "10.0.0" +} +version = properties("pluginVersion") +// Configure project's dependencies +repositories { + mavenCentral() +} +dependencies { + detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.17.1") +} + +intellij { + version.set("2019.2") + pluginName.set("ServiceStackIDEA") + plugins.set(listOf("maven","java")) +} + +var pubNightly: String? = System.getenv("SERVICESTACKIDEA_PUBLISH_NIGHTLY") +var buildNum: String? = System.getenv("BUILD_NUMBER") + + +if(pubNightly != null && buildNum != null) { + // Append build number to version for a new nightly build version to be published. + version = "${version}.$buildNum" +} + +var jbToken: String? = "" + +if (properties("jetbrains.plugins.user").isEmpty()) { + val props = Properties() + val fis = FileInputStream("local.properties") + props.load(fis) +} +jbToken = properties("jetbrains.plugins.token") + +tasks { + + runPluginVerifier { + ideVersions.set(listOf( + "WS-2019.2", + "WS-2020.2.4", + "IIU-2020.1.1", + "IIU-2021.1" + )) + } + + publishPlugin { + token.set(jbToken) + channels.set(listOf("beta")) + } + + patchPluginXml { + version.set(properties("pluginVersion")) + sinceBuild.set(properties("pluginSinceBuild")) + untilBuild.set(properties("pluginUntilBuild")) + } +} diff --git a/src/ServiceStackIDEA/gradle.properties b/src/ServiceStackIDEA/gradle.properties new file mode 100644 index 0000000..c52b2a2 --- /dev/null +++ b/src/ServiceStackIDEA/gradle.properties @@ -0,0 +1,27 @@ +# IntelliJ Platform Artifacts Repositories +# -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html + +pluginGroup = org.jetbrains.plugins.template +pluginName = IntelliJ Platform Plugin Template +pluginVersion = 1.0.43 + +# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html +# for insight into build numbers and IntelliJ Platform versions. +pluginSinceBuild = 192 +pluginUntilBuild = 211.* + +# Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl +# See https://jb.gg/intellij-platform-builds-list for available build versions. +pluginVerifierIdeVersions = WS-2019.2, WS-2020.2.4, WS-2020.3.4, WS-2021.1.1 + +platformType = IC +platformVersion = 2020.2.4 +platformDownloadSources = true + +# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/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://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details. +kotlin.stdlib.default.dependency = false From e8728dbcf1bebc8de7e49bd2a90282542ae95c19 Mon Sep 17 00:00:00 2001 From: Darren Reid Date: Tue, 6 Jul 2021 16:24:40 +1000 Subject: [PATCH 2/2] Comment unused params. --- src/ServiceStackIDEA/gradle.properties | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ServiceStackIDEA/gradle.properties b/src/ServiceStackIDEA/gradle.properties index c52b2a2..d9b7c5d 100644 --- a/src/ServiceStackIDEA/gradle.properties +++ b/src/ServiceStackIDEA/gradle.properties @@ -1,8 +1,8 @@ # IntelliJ Platform Artifacts Repositories # -> https://plugins.jetbrains.com/docs/intellij/intellij-artifacts.html -pluginGroup = org.jetbrains.plugins.template -pluginName = IntelliJ Platform Plugin Template +# pluginGroup = org.jetbrains.plugins.template +# pluginName = IntelliJ Platform Plugin Template pluginVersion = 1.0.43 # See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html @@ -14,13 +14,13 @@ pluginUntilBuild = 211.* # See https://jb.gg/intellij-platform-builds-list for available build versions. pluginVerifierIdeVersions = WS-2019.2, WS-2020.2.4, WS-2020.3.4, WS-2021.1.1 -platformType = IC -platformVersion = 2020.2.4 -platformDownloadSources = true +# platformType = IC +# platformVersion = 2020.2.4 +# platformDownloadSources = true # Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html # Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22 -platformPlugins = +# platformPlugins = # Opt-out flag for bundling Kotlin standard library. # See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details.