Browse Source
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 224704b085
)
pull/5189/head
Sebastiano Poggi
2 months ago
committed by
Victor Kropp
4 changed files with 45 additions and 55 deletions
@ -1,76 +1,72 @@ |
|||||||
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget |
||||||
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile |
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile |
||||||
|
|
||||||
plugins { |
plugins { |
||||||
id("java") |
id("java") |
||||||
alias(libs.plugins.kotlin.jvm) |
alias(libs.plugins.kotlin.jvm) |
||||||
alias(libs.plugins.intellij.sdk) |
alias(libs.plugins.intellij.plugin) |
||||||
alias(libs.plugins.intellij.changelog) |
alias(libs.plugins.intellij.changelog) |
||||||
} |
} |
||||||
|
|
||||||
val projectProperties = ProjectProperties(project) |
val projectProperties = ProjectProperties(project) |
||||||
|
|
||||||
group = "org.jetbrains.compose.desktop.ide" |
group = "org.jetbrains.compose.desktop.ide" |
||||||
|
|
||||||
version = projectProperties.deployVersion |
version = projectProperties.deployVersion |
||||||
|
|
||||||
repositories { |
repositories { |
||||||
mavenCentral() |
mavenCentral() |
||||||
|
|
||||||
|
intellijPlatform { defaultRepositories() } |
||||||
} |
} |
||||||
|
|
||||||
dependencies { |
dependencies { |
||||||
implementation("org.jetbrains.compose:preview-rpc") |
implementation("org.jetbrains.compose:preview-rpc") |
||||||
} |
|
||||||
|
|
||||||
intellij { |
intellijPlatform { |
||||||
pluginName.set("Compose Multiplatform IDE Support") |
intellijIdeaCommunity(libs.versions.idea) |
||||||
type.set(projectProperties.platformType) |
instrumentationTools() |
||||||
version.set(projectProperties.platformVersion) |
|
||||||
downloadSources.set(projectProperties.platformDownloadSources) |
|
||||||
updateSinceUntilBuild.set(false) |
|
||||||
|
|
||||||
plugins.set( |
|
||||||
listOf( |
|
||||||
"java", |
|
||||||
"com.intellij.gradle", |
|
||||||
"org.jetbrains.kotlin" |
|
||||||
) |
|
||||||
) |
|
||||||
} |
|
||||||
|
|
||||||
tasks.buildSearchableOptions { |
bundledPlugins("com.intellij.java", "org.jetbrains.kotlin", "com.intellij.gradle") |
||||||
// temporary workaround |
} |
||||||
enabled = false |
|
||||||
} |
} |
||||||
|
|
||||||
tasks { |
intellijPlatform { |
||||||
// Set the compatibility versions to 1.8 |
pluginConfiguration { |
||||||
withType<JavaCompile> { |
name = "Compose Multiplatform IDE Support" |
||||||
sourceCompatibility = "11" |
ideaVersion { |
||||||
targetCompatibility = "11" |
sinceBuild = "231.*" |
||||||
|
untilBuild = "243.*" |
||||||
} |
} |
||||||
withType<KotlinJvmCompile> { |
|
||||||
kotlinOptions.jvmTarget = "11" |
|
||||||
} |
} |
||||||
|
buildSearchableOptions = false |
||||||
|
autoReload = false |
||||||
|
|
||||||
publishPlugin { |
publishing { |
||||||
token.set(System.getenv("IDE_PLUGIN_PUBLISH_TOKEN")) |
token = System.getenv("IDE_PLUGIN_PUBLISH_TOKEN") |
||||||
channels.set(projectProperties.pluginChannels) |
channels = projectProperties.pluginChannels |
||||||
} |
} |
||||||
|
|
||||||
runPluginVerifier { |
pluginVerification { ides { recommended() } } |
||||||
ideVersions.set(projectProperties.pluginVerifierIdeVersions) |
} |
||||||
|
|
||||||
|
tasks { |
||||||
|
withType<JavaCompile> { |
||||||
|
sourceCompatibility = "21" |
||||||
|
targetCompatibility = "21" |
||||||
} |
} |
||||||
|
withType<KotlinJvmCompile> { compilerOptions.jvmTarget.set(JvmTarget.JVM_21) } |
||||||
} |
} |
||||||
|
|
||||||
class ProjectProperties(private val project: Project) { |
class ProjectProperties(private val project: Project) { |
||||||
val deployVersion get() = stringProperty("deploy.version") |
val deployVersion |
||||||
val platformType get() = stringProperty("platform.type") |
get() = stringProperty("deploy.version") |
||||||
val platformVersion get() = stringProperty("platform.version") |
|
||||||
val platformDownloadSources get() = stringProperty("platform.download.sources").toBoolean() |
val pluginChannels |
||||||
val pluginChannels get() = listProperty("plugin.channels") |
get() = listProperty("plugin.channels") |
||||||
val pluginVerifierIdeVersions get() = listProperty("plugin.verifier.ide.versions") |
|
||||||
|
private fun stringProperty(key: String): String = project.findProperty(key)!!.toString() |
||||||
private fun stringProperty(key: String): String = |
|
||||||
project.findProperty(key)!!.toString() |
|
||||||
private fun listProperty(key: String): List<String> = |
private fun listProperty(key: String): List<String> = |
||||||
stringProperty(key).split(",").map { it.trim() } |
stringProperty(key).split(",").map { it.trim() } |
||||||
} |
} |
||||||
|
@ -1,9 +1,10 @@ |
|||||||
[versions] |
[versions] |
||||||
kotlin = "1.9.0" |
kotlin = "1.9.23" |
||||||
|
ideaPlugin = "2.1.0" |
||||||
[libraries] |
idea = "2024.2.1" |
||||||
|
changelog = "2.2.0" |
||||||
|
|
||||||
[plugins] |
[plugins] |
||||||
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } |
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } |
||||||
intellij-sdk = "org.jetbrains.intellij:1.15.0" |
intellij-plugin = { id = "org.jetbrains.intellij.platform", version.ref = "ideaPlugin" } |
||||||
intellij-changelog = "org.jetbrains.changelog:2.2.0" |
intellij-changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" } |
||||||
|
@ -1,5 +1,5 @@ |
|||||||
distributionBase=GRADLE_USER_HOME |
distributionBase=GRADLE_USER_HOME |
||||||
distributionPath=wrapper/dists |
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 |
zipStoreBase=GRADLE_USER_HOME |
||||||
zipStorePath=wrapper/dists |
zipStorePath=wrapper/dists |
||||||
|
Loading…
Reference in new issue