Skip to content

Commit 0f46b91

Browse files
committed
Target to IntelliJ 2024.3
1 parent da0281b commit 0f46b91

File tree

5 files changed

+131
-131
lines changed

5 files changed

+131
-131
lines changed

build.gradle.kts

Lines changed: 103 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import org.jetbrains.changelog.markdownToHTML
33
import org.jetbrains.grammarkit.tasks.GenerateLexerTask
44
import org.jetbrains.grammarkit.tasks.GenerateParserTask
55
import org.jetbrains.kotlin.gradle.internal.ensureParentDirsCreated
6+
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
67

78
fun properties(key: String) = providers.gradleProperty(key)
89

@@ -11,7 +12,7 @@ fun environment(key: String) = providers.environmentVariable(key)
1112
plugins {
1213
id("java") // Java support
1314
alias(libs.plugins.kotlin) // Kotlin support
14-
alias(libs.plugins.gradleIntelliJPlugin) // Gradle IntelliJ Plugin
15+
alias(libs.plugins.intelliJPlatform) // Gradle IntelliJ Plugin
1516
alias(libs.plugins.changelog) // Gradle Changelog Plugin
1617
alias(libs.plugins.qodana) // Gradle Qodana Plugin
1718
alias(libs.plugins.kover) // Gradle Kover Plugin
@@ -25,6 +26,11 @@ version = properties("pluginVersion").get()
2526
repositories {
2627
mavenLocal()
2728
mavenCentral()
29+
30+
// IntelliJ Platform Gradle Plugin Repositories Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-repositories-extension.html
31+
intellijPlatform {
32+
defaultRepositories()
33+
}
2834
}
2935

3036
dependencies {
@@ -34,6 +40,22 @@ dependencies {
3440
implementation("com.bybutter.sisyphus:sisyphus-grpc:2.1.22")
3541
implementation("com.bybutter.sisyphus:sisyphus-jackson-protobuf:2.1.22")
3642
implementation("io.grpc:grpc-netty:1.65.0")
43+
44+
// IntelliJ Platform Gradle Plugin Dependencies Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html
45+
intellijPlatform {
46+
create(providers.gradleProperty("platformType"), providers.gradleProperty("platformVersion"))
47+
48+
// Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins.
49+
bundledPlugins(providers.gradleProperty("platformBundledPlugins").map { it.split(',') })
50+
51+
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file for plugin from JetBrains Marketplace.
52+
plugins(providers.gradleProperty("platformPlugins").map { it.split(',') })
53+
54+
instrumentationTools()
55+
pluginVerifier()
56+
zipSigner()
57+
testFramework(TestFrameworkType.Platform)
58+
}
3759
}
3860

3961
// Set the JVM language level used to build the project.
@@ -44,20 +66,68 @@ kotlin {
4466
}
4567
}
4668

47-
// Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
48-
intellij {
49-
pluginName = properties("pluginName")
50-
version = properties("platformVersion")
51-
type = properties("platformType")
69+
// Configure IntelliJ Platform Gradle Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-extension.html
70+
intellijPlatform {
71+
pluginConfiguration {
72+
version = providers.gradleProperty("pluginVersion")
73+
74+
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
75+
description = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
76+
val start = "<!-- Plugin description -->"
77+
val end = "<!-- Plugin description end -->"
78+
79+
with(it.lines()) {
80+
if (!containsAll(listOf(start, end))) {
81+
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
82+
}
83+
subList(indexOf(start) + 1, indexOf(end)).joinToString("\n").let(::markdownToHTML)
84+
}
85+
}
5286

53-
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
54-
plugins = properties("platformPlugins").map { it.split(',').map(String::trim).filter(String::isNotEmpty) }
87+
val changelog = project.changelog // local variable for configuration cache compatibility
88+
// Get the latest available change notes from the changelog file
89+
changeNotes = providers.gradleProperty("pluginVersion").map { pluginVersion ->
90+
with(changelog) {
91+
renderItem(
92+
(getOrNull(pluginVersion) ?: getUnreleased())
93+
.withHeader(false)
94+
.withEmptySections(false),
95+
Changelog.OutputType.HTML,
96+
)
97+
}
98+
}
99+
100+
ideaVersion {
101+
sinceBuild = providers.gradleProperty("pluginSinceBuild")
102+
untilBuild = providers.gradleProperty("pluginUntilBuild")
103+
}
104+
}
105+
106+
signing {
107+
certificateChain = providers.environmentVariable("CERTIFICATE_CHAIN")
108+
privateKey = providers.environmentVariable("PRIVATE_KEY")
109+
password = providers.environmentVariable("PRIVATE_KEY_PASSWORD")
110+
}
111+
112+
publishing {
113+
token = providers.environmentVariable("PUBLISH_TOKEN")
114+
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
115+
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
116+
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
117+
channels = providers.gradleProperty("pluginVersion").map { listOf(it.substringAfter('-', "").substringBefore('.').ifEmpty { "default" }) }
118+
}
119+
120+
pluginVerification {
121+
ides {
122+
recommended()
123+
}
124+
}
55125
}
56126

57127
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
58128
changelog {
59129
groups.empty()
60-
repositoryUrl = properties("pluginRepositoryUrl")
130+
repositoryUrl = providers.gradleProperty("pluginRepositoryUrl")
61131
}
62132

63133
// Configure Gradle Kover Plugin - read more: https://github.com/Kotlin/kotlinx-kover#configuration
@@ -76,53 +146,6 @@ tasks {
76146
gradleVersion = properties("gradleVersion").get()
77147
}
78148

79-
patchPluginXml {
80-
version = properties("pluginVersion")
81-
sinceBuild = properties("pluginSinceBuild")
82-
untilBuild = properties("pluginUntilBuild")
83-
84-
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
85-
pluginDescription =
86-
providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
87-
val start = "<!-- Plugin description -->"
88-
val end = "<!-- Plugin description end -->"
89-
90-
with(it.lines()) {
91-
if (!containsAll(listOf(start, end))) {
92-
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
93-
}
94-
subList(indexOf(start) + 1, indexOf(end)).joinToString("\n").let(::markdownToHTML)
95-
}
96-
}
97-
98-
val changelog = project.changelog // local variable for configuration cache compatibility
99-
// Get the latest available change notes from the changelog file
100-
changeNotes =
101-
properties("pluginVersion").map { pluginVersion ->
102-
with(changelog) {
103-
renderItem(
104-
(getOrNull(pluginVersion) ?: getUnreleased())
105-
.withHeader(false)
106-
.withEmptySections(false),
107-
Changelog.OutputType.HTML,
108-
)
109-
}
110-
}
111-
}
112-
113-
// Configure UI tests plugin
114-
// Read more: https://github.com/JetBrains/intellij-ui-test-robot
115-
runIdeForUiTests {
116-
systemProperty("robot-server.port", "8082")
117-
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
118-
systemProperty("jb.privacy.policy.text", "<!--999.999-->")
119-
systemProperty("jb.consents.confirmation.enabled", "false")
120-
}
121-
122-
runIde {
123-
jvmArguments.add("-Didea.ProcessCanceledException=disabled")
124-
}
125-
126149
generateLexer {
127150
sourceFile = layout.projectDirectory.file("src/main/grammar/protobuf.flex")
128151
targetOutputDir =
@@ -154,7 +177,7 @@ tasks {
154177
}
155178

156179
prepareSandbox {
157-
val file = layout.buildDirectory.file("idea-sandbox/config/disabled_plugins.txt").get().asFile
180+
val file = sandboxConfigDirectory.file("disabled_plugins.txt").get().asFile
158181
doLast {
159182
file.ensureParentDirsCreated()
160183
file.writeText(
@@ -164,20 +187,11 @@ tasks {
164187
},
165188
)
166189
}
190+
167191
}
168192

169193
publishPlugin {
170-
dependsOn("patchChangelog")
171-
token = environment("PUBLISH_TOKEN")
172-
// pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
173-
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
174-
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
175-
channels =
176-
properties("pluginVersion").map {
177-
listOf(
178-
it.substringAfter('-', "").substringBefore('.').ifEmpty { "default" },
179-
)
180-
}
194+
dependsOn(patchChangelog)
181195
}
182196

183197
compileKotlin {
@@ -192,3 +206,24 @@ sourceSets {
192206
}
193207
}
194208
}
209+
210+
intellijPlatformTesting {
211+
runIde {
212+
register("runIdeForUiTests") {
213+
task {
214+
jvmArgumentProviders += CommandLineArgumentProvider {
215+
listOf(
216+
"-Drobot-server.port=8082",
217+
"-Dide.mac.message.dialogs.as.sheets=false",
218+
"-Djb.privacy.policy.text=<!--999.999-->",
219+
"-Djb.consents.confirmation.enabled=false",
220+
)
221+
}
222+
}
223+
224+
plugins {
225+
robotServerPlugin()
226+
}
227+
}
228+
}
229+
}

