Skip to content

Commit 2f48f43

Browse files
authored
IntelliJ Plugin 2.0 / Kotlin 2.0 / Compose 1.6.11 (#68)
* Intellij platform 2.0 plugin update * kotlin 2.0 * java 17 on CI
1 parent 220c306 commit 2f48f43

11 files changed

Lines changed: 239 additions & 148 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/setup-java@v3
1818
with:
1919
distribution: temurin
20-
java-version: 11
20+
java-version: 17
2121

2222
- name: Setup Gradle
2323
uses: gradle/gradle-build-action@v2

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- uses: actions/setup-java@v3
1919
with:
2020
distribution: temurin
21-
java-version: 11
21+
java-version: 17
2222

2323
- name: Setup Gradle
2424
uses: gradle/gradle-build-action@v2

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ google-services.json
3434

3535
.DS_Store
3636

37+
.intellijPlatform

build.gradle.kts

Lines changed: 102 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ plugins {
1212
kotlin("plugin.serialization") version libs.versions.kotlin.get()
1313
id("org.jetbrains.compose")
1414
alias(libs.plugins.spotless)
15+
alias(libs.plugins.compose)
1516
}
1617

1718
group = properties("pluginGroup").get()
@@ -28,7 +29,12 @@ buildscript {
2829
// Configure project's dependencies
2930
repositories {
3031
mavenCentral()
32+
google()
33+
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
3134
maven { url = uri("https://maven.pkg.jetbrains.space/public/p/compose/dev") }
35+
intellijPlatform {
36+
defaultRepositories()
37+
}
3238
}
3339

3440
apply(
@@ -42,31 +48,35 @@ dependencies {
4248
implementation(compose.materialIconsExtended)
4349
implementation(libs.segment)
4450

45-
val version = "0.7.81"
51+
val version = "0.8.10"
4652
val macTarget = "macos-arm64"
4753
val windowsTarget = "windows-x64"
4854
val linuxTarget = "linux-x64"
4955

5056
implementation("org.jetbrains.skiko:skiko-awt-runtime-$macTarget:$version")
5157
implementation("org.jetbrains.skiko:skiko-awt-runtime-$windowsTarget:$version")
5258
implementation("org.jetbrains.skiko:skiko-awt-runtime-$linuxTarget:$version")
53-
}
5459

55-
// Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for 2022.2+.
56-
kotlin {
57-
jvmToolchain {
58-
languageVersion.set(JavaLanguageVersion.of(libs.versions.jdk.get()))
60+
testImplementation(libs.junit)
61+
62+
// IntelliJ Platform Gradle Plugin Dependencies Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html
63+
intellijPlatform {
64+
create(properties("platformType").get(), properties("platformVersion").get())
65+
66+
// Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins.
67+
bundledPlugins(properties("platformBundledPlugins").map { it.split(',') })
68+
69+
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file for plugin from JetBrains Marketplace.
70+
plugins(properties("platformPlugins").map { it.split(',') })
71+
72+
instrumentationTools()
73+
pluginVerifier()
74+
zipSigner()
5975
}
6076
}
6177

62-
// Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
63-
intellij {
64-
pluginName = properties("pluginName")
65-
version = properties("platformVersion")
66-
type = properties("platformType")
67-
68-
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
69-
plugins = properties("platformPlugins").map { it.split(',').map(String::trim).filter(String::isNotEmpty) }
78+
kotlin {
79+
jvmToolchain(libs.versions.jdk.get().toInt())
7080
}
7181

7282
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
@@ -81,9 +91,9 @@ tasks {
8191
}
8292

8393
patchPluginXml {
84-
version = properties("pluginVersion")
85-
sinceBuild = properties("pluginSinceBuild")
86-
untilBuild = properties("pluginUntilBuild")
94+
version = properties("pluginVersion").get()
95+
sinceBuild = properties("pluginSinceBuild").get()
96+
// untilBuild = properties("pluginUntilBuild").get()
8797

8898
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
8999
pluginDescription = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
@@ -112,27 +122,89 @@ tasks {
112122
}
113123
}
114124

115-
// Configure UI tests plugin
116-
// Read more: https://github.com/JetBrains/intellij-ui-test-robot
117-
runIdeForUiTests {
118-
systemProperty("robot-server.port", "8082")
119-
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
120-
systemProperty("jb.privacy.policy.text", "<!--999.999-->")
121-
systemProperty("jb.consents.confirmation.enabled", "false")
122-
}
123-
124125
signPlugin {
125126
certificateChain = environment("CERTIFICATE_CHAIN")
126127
privateKey = environment("PRIVATE_KEY")
127128
password = environment("PRIVATE_KEY_PASSWORD")
128129
}
130+
}
131+
132+
intellijPlatformTesting {
133+
runIde {
134+
register("runIdeForUiTests") {
135+
task {
136+
jvmArgumentProviders += CommandLineArgumentProvider {
137+
listOf(
138+
"-Drobot-server.port=8082",
139+
"-Dide.mac.message.dialogs.as.sheets=false",
140+
"-Djb.privacy.policy.text=<!--999.999-->",
141+
"-Djb.consents.confirmation.enabled=false"
142+
)
143+
}
144+
}
145+
146+
plugins {
147+
robotServerPlugin()
148+
}
149+
}
150+
}
151+
}
152+
153+
// Configure IntelliJ Platform Gradle Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-extension.html
154+
intellijPlatform {
155+
pluginConfiguration {
156+
version = properties("pluginVersion").get()
157+
158+
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
159+
description = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
160+
val start = "<!-- Plugin description -->"
161+
val end = "<!-- Plugin description end -->"
162+
163+
with(it.lines()) {
164+
if (!containsAll(listOf(start, end))) {
165+
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
166+
}
167+
subList(indexOf(start) + 1, indexOf(end)).joinToString("\n").let(::markdownToHTML)
168+
}
169+
}
170+
171+
val changelog = project.changelog // local variable for configuration cache compatibility
172+
// Get the latest available change notes from the changelog file
173+
changeNotes = properties("pluginVersion").map { pluginVersion ->
174+
with(changelog) {
175+
renderItem(
176+
(getOrNull(pluginVersion) ?: getUnreleased())
177+
.withHeader(false)
178+
.withEmptySections(false),
179+
Changelog.OutputType.HTML
180+
)
181+
}
182+
}
183+
184+
ideaVersion {
185+
sinceBuild = properties("pluginSinceBuild").get()
186+
untilBuild = properties("pluginUntilBuild").get()
187+
}
188+
}
189+
190+
signing {
191+
certificateChain = providers.environmentVariable("CERTIFICATE_CHAIN")
192+
privateKey = providers.environmentVariable("PRIVATE_KEY")
193+
password = providers.environmentVariable("PRIVATE_KEY_PASSWORD")
194+
}
129195

130-
publishPlugin {
131-
dependsOn("patchChangelog")
132-
token = environment("PUBLISH_TOKEN")
196+
publishing {
197+
token = providers.environmentVariable("PUBLISH_TOKEN")
133198
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
134199
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
135200
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
136-
// channels = properties("pluginVersion").map { listOf(it.split('-').getOrElse(1) { "default" }.split('.').first()) }
201+
channels = properties("pluginVersion")
202+
.map { listOf(it.substringAfter('-', "").substringBefore('.').ifEmpty { "default" }) }
203+
}
204+
205+
pluginVerification {
206+
ides {
207+
recommended()
208+
}
137209
}
138210
}

gradle.properties

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,23 @@ pluginVersion = 1.0.22
88

99
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
1010
pluginSinceBuild = 222
11-
# pluginUntilBuild = 242.*
11+
pluginUntilBuild =
1212

1313
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
1414
platformType = AI
15-
platformVersion = 2024.1.1.1
15+
# AS version and patch at the end
16+
platformVersion = 2023.3.1.1
17+
18+
# Example: platformBundledPlugins = com.intellij.java
19+
platformBundledPlugins = com.intellij.java
1620

1721
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
1822
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
1923
platformPlugins =
2024

2125
# Gradle Releases -> https://github.com/gradle/gradle/releases
22-
gradleVersion = 8.1
26+
# update gradle-wrapper.properties and run ./gradlew wrapper
27+
gradleVersion = 8.9
2328

2429
# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib
2530
kotlin.stdlib.default.dependency = false
@@ -34,7 +39,4 @@ org.gradle.caching = true
3439
# Enable Gradle Kotlin DSL Lazy Property Assignment -> https://docs.gradle.org/current/userguide/kotlin_dsl.html#kotdsl:assignment
3540
systemProp.org.gradle.unsafe.kotlin.assignment = true
3641

37-
# Temporary workaround for Kotlin Compiler OutOfMemoryError -> https://jb.gg/intellij-platform-kotlin-oom
38-
kotlin.incremental.useClasspathSnapshot = false
39-
40-
compose.version=1.5.12
42+
compose.version=1.6.11

gradle/libs.versions.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,22 @@
22
freemarker = "2.3.30"
33
serialization = "1.5.1"
44
jdk = "17"
5-
kotlin = "1.9.22"
5+
kotlin = "2.0.20"
66
changelog = "2.0.0"
7-
gradleIntelliJPlugin = "1.15.0"
7+
gradleIntelliJPlugin = "2.0.1"
88
spotless = "6.8.0"
99
segment = "1.13.2"
10+
junit = "4.13.2"
1011

1112
[libraries]
1213
freemarker = { group = "org.freemarker", name = "freemarker", version.ref = "freemarker" }
1314
serialization = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "serialization" }
1415
segment = { group = "com.segment.analytics.kotlin", name = "core", version.ref = "segment" }
16+
junit = { group = "junit", name = "junit", version.ref = "junit" }
1517

1618
[plugins]
1719
changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" }
18-
gradleIntelliJPlugin = { id = "org.jetbrains.intellij", version.ref = "gradleIntelliJPlugin" }
20+
compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
21+
gradleIntelliJPlugin = { id = "org.jetbrains.intellij.platform", version.ref = "gradleIntelliJPlugin" }
1922
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
2023
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }

gradle/wrapper/gradle-wrapper.jar

-18.1 KB
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
44
networkTimeout=10000
5+
validateDistributionUrl=true
56
zipStoreBase=GRADLE_USER_HOME
67
zipStorePath=wrapper/dists

gradlew

Lines changed: 17 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)