Skip to content

Commit 6e9fdb5

Browse files
rock3rkropp
andcommitted
Upgrade CMP IJ Plugin dependencies & setup (#5137)
This PR prepares the IJ plugin to be fixed/improved upon by a follow-up PR, by: 1. Migrating to IJP Gradle plugin 2.1 2. Upgrading Gradle to 8.10 3. Bumping IJ target to 2024.2.1 4. Cleaning up after migration --------- Co-authored-by: Victor Kropp <victor.kropp@jetbrains.com> (cherry picked from commit 224704b)
1 parent a5e7eed commit 6e9fdb5

File tree

4 files changed

+45
-55
lines changed

4 files changed

+45
-55
lines changed

idea-plugin/build.gradle.kts

Lines changed: 38 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,72 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
12
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
23

34
plugins {
45
id("java")
56
alias(libs.plugins.kotlin.jvm)
6-
alias(libs.plugins.intellij.sdk)
7+
alias(libs.plugins.intellij.plugin)
78
alias(libs.plugins.intellij.changelog)
89
}
910

1011
val projectProperties = ProjectProperties(project)
1112

1213
group = "org.jetbrains.compose.desktop.ide"
14+
1315
version = projectProperties.deployVersion
1416

1517
repositories {
1618
mavenCentral()
19+
20+
intellijPlatform { defaultRepositories() }
1721
}
1822

1923
dependencies {
2024
implementation("org.jetbrains.compose:preview-rpc")
21-
}
2225

23-
intellij {
24-
pluginName.set("Compose Multiplatform IDE Support")
25-
type.set(projectProperties.platformType)
26-
version.set(projectProperties.platformVersion)
27-
downloadSources.set(projectProperties.platformDownloadSources)
28-
updateSinceUntilBuild.set(false)
29-
30-
plugins.set(
31-
listOf(
32-
"java",
33-
"com.intellij.gradle",
34-
"org.jetbrains.kotlin"
35-
)
36-
)
37-
}
26+
intellijPlatform {
27+
intellijIdeaCommunity(libs.versions.idea)
28+
instrumentationTools()
3829

39-
tasks.buildSearchableOptions {
40-
// temporary workaround
41-
enabled = false
30+
bundledPlugins("com.intellij.java", "org.jetbrains.kotlin", "com.intellij.gradle")
31+
}
4232
}
4333

44-
tasks {
45-
// Set the compatibility versions to 1.8
46-
withType<JavaCompile> {
47-
sourceCompatibility = "11"
48-
targetCompatibility = "11"
49-
}
50-
withType<KotlinJvmCompile> {
51-
kotlinOptions.jvmTarget = "11"
34+
intellijPlatform {
35+
pluginConfiguration {
36+
name = "Compose Multiplatform IDE Support"
37+
ideaVersion {
38+
sinceBuild = "231.*"
39+
untilBuild = "243.*"
40+
}
5241
}
42+
buildSearchableOptions = false
43+
autoReload = false
5344

54-
publishPlugin {
55-
token.set(System.getenv("IDE_PLUGIN_PUBLISH_TOKEN"))
56-
channels.set(projectProperties.pluginChannels)
45+
publishing {
46+
token = System.getenv("IDE_PLUGIN_PUBLISH_TOKEN")
47+
channels = projectProperties.pluginChannels
5748
}
5849

59-
runPluginVerifier {
60-
ideVersions.set(projectProperties.pluginVerifierIdeVersions)
50+
pluginVerification { ides { recommended() } }
51+
}
52+
53+
tasks {
54+
withType<JavaCompile> {
55+
sourceCompatibility = "21"
56+
targetCompatibility = "21"
6157
}
58+
withType<KotlinJvmCompile> { compilerOptions.jvmTarget.set(JvmTarget.JVM_21) }
6259
}
6360

6461
class ProjectProperties(private val project: Project) {
65-
val deployVersion get() = stringProperty("deploy.version")
66-
val platformType get() = stringProperty("platform.type")
67-
val platformVersion get() = stringProperty("platform.version")
68-
val platformDownloadSources get() = stringProperty("platform.download.sources").toBoolean()
69-
val pluginChannels get() = listProperty("plugin.channels")
70-
val pluginVerifierIdeVersions get() = listProperty("plugin.verifier.ide.versions")
71-
72-
private fun stringProperty(key: String): String =
73-
project.findProperty(key)!!.toString()
62+
val deployVersion
63+
get() = stringProperty("deploy.version")
64+
65+
val pluginChannels
66+
get() = listProperty("plugin.channels")
67+
68+
private fun stringProperty(key: String): String = project.findProperty(key)!!.toString()
69+
7470
private fun listProperty(key: String): List<String> =
7571
stringProperty(key).split(",").map { it.trim() }
7672
}

idea-plugin/gradle.properties

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,3 @@ kotlin.stdlib.default.dependency=false
55
deploy.version=0.1-SNAPSHOT
66

77
plugin.channels=snapshots
8-
# Intellij since-build should be updated directly in src/main/resources/META-INF/plugin.xml
9-
# See https://jb.gg/intellij-platform-builds-list for available build versions.
10-
plugin.verifier.ide.versions=2022.1, 2022.2, 2022.3
11-
12-
platform.type=IC
13-
platform.version=2022.1.1
14-
platform.download.sources=true

idea-plugin/gradle/libs.versions.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
[versions]
2-
kotlin = "1.9.0"
3-
4-
[libraries]
2+
kotlin = "1.9.23"
3+
ideaPlugin = "2.1.0"
4+
idea = "2024.2.1"
5+
changelog = "2.2.0"
56

67
[plugins]
78
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
8-
intellij-sdk = "org.jetbrains.intellij:1.15.0"
9-
intellij-changelog = "org.jetbrains.changelog:2.2.0"
9+
intellij-plugin = { id = "org.jetbrains.intellij.platform", version.ref = "ideaPlugin" }
10+
intellij-changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)