gradle.properties

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,34 @@
22
pluginGroup=io.kanro.idea.plugin.protobuf
33
pluginName=IntelliJ Protobuf Language Plugin
44
pluginRepositoryUrl=https://github.com/devkanro/intellij-protobuf-plugin
5+
56
# SemVer format -> https://semver.org
6-
pluginVersion=2.0.1
7+
pluginVersion=2.0.2
8+
79
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
810
pluginSinceBuild=241
9-
pluginUntilBuild=242.*
11+
pluginUntilBuild=243.*
12+
1013
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
1114
platformType=IU
12-
platformVersion=2024.1
15+
platformVersion=2024.3.1.1
16+
1317
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
14-
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
15-
platformPlugins=com.intellij.java, org.jetbrains.kotlin, org.intellij.plugins.markdown, org.jetbrains.plugins.go:241.14494.240, com.jetbrains.restClient:241.14494.150, com.intellij.grpc:241.14494.150
18+
# Example: platformPlugins = com.jetbrains.php:203.4449.22, org.intellij.scala:2023.3.27@EAP
19+
platformPlugins=org.jetbrains.plugins.go:243.22562.218, com.jetbrains.restClient:243.23654.19, com.intellij.grpc:243.23654.44
20+
# Example: platformBundledPlugins = com.intellij.java
21+
platformBundledPlugins=com.intellij.java, org.jetbrains.kotlin, org.intellij.plugins.markdown
22+
1623
# Gradle Releases -> https://github.com/gradle/gradle/releases
17-
gradleVersion=8.7
24+
gradleVersion = 8.10.2
25+
1826
# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib
19-
kotlin.stdlib.default.dependency=false
27+
kotlin.stdlib.default.dependency = false
28+
2029
# Enable Gradle Configuration Cache -> https://docs.gradle.org/current/userguide/configuration_cache.html
21-
org.gradle.configuration-cache=true
30+
org.gradle.configuration-cache = true
31+
2232
# Enable Gradle Build Cache -> https://docs.gradle.org/current/userguide/build_cache.html
23-
org.gradle.caching=true
33+
org.gradle.caching = true
34+
2435
kotlin.daemon.jvmargs=-Xmx16G

gradle/libs.versions.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
[versions]
22
# libraries
3-
exampleLibrary = "24.1.0"
3+
junit = "4.13.2"
44

55
# plugins
6-
kotlin = "2.0.0"
76
changelog = "2.2.1"
8-
gradleIntelliJPlugin = "1.17.4"
9-
qodana = "2024.1.5"
10-
kover = "0.8.2"
7+
intelliJPlatform = "2.1.0"
8+
kotlin = "2.1.0"
9+
kover = "0.8.3"
10+
qodana = "2024.2.3"
1111
grammarkit = "2022.3.2.2"
1212

1313
[libraries]
14-
exampleLibrary = { group = "com.example", name = "exampleLibrary", version.ref = "exampleLibrary" }
14+
junit = { group = "junit", name = "junit", version.ref = "junit" }
1515

1616
[plugins]
1717
changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" }
18-
gradleIntelliJPlugin = { id = "org.jetbrains.intellij", version.ref = "gradleIntelliJPlugin" }
18+
intelliJPlatform = { id = "org.jetbrains.intellij.platform", version.ref = "intelliJPlatform" }
1919
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
2020
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
2121
qodana = { id = "org.jetbrains.qodana", version.ref = "qodana" }
22-
grammarkit = { id = "org.jetbrains.grammarkit", version.ref = "grammarkit" }
22+
grammarkit = { id = "org.jetbrains.grammarkit", version.ref = "grammarkit" }

src/main/kotlin/io/kanro/idea/plugin/protobuf/lang/reference/ProtobufSymbolReferenceContributor.kt

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/main/resources/META-INF/plugin.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,6 @@
130130
instance="io.kanro.idea.plugin.protobuf.lang.settings.ProtobufSettingsConfigurable"/>
131131
<gotoSymbolContributor
132132
implementation="io.kanro.idea.plugin.protobuf.lang.reference.ProtobufGotoSymbolContributor"/>
133-
<psi.referenceContributor
134-
language="protobuf"
135-
implementation="io.kanro.idea.plugin.protobuf.lang.reference.ProtobufSymbolReferenceContributor"/>
136133
<colorSettingsPage
137134
implementation="io.kanro.idea.plugin.protobuf.lang.highlight.ProtobufColorSettingsPage"/>
138135

0 commit comments

Comments
 (0)