Skip to content

Commit 6dedba3

Browse files
authored
CM-55396 - bump supported plugin version (#91)
1 parent 64183ad commit 6dedba3

File tree

12 files changed

+131
-104
lines changed

12 files changed

+131
-104
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
echo "$CHANGELOG" >> $GITHUB_OUTPUT
7171
echo "EOF" >> $GITHUB_OUTPUT
7272
73-
./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
73+
./gradlew printProductsReleases # prepare list of IDEs for Plugin Verifier
7474
7575
- name: Build plugin
7676
run: ./gradlew buildPlugin
@@ -144,6 +144,7 @@ jobs:
144144
client-id: ${{ secrets.CIMON_CLIENT_ID }}
145145
secret: ${{ secrets.CIMON_SECRET }}
146146
allowed-hosts: >
147+
download.jetbrains.com
147148
cache-redirector.jetbrains.com
148149
cdn.azul.com
149150
data.services.jetbrains.com
@@ -158,10 +159,15 @@ jobs:
158159
159160
- name: Maximize Build Space
160161
run: |
162+
sudo docker image prune --all --force || true
163+
161164
sudo rm -rf /usr/share/dotnet
162165
sudo rm -rf /usr/local/lib/android
163166
sudo rm -rf /opt/ghc
164167
sudo rm -rf /usr/local/.ghcup
168+
sudo rm -rf /opt/hostedtoolcache
169+
sudo rm -rf /usr/share/swift
170+
sudo rm -rf /usr/local/share/powershell
165171
166172
sudo apt-get remove -y '^aspnetcore-.*' || echo "::warning::The command [sudo apt-get remove -y '^aspnetcore-.*'] failed to complete successfully. Proceeding..."
167173
sudo apt-get remove -y '^dotnet-.*' --fix-missing || echo "::warning::The command [sudo apt-get remove -y '^dotnet-.*' --fix-missing] failed to complete successfully. Proceeding..."
@@ -175,8 +181,6 @@ jobs:
175181
sudo apt-get autoremove -y || echo "::warning::The command [sudo apt-get autoremove -y] failed to complete successfully. Proceeding..."
176182
sudo apt-get clean || echo "::warning::The command [sudo apt-get clean] failed to complete successfully. Proceeding..."
177183
178-
sudo docker image prune --all --force || true
179-
180184
- name: Fetch Sources
181185
uses: actions/checkout@v4
182186

@@ -195,10 +199,10 @@ jobs:
195199
uses: actions/cache@v3
196200
with:
197201
path: ${{ needs.build.outputs.pluginVerifierHomeDir }}/ides
198-
key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }}
202+
key: plugin-verifier-${{ hashFiles('build/printProductsReleases.txt') }}
199203

200204
- name: Run Plugin Verification tasks
201-
run: ./gradlew runPluginVerifier -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}
205+
run: ./gradlew verifyPlugin -Dplugin.verifier.home.dir=${{ needs.build.outputs.pluginVerifierHomeDir }}
202206

203207
- name: Collect Plugin Verifier Result
204208
if: ${{ always() }}

build.gradle.kts

Lines changed: 98 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,24 @@ version = properties("pluginVersion").get()
1919
// Configure project's dependencies
2020
repositories {
2121
mavenCentral()
22+
23+
intellijPlatform {
24+
defaultRepositories()
25+
}
2226
}
2327

2428
// Dependencies are managed with Gradle version catalog - read more: https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog
2529
dependencies {
2630
implementation(libs.annotations)
2731
implementation(libs.jackson)
2832
implementation(libs.flexmark)
33+
34+
intellijPlatform {
35+
intellijIdeaCommunity(properties("platformVersion"))
36+
// Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
37+
// Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
38+
bundledPlugin("com.intellij.java")
39+
}
2940
}
3041

3142
// Set the JVM language level used to build the project. We are using Java 17 for 2022.2+.
@@ -40,16 +51,71 @@ java {
4051
}
4152
}
4253

43-
// Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
44-
intellij {
45-
pluginName = properties("pluginName")
46-
version = properties("platformVersion")
47-
type = properties("platformType")
54+
intellijPlatform {
55+
projectName = project.name
56+
57+
// required for Auto-Reload development mode
58+
buildSearchableOptions = false
59+
60+
pluginConfiguration {
61+
name = properties("pluginName").get()
62+
version = properties("pluginVersion").get()
63+
64+
ideaVersion {
65+
sinceBuild = properties("pluginSinceBuild")
66+
untilBuild = properties("pluginUntilBuild")
67+
}
68+
69+
description = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
70+
val start = "<!-- Plugin description -->"
71+
val end = "<!-- Plugin description end -->"
72+
73+
with(it.lines()) {
74+
if (!containsAll(listOf(start, end))) {
75+
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
76+
}
77+
subList(indexOf(start) + 1, indexOf(end)).joinToString("\n").let(::markdownToHTML)
78+
}
79+
}
80+
81+
val changelog = project.changelog // local variable for configuration cache compatibility
82+
// Get the latest available change notes from the changelog file
83+
changeNotes = properties("pluginVersion").map { pluginVersion ->
84+
with(changelog) {
85+
renderItem(
86+
(getOrNull(pluginVersion) ?: getUnreleased())
87+
.withHeader(false)
88+
.withEmptySections(false),
89+
Changelog.OutputType.HTML,
90+
)
91+
}
92+
}
93+
}
94+
95+
publishing {
96+
token = environment("PUBLISH_TOKEN")
97+
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
98+
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
99+
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
100+
channels.set(
101+
properties("pluginVersion").map { pluginVersion: String ->
102+
val channel = pluginVersion.substringAfter('-', "default").substringBefore('.')
103+
listOf<String>(channel)
104+
}
105+
)
106+
}
48107

49-
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
50-
plugins = properties("platformPlugins").map { it.split(',').map(String::trim).filter(String::isNotEmpty) }
108+
signing {
109+
certificateChain = environment("CERTIFICATE_CHAIN")
110+
privateKey = environment("PRIVATE_KEY")
111+
password = environment("PRIVATE_KEY_PASSWORD")
112+
}
51113

52-
updateSinceUntilBuild = false
114+
pluginVerification {
115+
ides {
116+
recommended()
117+
}
118+
}
53119
}
54120

