diff --git a/CHANGES.md b/CHANGES.md index 85fe025b11..a40099b803 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -14,6 +14,7 @@ - `classpathIndexCleanup` task is added to remove `classpath.index` files created by `PathClassLoader` [#1039](../../issues/1039) - Improve Plugin Verifier error messages [#1040](../../issues/1040) - Added `FailureLevel.SCHEDULED_FOR_REMOVAL_API_USAGES` to the Plugin Verifier task +- Support for JetBrains Runtime 2022.2 directories layout [#1016](../../issues/1016) ### Changed - Set minimum supported Gradle version from `6.7` to `6.7.1` diff --git a/src/main/kotlin/org/jetbrains/intellij/IntelliJPlugin.kt b/src/main/kotlin/org/jetbrains/intellij/IntelliJPlugin.kt index e6e86b82d8..532ffc99a9 100644 --- a/src/main/kotlin/org/jetbrains/intellij/IntelliJPlugin.kt +++ b/src/main/kotlin/org/jetbrains/intellij/IntelliJPlugin.kt @@ -1065,9 +1065,14 @@ open class IntelliJPlugin : Plugin { // the same as previous – setting appClassLoader but outdated. Works for part of 203 builds. task.systemProperty("idea.use.core.classloader.for", pluginIds.joinToString(",")) - task.outputs.dir(systemDirectoryProvider).withPropertyName("System directory") - task.inputs.dir(configDirectoryProvider).withPropertyName("Config Directory").withPathSensitivity(PathSensitivity.RELATIVE) - task.inputs.files(pluginsDirectoryProvider).withPropertyName("Plugins directory").withPathSensitivity(PathSensitivity.RELATIVE) + task.outputs.dir(systemDirectoryProvider) + .withPropertyName("System directory") + task.inputs.dir(configDirectoryProvider) + .withPropertyName("Config Directory") + .withPathSensitivity(PathSensitivity.RELATIVE) + task.inputs.files(pluginsDirectoryProvider) + .withPropertyName("Plugins directory") + .withPathSensitivity(PathSensitivity.RELATIVE) .withNormalizer(ClasspathNormalizer::class.java) task.dependsOn(IntelliJPluginConstants.SETUP_DEPENDENCIES_TASK_NAME) diff --git a/src/main/kotlin/org/jetbrains/intellij/jbr/JbrResolver.kt b/src/main/kotlin/org/jetbrains/intellij/jbr/JbrResolver.kt index 7bba97b20c..21e8b502f5 100644 --- a/src/main/kotlin/org/jetbrains/intellij/jbr/JbrResolver.kt +++ b/src/main/kotlin/org/jetbrains/intellij/jbr/JbrResolver.kt @@ -187,13 +187,14 @@ open class JbrResolver @Inject constructor( } private fun getJbrRoot(javaHome: File): File { - val jbr = javaHome.listFiles()?.firstOrNull { it.name == "jbr" || it.name == "jbrsdk" }?.takeIf(File::exists) + val jbr = javaHome.listFiles()?.firstOrNull { it.name.startsWith("jbr") }?.takeIf(File::exists) return when { operatingSystem.isMacOsX -> when { javaHome.endsWith("Contents/Home") -> javaHome jbr != null -> jbr.resolve("Contents/Home") else -> javaHome.resolve("jdk/Contents/Home") } + else -> when { jbr != null -> jbr else -> javaHome diff --git a/src/main/kotlin/org/jetbrains/intellij/tasks/RunIdeBase.kt b/src/main/kotlin/org/jetbrains/intellij/tasks/RunIdeBase.kt index 1308792331..af1c0f4e6a 100755 --- a/src/main/kotlin/org/jetbrains/intellij/tasks/RunIdeBase.kt +++ b/src/main/kotlin/org/jetbrains/intellij/tasks/RunIdeBase.kt @@ -240,9 +240,13 @@ abstract class RunIdeBase(runAlways: Boolean) : JavaExec() { if (!systemProperties.containsKey("idea.platform.prefix")) { val prefix = findIdePrefix() if (prefix == null && !ideBuildNumber(ideDir.get()).startsWith("IU-")) { - throw TaskExecutionException(this, - GradleException("Cannot find IDE platform prefix. Please create a bug report at https://github.com/jetbrains/gradle-intellij-plugin. " + - "As a workaround specify `idea.platform.prefix` system property for task `${this.name}` manually.")) + throw TaskExecutionException( + this, + GradleException( + "Cannot find IDE platform prefix. Please create a bug report at https://github.com/jetbrains/gradle-intellij-plugin. " + + "As a workaround specify `idea.platform.prefix` system property for task `${this.name}` manually." + ) + ) } if (prefix != null) {