diff --git a/.run/Run Plugin.run.xml b/.run/Run Plugin.run.xml
index 20a70af..d15ff68 100644
--- a/.run/Run Plugin.run.xml
+++ b/.run/Run Plugin.run.xml
@@ -21,4 +21,4 @@
false
-
+
\ No newline at end of file
diff --git a/.run/Run Verifications.run.xml b/.run/Run Verifications.run.xml
index 362b578..32783f5 100644
--- a/.run/Run Verifications.run.xml
+++ b/.run/Run Verifications.run.xml
@@ -11,7 +11,7 @@
@@ -19,8 +19,7 @@
true
true
false
-
-
-
+ false
+
-
+
\ No newline at end of file
diff --git a/build.gradle.kts b/build.gradle.kts
index 59023cb..7b8f214 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,60 +1,74 @@
import org.jetbrains.changelog.Changelog
-
-fun properties(key: String) = providers.gradleProperty(key)
+import org.jetbrains.changelog.markdownToHTML
+import org.jetbrains.intellij.platform.gradle.TestFrameworkType
plugins {
id("java") // Java support
alias(libs.plugins.kotlin) // Kotlin support
- alias(libs.plugins.gradleIntelliJPlugin) // Gradle IntelliJ Plugin
+ alias(libs.plugins.intelliJPlatform) // IntelliJ Platform Gradle Plugin
alias(libs.plugins.changelog) // Gradle Changelog Plugin
}
-group = properties("pluginGroup").get()
-version = properties("pluginVersion").get()
+group = providers.gradleProperty("pluginGroup").get()
+version = providers.gradleProperty("pluginVersion").get()
+
+// Set the JVM language level used to build the project.
+kotlin {
+ jvmToolchain(17)
+}
// Configure project's dependencies
repositories {
mavenCentral()
-}
-// Set the JVM language level used to build the project.
-kotlin {
- jvmToolchain(17)
+ // IntelliJ Platform Gradle Plugin Repositories Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-repositories-extension.html
+ intellijPlatform {
+ defaultRepositories()
+ }
}
// Dependencies are managed with Gradle version catalog - read more: https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog
dependencies {
-}
+ testImplementation(libs.junit)
-// Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
-intellij {
- pluginName = properties("pluginName")
- version = properties("platformVersion")
- type = properties("platformType")
+ // IntelliJ Platform Gradle Plugin Dependencies Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html
+ intellijPlatform {
+ create(providers.gradleProperty("platformType"), providers.gradleProperty("platformVersion"))
- // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
- plugins = properties("platformPlugins").map { it.split(',').map(String::trim).filter(String::isNotEmpty) }
-}
+ // Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins.
+ bundledPlugins(providers.gradleProperty("platformBundledPlugins").map { it.split(',') })
-// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
-changelog {
- groups.empty()
- repositoryUrl = properties("pluginRepositoryUrl")
-}
+ // Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file for plugin from JetBrains Marketplace.
+ plugins(providers.gradleProperty("platformPlugins").map { it.split(',') })
-tasks {
- wrapper {
- gradleVersion = properties("gradleVersion").get()
+ instrumentationTools()
+ pluginVerifier()
+ zipSigner()
+ testFramework(TestFrameworkType.Platform)
}
+}
- patchPluginXml {
- version = properties("pluginVersion")
- sinceBuild = properties("pluginSinceBuild")
- untilBuild = properties("pluginUntilBuild")
+// Configure IntelliJ Platform Gradle Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-extension.html
+intellijPlatform {
+ pluginConfiguration {
+ version = providers.gradleProperty("pluginVersion")
+
+ // Extract the section from README.md and provide for the plugin's manifest
+ description = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
+ val start = ""
+ val end = ""
+
+ with(it.lines()) {
+ if (!containsAll(listOf(start, end))) {
+ throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
+ }
+ subList(indexOf(start) + 1, indexOf(end)).joinToString("\n").let(::markdownToHTML)
+ }
+ }
val changelog = project.changelog // local variable for configuration cache compatibility
// Get the latest available change notes from the changelog file
- changeNotes = properties("pluginVersion").map { pluginVersion ->
+ changeNotes = providers.gradleProperty("pluginVersion").map { pluginVersion ->
with(changelog) {
renderItem(
(getOrNull(pluginVersion) ?: getUnreleased())
@@ -64,26 +78,67 @@ tasks {
)
}
}
+
+ ideaVersion {
+ sinceBuild = providers.gradleProperty("pluginSinceBuild")
+ untilBuild = providers.gradleProperty("pluginUntilBuild")
+ }
}
- runIde {
- maxHeapSize = "8g"
+ signing {
+ certificateChain = providers.environmentVariable("CERTIFICATE_CHAIN")
+ privateKey = providers.environmentVariable("PRIVATE_KEY")
+ password = providers.environmentVariable("PRIVATE_KEY_PASSWORD")
}
- buildSearchableOptions {
- enabled = false
+ publishing {
+ token = providers.environmentVariable("PUBLISH_TOKEN")
+ // The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
+ // Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
+ // https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
+ channels = providers.gradleProperty("pluginVersion").map { listOf(it.substringAfter('-', "").substringBefore('.').ifEmpty { "default" }) }
}
- test {
- exclude("com/vk/kphpstorm/testing/infrastructure/**")
- include("**/*Test.class")
- isScanForTestClasses = false
+ pluginVerification {
+ ides {
+ recommended()
+ }
}
+}
+
+// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
+changelog {
+ groups.empty()
+ repositoryUrl = providers.gradleProperty("pluginRepositoryUrl")
+}
+
+
+tasks {
+ wrapper {
+ gradleVersion = providers.gradleProperty("gradleVersion").get()
+ }
+
+ publishPlugin {
+ dependsOn(patchChangelog)
+ }
+}
+
+intellijPlatformTesting {
+ runIde {
+ register("runIdeForUiTests") {
+ task {
+ jvmArgumentProviders += CommandLineArgumentProvider {
+ listOf(
+ "-Drobot-server.port=8082",
+ "-Dide.mac.message.dialogs.as.sheets=false",
+ "-Djb.privacy.policy.text=",
+ "-Djb.consents.confirmation.enabled=false",
+ )
+ }
+ }
- sourceSets {
- test {
- resources {
- srcDir("src/test/fixtures")
+ plugins {
+ robotServerPlugin()
}
}
}
diff --git a/gradle.properties b/gradle.properties
index 8ddbb2a..59b73af 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -3,25 +3,25 @@
pluginGroup = com.vk
pluginName = kphpstorm
pluginRepositoryUrl = https://github.com/VKCOM/kphpstorm
-
# SemVer format -> https://semver.org
-pluginVersion = 1.2.12
+pluginVersion = 1.2.13
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
-pluginSinceBuild = 241
-pluginUntilBuild = 241.*
+pluginSinceBuild = 242
+pluginUntilBuild = 242.*
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
platformType = IU
-platformVersion = 2024.1
+platformVersion = 2024.2.*
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
-# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
-# PHP Plugin - https://plugins.jetbrains.com/plugin/6610-php/versions
-platformPlugins = com.jetbrains.php:241.14494.240
+# Example: platformPlugins = com.jetbrains.php:203.4449.22, org.intellij.scala:2023.3.27@EAP
+platformPlugins = 242.20224.427
+# Example: platformBundledPlugins = com.intellij.java
+platformBundledPlugins = com.intellij.java
# Gradle Releases -> https://github.com/gradle/gradle/releases
-gradleVersion = 8.6
+gradleVersion = 8.9
# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib
kotlin.stdlib.default.dependency = false
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 9852740..f21a08d 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -1,14 +1,16 @@
[versions]
# libraries
+junit = "4.13.2"
# plugins
-kotlin = "1.9.23"
-changelog = "2.2.0"
-gradleIntelliJPlugin = "1.17.2"
+changelog = "2.2.1"
+intelliJPlatform = "2.0.1"
+kotlin = "1.9.25"
[libraries]
+junit = { group = "junit", name = "junit", version.ref = "junit" }
[plugins]
-kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" }
-gradleIntelliJPlugin = { id = "org.jetbrains.intellij", version.ref = "gradleIntelliJPlugin" }
+intelliJPlatform = { id = "org.jetbrains.intellij.platform", version.ref = "intelliJPlatform" }
+kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index d64cd49..2c35211 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index a80b22c..09523c0 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
diff --git a/gradlew b/gradlew
index 1aa94a4..f5feea6 100755
--- a/gradlew
+++ b/gradlew
@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
+# SPDX-License-Identifier: Apache-2.0
+#
##############################################################################
#
@@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
-# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
-APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
+APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
+' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
diff --git a/gradlew.bat b/gradlew.bat
index 25da30d..9d21a21 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
+@rem SPDX-License-Identifier: Apache-2.0
+@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################