|
| 1 | +import org.jetbrains.kotlin.gradle.dsl.JvmTarget |
1 | 2 | import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
|
2 | 3 |
|
3 | 4 | plugins {
|
4 | 5 | id("java")
|
5 | 6 | alias(libs.plugins.kotlin.jvm)
|
6 |
| - alias(libs.plugins.intellij.sdk) |
| 7 | + alias(libs.plugins.intellij.plugin) |
7 | 8 | alias(libs.plugins.intellij.changelog)
|
8 | 9 | }
|
9 | 10 |
|
10 | 11 | val projectProperties = ProjectProperties(project)
|
11 | 12 |
|
12 | 13 | group = "org.jetbrains.compose.desktop.ide"
|
| 14 | + |
13 | 15 | version = projectProperties.deployVersion
|
14 | 16 |
|
15 | 17 | repositories {
|
16 | 18 | mavenCentral()
|
| 19 | + |
| 20 | + intellijPlatform { defaultRepositories() } |
17 | 21 | }
|
18 | 22 |
|
19 | 23 | dependencies {
|
20 | 24 | implementation("org.jetbrains.compose:preview-rpc")
|
21 |
| -} |
22 | 25 |
|
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() |
38 | 29 |
|
39 |
| -tasks.buildSearchableOptions { |
40 |
| - // temporary workaround |
41 |
| - enabled = false |
| 30 | + bundledPlugins("com.intellij.java", "org.jetbrains.kotlin", "com.intellij.gradle") |
| 31 | + } |
42 | 32 | }
|
43 | 33 |
|
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 | + } |
52 | 41 | }
|
| 42 | + buildSearchableOptions = false |
| 43 | + autoReload = false |
53 | 44 |
|
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 |
57 | 48 | }
|
58 | 49 |
|
59 |
| - runPluginVerifier { |
60 |
| - ideVersions.set(projectProperties.pluginVerifierIdeVersions) |
| 50 | + pluginVerification { ides { recommended() } } |
| 51 | +} |
| 52 | + |
| 53 | +tasks { |
| 54 | + withType<JavaCompile> { |
| 55 | + sourceCompatibility = "21" |
| 56 | + targetCompatibility = "21" |
61 | 57 | }
|
| 58 | + withType<KotlinJvmCompile> { compilerOptions.jvmTarget.set(JvmTarget.JVM_21) } |
62 | 59 | }
|
63 | 60 |
|
64 | 61 | 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 | + |
74 | 70 | private fun listProperty(key: String): List<String> =
|
75 | 71 | stringProperty(key).split(",").map { it.trim() }
|
76 | 72 | }
|
0 commit comments