Skip to content

Commit 3b40205

Browse files
committed
Migrate plugin to Jewel
1 parent 7684a44 commit 3b40205

28 files changed

+433
-490
lines changed

build.gradle.kts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,24 @@ allprojects {
3232
}
3333
}
3434
mavenCentral()
35+
maven("https://www.jetbrains.com/intellij-repository/releases")
36+
maven("https://www.jetbrains.com/intellij-repository/snapshots")
37+
maven("https://cache-redirector.jetbrains.com/intellij-dependencies")
38+
3539
intellijPlatform {
3640
defaultRepositories()
3741
}
3842
}
3943
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin.html#setting-up-intellij-platform
4044
dependencies {
4145
extensions.configure<IntelliJPlatformDependenciesExtension> {
42-
intellijIdeaCommunity("2024.3")
46+
// https://plugins.jetbrains.com/docs/intellij/android-studio-releases-list.html
47+
intellijIdea("2025.2.4")
48+
4349
bundledPlugin("org.jetbrains.kotlin")
50+
51+
// https://github.com/JetBrains/intellij-platform-compose-plugin-template
52+
composeUI()
4453
}
4554
}
4655
}

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[versions]
2-
compose = "1.8.2"
2+
compose = "1.9.0"
33
intellij = "2.10.5"
44
jacoco = "0.8.13"
55
jdkRelease = "17"
66
kotlin = "2.2.21"
77
kover = "0.9.4"
8-
leviathan = "3.1.0-1.8.2"
8+
leviathan = "3.1.0"
99
ktor = "3.3.3"
1010

1111
[libraries]
@@ -24,7 +24,7 @@ ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "kto
2424
ktor-serialization-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" }
2525
leviathan = { module = "io.github.composegears:leviathan", version.ref = "leviathan" }
2626
leviathan-compose = { module = "io.github.composegears:leviathan-compose", version.ref = "leviathan" }
27-
tiamat = "io.github.composegears:tiamat:2.1.0-1.8.2"
27+
tiamat = "io.github.composegears:tiamat:2.1.0"
2828
xpp3 = "org.ogce:xpp3:1.1.6"
2929
xmlutil = "io.github.pdvrieze.xmlutil:serialization:0.91.3"
3030

settings.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ dependencyResolutionManagement {
3939
}
4040
}
4141
mavenCentral()
42+
maven("https://www.jetbrains.com/intellij-repository/releases")
43+
maven("https://www.jetbrains.com/intellij-repository/snapshots")
44+
maven("https://cache-redirector.jetbrains.com/intellij-dependencies")
4245
maven(url = file("m2"))
4346

