Skip to content

Commit 308ee55

Browse files
committed
Migrate plugin to Jewel
1 parent f35a957 commit 308ee55

28 files changed

+432
-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: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import io.github.composegears.valkyrie.task.CheckComposeVersionCompatibility
22
import org.jetbrains.changelog.Changelog
3-
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
3+
import org.jetbrains.intellij.platform.gradle.extensions.excludeKotlinStdlib
44
import org.jetbrains.intellij.platform.gradle.tasks.VerifyPluginTask.FailureLevel
55
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
66

@@ -15,8 +15,26 @@ plugins {
1515
group = rootProject.providers.gradleProperty("GROUP").get()
1616
version = rootProject.providers.gradleProperty("VERSION_NAME").get()
1717

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

2240
configurations.all {
@@ -33,7 +51,10 @@ dependencies {
3351
implementation(projects.compose.util)
3452
implementation(projects.sdk.compose.codeviewer)
3553
implementation(projects.sdk.compose.highlightsCore)
36-
implementation(projects.sdk.compose.foundation)
54+
implementation(projects.sdk.compose.foundation) {
55+
excludeKotlinStdlib()
56+
excludeCompose()
57+
}
3758
implementation(projects.sdk.core.extensions)
3859
implementation(projects.sdk.intellij.psi.iconpack)
3960
implementation(projects.sdk.intellij.psi.imagevector)
@@ -43,28 +64,8 @@ dependencies {
4364
implementation(projects.sdk.ir.xml)
4465
implementation(projects.shared)
4566

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

6970
implementation(libs.android.build.tools)
7071
implementation(libs.fonticons)
@@ -85,6 +86,7 @@ dependencies {
8586

8687
intellijPlatform {
8788
zipSigner()
89+
pluginVerifier()
8890
}
8991
}
9092

@@ -97,7 +99,7 @@ intellijPlatform {
9799
projectName = "valkyrie-plugin"
98100
pluginConfiguration {
99101
ideaVersion {
100-
sinceBuild = "243"
102+
sinceBuild = "252"
101103
untilBuild = provider { null }
102104
}
103105
changeNotes = provider { changelog.render(Changelog.OutputType.HTML) }
@@ -114,14 +116,7 @@ intellijPlatform {
114116
FailureLevel.NOT_DYNAMIC,
115117
)
116118
ides {
117-
create(
118-
type = IntelliJPlatformType.IntellijIdeaCommunity,
119-
version = "2024.3.7",
120-
)
121-
create(
122-
type = IntelliJPlatformType.IntellijIdeaCommunity,
123-
version = "2025.2",
124-
)
119+
recommended()
125120
}
126121
}
127122
signing {
@@ -173,3 +168,11 @@ tasks {
173168
dependsOn(checkComposeVersionCompatibility)
174169
}
175170
}
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)