55121
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
@@ -86,70 +152,33 @@ tasks {
86152
gradleVersion = properties("gradleVersion").get()
87153
}
88154

89-
patchPluginXml {
90-
version = properties("pluginVersion")
91-
sinceBuild = properties("pluginSinceBuild")
92-
untilBuild = properties("pluginUntilBuild")
93-
94-
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
95-
pluginDescription = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
96-
val start = "<!-- Plugin description -->"
97-
val end = "<!-- Plugin description end -->"
98-
99-
with(it.lines()) {
100-
if (!containsAll(listOf(start, end))) {
101-
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
102-
}
103-
subList(indexOf(start) + 1, indexOf(end)).joinToString("\n").let(::markdownToHTML)
104-
}
105-
}
106-
107-
val changelog = project.changelog // local variable for configuration cache compatibility
108-
// Get the latest available change notes from the changelog file
109-
changeNotes = properties("pluginVersion").map { pluginVersion ->
110-
with(changelog) {
111-
renderItem(
112-
(getOrNull(pluginVersion) ?: getUnreleased())
113-
.withHeader(false)
114-
.withEmptySections(false),
115-
Changelog.OutputType.HTML,
116-
)
117-
}
118-
}
119-
}
120-
121-
// Configure UI tests plugin
122-
// Read more: https://github.com/JetBrains/intellij-ui-test-robot
123-
runIdeForUiTests {
124-
systemProperty("robot-server.port", "8082")
125-
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
126-
systemProperty("jb.privacy.policy.text", "<!--999.999-->")
127-
systemProperty("jb.consents.confirmation.enabled", "false")
128-
}
129-
130155
runIde {
131-
systemProperty("idea.log.debug.categories", "com.cycode.plugin")
132-
}
133-
134-
signPlugin {
135-
certificateChain = environment("CERTIFICATE_CHAIN")
136-
privateKey = environment("PRIVATE_KEY")
137-
password = environment("PRIVATE_KEY_PASSWORD")
156+
jvmArgumentProviders += CommandLineArgumentProvider {
157+
listOf(
158+
"-Didea.log.debug.categories=com.cycode.plugin"
159+
)
160+
}
138161
}
162+
}
139163

140-
publishPlugin {
141-
dependsOn("patchChangelog")
142-
dependsOn("sentryUploadSourceBundleJava")
143-
token = environment("PUBLISH_TOKEN")
144-
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
145-
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
146-
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
147-
channels =
148-
properties("pluginVersion").map { listOf(it.split('-').getOrElse(1) { "default" }.split('.').first()) }
164+
val runIdeForUiTests by intellijPlatformTesting.runIde.registering {
165+
task {
166+
jvmArgumentProviders += CommandLineArgumentProvider {
167+
listOf(
168+
"-Drobot-server.port=8082",
169+
"-Dide.mac.message.dialogs.as.sheets=false",
170+
"-Djb.privacy.policy.text=<!--999.999-->",
171+
"-Djb.consents.confirmation.enabled=false",
172+
)
149173
}
174+
}
150175

151-
buildSearchableOptions {
152-
// required for Auto-Reload development mode
153-
enabled = false
154-
}
176+
plugins {
177+
robotServerPlugin()
178+
}
155179
}
180+
181+
tasks.named("publishPlugin") {
182+
dependsOn("patchChangelog")
183+
dependsOn("sentryUploadSourceBundleJava")
184+
}

gradle.properties

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,18 @@ pluginRepositoryUrl = https://github.com/cycodehq/intellij-platform-plugin
77
pluginVersion = 2.6.0
88

99
# Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
10-
pluginSinceBuild = 231
11-
pluginUntilBuild = 252.*
10+
pluginSinceBuild = 241
11+
pluginUntilBuild = 253.*
1212

13-
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
14-
platformType = IC
13+
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin.html
1514
# 2021.1 - Apple Silicon support + fixes for development on Apple Silicon
1615
# 2022.3 - minimum version for IntelliJ Platform Gradle Plugin (2.x)
1716
# 2023.1 - allows to fix "com.intellij.diagnostic.PluginException: `ActionUpdateThread.OLD_EDT` is deprecated blabla"
18-
platformVersion = 2023.1
19-
20-
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
21-
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
22-
platformPlugins = com.intellij.java
17+
# 2024.1 - allows to fix "com.cycode.plugin.services.ServicesKt" compatibility issues
18+
platformVersion = 2024.1
2319

2420
# Gradle Releases -> https://github.com/gradle/gradle/releases
25-
gradleVersion = 8.4
21+
gradleVersion = 8.14.1
2622

2723
# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib
2824
kotlin.stdlib.default.dependency = false

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ flexmark = "0.64.8"
66

77
# plugins
88
dokka = "1.9.20"
9-
kotlin = "2.0.10"
9+
kotlin = "2.2.0"
1010
changelog = "2.2.1"
11-
gradleIntelliJPlugin = "1.17.4" # the latest before 2.0 with a lot of breaking changes
11+
gradleIntelliJPlugin = "2.10.4"
1212
kover = "0.7.3"
1313
sentry = "4.11.0"
1414

@@ -20,7 +20,7 @@ flexmark = { group = "com.vladsch.flexmark", name = "flexmark-all", version.ref
2020
[plugins]
2121
changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" }
2222
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
23-
gradleIntelliJPlugin = { id = "org.jetbrains.intellij", version.ref = "gradleIntelliJPlugin" }
23+
gradleIntelliJPlugin = { id = "org.jetbrains.intellij.platform", version.ref = "gradleIntelliJPlugin" }
2424
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
2525
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
2626
sentry = { id = "io.sentry.jvm.gradle", version.ref = "sentry" }

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

src/main/kotlin/com/cycode/plugin/cli/CliWrapper.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,13 @@ class CliWrapper(val workDirectory: String? = null) {
9292
}
9393

9494
if (T::class == Unit::class) {
95+
@Suppress("UNCHECKED_CAST")
9596
return CliResult.Success(Unit) as CliResult<T>
9697
}
9798

9899
try {
99100
val result: T = mapper.readValue(stdout)
101+
@Suppress("UNCHECKED_CAST")
100102
return CliResult.Success(result)
101103
} catch (e: Exception) {
102104
thisLogger().warn("Failed to parse success CLI output: $stdout", e)

src/main/kotlin/com/cycode/plugin/components/toolWindow/components/treeView/components/detectionNodeContextMenu/DetectionNodeContextMenu.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import com.intellij.openapi.ui.popup.LightweightWindowEvent
1414
import com.intellij.openapi.util.text.StringUtil.convertLineSeparators
1515
import com.intellij.openapi.util.text.StringUtil.first
1616
import com.intellij.ui.ColoredListCellRenderer
17-
import com.intellij.vcs.commit.message.CommitMessageInspectionProfile.getSubjectRightMargin
1817
import org.jetbrains.annotations.Nls
1918
import java.awt.event.MouseEvent
2019
import javax.swing.JList
@@ -121,7 +120,7 @@ class DetectionNodeContextMenu(
121120
return
122121
}
123122

124-
val rightMargin = getSubjectRightMargin(project)
123+
val rightMargin = 50
125124
JBPopupFactory.getInstance().createPopupChooserBuilder(options)
126125
.setVisibleRowCount(7)
127126
.setSelectionMode(SINGLE_SELECTION)

src/main/kotlin/com/cycode/plugin/services/DownloadService.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import io.sentry.Sentry
77
import java.io.BufferedInputStream
88
import java.io.File
99
import java.io.FileOutputStream
10-
import java.net.URL
10+
import java.net.URI
1111
import java.nio.file.Files
1212

1313

@@ -22,7 +22,7 @@ class DownloadService {
2222
thisLogger().warn("Retrieving $url")
2323

2424
try {
25-
val urlObj = URL(url)
25+
val urlObj = URI(url).toURL()
2626
val connection = urlObj.openConnection()
2727
connection.connect()
2828

@@ -53,7 +53,7 @@ class DownloadService {
5353
thisLogger().warn("Temp path: ${tempFile.absolutePath}")
5454

5555
try {
56-
val urlObj = URL(url)
56+
val urlObj = URI(url).toURL()
5757
val connection = urlObj.openConnection()
5858
connection.connect()
5959

src/main/kotlin/com/cycode/plugin/services/GithubReleaseService.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
66
import com.fasterxml.jackson.module.kotlin.readValue
77
import com.intellij.openapi.components.Service
88
import io.sentry.Sentry
9-
import java.net.URL
9+
import java.net.URI
1010

1111

1212
data class GitHubReleaseAsset(
@@ -29,7 +29,7 @@ class GithubReleaseService {
2929

3030
private fun getJson(url: String): String? {
3131
try {
32-
val urlObj = URL(url)
32+
val urlObj = URI(url).toURL()
3333
val connection = urlObj.openConnection()
3434
connection.setRequestProperty("Accept", "application/vnd.github.v3+json")
3535

0 commit comments

Comments
 (0)