4447
versionCatalogs {

tools/idea-plugin/build.gradle.kts

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
12
import io.github.composegears.valkyrie.task.CheckComposeVersionCompatibility
23
import org.jetbrains.changelog.Changelog
3-
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
4+
import org.jetbrains.intellij.platform.gradle.extensions.excludeKotlinStdlib
45
import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask.FailureLevel
56
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
67

@@ -15,8 +16,26 @@ plugins {
1516
group = rootProject.providers.gradleProperty("GROUP").get()
1617
version = rootProject.providers.gradleProperty("VERSION_NAME").get()
1718

18-
repositories {
19-
maven(url = file("../../m2"))
19+
configurations.all {
20+
// Exclude Compose Multiplatform dependencies not needed in IntelliJ plugin
21+
// exclude("androidx.annotation")
22+
// exclude("androidx.arch.core")
23+
// exclude("androidx.compose")
24+
// exclude("androidx.lifecycle")
25+
// exclude("org.jetbrains.compose")
26+
// exclude("org.jetbrains.compose.foundation")
27+
// exclude("org.jetbrains.compose.runtime")
28+
// exclude("org.jetbrains.compose.ui")
29+
// exclude("org.jetbrains.jewel")
30+
// exclude("org.jetbrains.kotlin")
31+
// exclude("org.jetbrains.kotlinx")
32+
exclude("org.jetbrains.skiko")
33+
34+
exclude(group = "net.sourceforge.plantuml") // PlantUML (~20MB) - from dev.snipme:highlights
35+
36+
// Exclude kotlinx-serialization-json-io to prevent conflicts with IntelliJ's bundled libraries
37+
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-io")
38+
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-io-jvm")
2039
}
2140

2241
configurations.all {
@@ -32,7 +51,10 @@ dependencies {
3251
implementation(projects.compose.icons)
3352
implementation(projects.compose.ui)
3453
implementation(projects.compose.util)
35-
implementation(projects.sdk.compose.foundation)
54+
implementation(projects.sdk.compose.foundation) {
55+
excludeKotlinStdlib()
56+
excludeCompose()
57+
}
3658
implementation(projects.sdk.core.extensions)
3759
implementation(projects.sdk.intellij.psi.iconpack)
3860
implementation(projects.sdk.intellij.psi.imagevector)
@@ -42,28 +64,8 @@ dependencies {
4264
implementation(projects.sdk.ir.xml)
4365
implementation(projects.shared)
4466

45-
compileOnly(compose.desktop.currentOs) {
46-
exclude(group = "org.jetbrains.compose.material")
47-
}
48-
implementation(compose.desktop.common) {
49-
exclude(group = "org.jetbrains.compose.material")
50-
}
51-
implementation(compose.desktop.linux_arm64) {
52-
exclude(group = "org.jetbrains.compose.material")
53-
}
54-
implementation(compose.desktop.linux_x64) {
55-
exclude(group = "org.jetbrains.compose.material")
56-
}
57-
implementation(compose.desktop.macos_arm64) {
58-
exclude(group = "org.jetbrains.compose.material")
59-
}
60-
implementation(compose.desktop.macos_x64) {
61-
exclude(group = "org.jetbrains.compose.material")
62-
}
63-
implementation(compose.desktop.windows_x64) {
64-
exclude(group = "org.jetbrains.compose.material")
65-
}
6667
implementation(compose.material3)
68+
implementation(compose.preview)
6769

6870
implementation(libs.android.build.tools)
6971
implementation(libs.fonticons)
@@ -84,6 +86,7 @@ dependencies {
8486

8587
intellijPlatform {
8688
zipSigner()
89+
pluginVerifier()
8790
}
8891
}
8992

@@ -96,7 +99,7 @@ intellijPlatform {
9699
projectName = "valkyrie-plugin"
97100
pluginConfiguration {
98101
ideaVersion {
99-
sinceBuild = "243"
102+
sinceBuild = "252"
100103
untilBuild = provider { null }
101104
}
102105
changeNotes = provider { changelog.render(Changelog.OutputType.HTML) }
@@ -113,14 +116,7 @@ intellijPlatform {
113116
FailureLevel.NOT_DYNAMIC,
114117
)
115118
ides {
116-
create(
117-
type = IntelliJPlatformType.IntellijIdeaCommunity,
118-
version = "2024.3.7",
119-
)
120-
create(
121-
type = IntelliJPlatformType.IntellijIdeaCommunity,
122-
version = "2025.2",
123-
)
119+
recommended()
124120
}
125121
}
126122
signing {
@@ -172,3 +168,11 @@ tasks {
172168
dependsOn(checkComposeVersionCompatibility)
173169
}
174170
}
171+
172+
173+
fun ModuleDependency.excludeCompose() {
174+
exclude("org.jetbrains.compose")
175+
exclude("org.jetbrains.compose.foundation")
176+
exclude("org.jetbrains.compose.runtime")
177+
exclude("org.jetbrains.compose.ui")
178+
}
Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package io.github.composegears.valkyrie
22

3-
import androidx.compose.runtime.Composable
43
import androidx.compose.runtime.CompositionLocalProvider
5-
import androidx.compose.ui.awt.ComposePanel
64
import com.intellij.openapi.project.DumbAware
75
import com.intellij.openapi.project.Project
86
import com.intellij.openapi.wm.ToolWindow
@@ -13,24 +11,20 @@ import io.github.composegears.valkyrie.ui.di.DI
1311
import io.github.composegears.valkyrie.ui.foundation.LocalSnackBar
1412
import io.github.composegears.valkyrie.ui.foundation.rememberSnackbarState
1513
import io.github.composegears.valkyrie.ui.foundation.theme.ValkyrieTheme
16-
import io.github.composegears.valkyrie.ui.platform.buildComposePanel
14+
import org.jetbrains.jewel.bridge.addComposeTab
1715

1816
class ValkyrieToolWindow :
1917
ToolWindowFactory,
2018
DumbAware {
2119

2220
override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) {
23-
System.setProperty("compose.swing.render.on.graphics", "true")
24-
2521
DI.initWith(project)
2622

27-
toolWindow.apply {
28-
setTitleActions(listOf(RefreshPluginAction()))
29-
addComposePanel {
30-
ValkyrieTheme(project = project, currentComponent = this) {
31-
CompositionLocalProvider(LocalSnackBar provides rememberSnackbarState()) {
32-
ValkyriePlugin()
33-
}
23+
toolWindow.setTitleActions(listOf(RefreshPluginAction()))
24+
toolWindow.addComposeTab(focusOnClickInside = true) {
25+
ValkyrieTheme(project = project) {
26+
CompositionLocalProvider(LocalSnackBar provides rememberSnackbarState()) {
27+
ValkyriePlugin()
3428
}
3529
}
3630
}
@@ -40,10 +34,3 @@ class ValkyrieToolWindow :
4034
const val ID = "Valkyrie"
4135
}
4236
}
43-
44-
private fun ToolWindow.addComposePanel(
45-
displayName: String = "",
46-
isLockable: Boolean = true,
47-
content: @Composable ComposePanel.() -> Unit,
48-
) = buildComposePanel(content = content)
49-
.also { contentManager.addContent(contentManager.factory.createContent(it, displayName, isLockable)) }

tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/action/dialog/RequiredIconPackModeDialog.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ import io.github.composegears.valkyrie.sdk.compose.foundation.layout.CenterVerti
2020
import io.github.composegears.valkyrie.ui.foundation.icons.Warning
2121
import io.github.composegears.valkyrie.ui.foundation.theme.PreviewTheme
2222
import io.github.composegears.valkyrie.ui.foundation.theme.ValkyrieTheme
23-
import io.github.composegears.valkyrie.ui.platform.buildComposePanel
2423
import java.awt.event.ActionEvent
2524
import javax.swing.Action
25+
import org.jetbrains.jewel.bridge.compose
2626

2727
class RequiredIconPackModeDialog(
2828
private val message: String,
@@ -36,7 +36,7 @@ class RequiredIconPackModeDialog(
3636
init()
3737
}
3838

39-
override fun createCenterPanel() = buildComposePanel {
39+
override fun createCenterPanel() = compose(focusOnClickInside = true) {
4040
ValkyrieTheme {
4141
DialogContentUi(
4242
modifier = Modifier.fillMaxSize(),

tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/editor/TextEditorWithImageVectorPreview.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ private class ImageVectorPreviewEditor(
5252

5353
private val composePanel = ComposePanel().apply {
5454
setContent {
55-
ValkyrieTheme(project, this) {
55+
ValkyrieTheme(project) {
5656
VirtualFileImageVector(
5757
modifier = Modifier.fillMaxSize(),
5858
file = file,

tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/foundation/ScrollableTabRow.kt

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

tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/foundation/theme/CompositionLocal.kt

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

0 commit comments

Comments
 (0)