-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> (cherry picked from commit 224704b)
- Loading branch information
Showing
4 changed files
with
45 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,72 @@ | ||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile | ||
|
||
plugins { | ||
id("java") | ||
alias(libs.plugins.kotlin.jvm) | ||
alias(libs.plugins.intellij.sdk) | ||
alias(libs.plugins.intellij.plugin) | ||
alias(libs.plugins.intellij.changelog) | ||
} | ||
|
||
val projectProperties = ProjectProperties(project) | ||
|
||
group = "org.jetbrains.compose.desktop.ide" | ||
|
||
version = projectProperties.deployVersion | ||
|
||
repositories { | ||
mavenCentral() | ||
|
||
intellijPlatform { defaultRepositories() } | ||
} | ||
|
||
dependencies { | ||
implementation("org.jetbrains.compose:preview-rpc") | ||
} | ||
|
||
intellij { | ||
pluginName.set("Compose Multiplatform IDE Support") | ||
type.set(projectProperties.platformType) | ||
version.set(projectProperties.platformVersion) | ||
downloadSources.set(projectProperties.platformDownloadSources) | ||
updateSinceUntilBuild.set(false) | ||
|
||
plugins.set( | ||
listOf( | ||
"java", | ||
"com.intellij.gradle", | ||
"org.jetbrains.kotlin" | ||
) | ||
) | ||
} | ||
intellijPlatform { | ||
intellijIdeaCommunity(libs.versions.idea) | ||
instrumentationTools() | ||
|
||
tasks.buildSearchableOptions { | ||
// temporary workaround | ||
enabled = false | ||
bundledPlugins("com.intellij.java", "org.jetbrains.kotlin", "com.intellij.gradle") | ||
} | ||
} | ||
|
||
tasks { | ||
// Set the compatibility versions to 1.8 | ||
withType<JavaCompile> { | ||
sourceCompatibility = "11" | ||
targetCompatibility = "11" | ||
} | ||
withType<KotlinJvmCompile> { | ||
kotlinOptions.jvmTarget = "11" | ||
intellijPlatform { | ||
pluginConfiguration { | ||
name = "Compose Multiplatform IDE Support" | ||
ideaVersion { | ||
sinceBuild = "231.*" | ||
untilBuild = "243.*" | ||
} | ||
} | ||
buildSearchableOptions = false | ||
autoReload = false | ||
|
||
publishPlugin { | ||
token.set(System.getenv("IDE_PLUGIN_PUBLISH_TOKEN")) | ||
channels.set(projectProperties.pluginChannels) | ||
publishing { | ||
token = System.getenv("IDE_PLUGIN_PUBLISH_TOKEN") | ||
channels = projectProperties.pluginChannels | ||
} | ||
|
||
runPluginVerifier { | ||
ideVersions.set(projectProperties.pluginVerifierIdeVersions) | ||
pluginVerification { ides { recommended() } } | ||
} | ||
|
||
tasks { | ||
withType<JavaCompile> { | ||
sourceCompatibility = "21" | ||
targetCompatibility = "21" | ||
} | ||
withType<KotlinJvmCompile> { compilerOptions.jvmTarget.set(JvmTarget.JVM_21) } | ||
} | ||
|
||
class ProjectProperties(private val project: Project) { | ||
val deployVersion get() = stringProperty("deploy.version") | ||
val platformType get() = stringProperty("platform.type") | ||
val platformVersion get() = stringProperty("platform.version") | ||
val platformDownloadSources get() = stringProperty("platform.download.sources").toBoolean() | ||
val pluginChannels get() = listProperty("plugin.channels") | ||
val pluginVerifierIdeVersions get() = listProperty("plugin.verifier.ide.versions") | ||
|
||
private fun stringProperty(key: String): String = | ||
project.findProperty(key)!!.toString() | ||
val deployVersion | ||
get() = stringProperty("deploy.version") | ||
|
||
val pluginChannels | ||
get() = listProperty("plugin.channels") | ||
|
||
private fun stringProperty(key: String): String = project.findProperty(key)!!.toString() | ||
|
||
private fun listProperty(key: String): List<String> = | ||
stringProperty(key).split(",").map { it.trim() } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
[versions] | ||
kotlin = "1.9.0" | ||
|
||
[libraries] | ||
kotlin = "1.9.23" | ||
ideaPlugin = "2.1.0" | ||
idea = "2024.2.1" | ||
changelog = "2.2.0" | ||
|
||
[plugins] | ||
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } | ||
intellij-sdk = "org.jetbrains.intellij:1.15.0" | ||
intellij-changelog = "org.jetbrains.changelog:2.2.0" | ||
intellij-plugin = { id = "org.jetbrains.intellij.platform", version.ref = "ideaPlugin" } | ||
intellij-changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-all.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |