Skip to content

Commit 5b1fcf6

Browse files
committed
build: enable maven publishing for mpp-core and mpp-ui
Add maven-publish plugin and tasks to publish mpp-core and mpp-ui artifacts to mavenLocal for use in mpp-idea. Update dependencies to use published artifacts and exclude conflicting Compose/androidx modules. Refactor Compose dialog usage for compatibility.
1 parent f5aaf99 commit 5b1fcf6

File tree

9 files changed

+59
-12
lines changed

9 files changed

+59
-12
lines changed

build.gradle.kts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,22 @@ allprojects {
2222
mavenCentral()
2323
}
2424
}
25+
26+
// Convenience task to publish mpp-core and mpp-ui to mavenLocal for mpp-idea composite build
27+
// Only publishes JVM and multiplatform metadata publications (skips WASM/JS/iOS)
28+
tasks.register("publishDepsForIdea") {
29+
group = "publishing"
30+
description = "Publish mpp-core and mpp-ui JVM artifacts to mavenLocal for mpp-idea"
31+
32+
dependsOn(
33+
":mpp-core:publishJvmPublicationToMavenLocal",
34+
":mpp-core:publishKotlinMultiplatformPublicationToMavenLocal",
35+
":mpp-ui:publishJvmPublicationToMavenLocal",
36+
":mpp-ui:publishKotlinMultiplatformPublicationToMavenLocal"
37+
)
38+
39+
doLast {
40+
println("✅ Published mpp-core and mpp-ui JVM artifacts to mavenLocal")
41+
println("Now you can build mpp-idea with: ./gradlew :mpp-idea:build")
42+
}
43+
}

mpp-core/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44
kotlin("multiplatform")
55
kotlin("plugin.serialization")
66
id("com.android.library")
7+
`maven-publish`
78

89
// Temporarily disabled: npm publish plugin doesn't support wasmJs targets
910
// TODO: Re-enable once plugin supports wasmJs or split into separate modules

mpp-idea/build.gradle.kts

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ project(":") {
198198

199199
repositories {
200200
mavenCentral()
201+
mavenLocal() // For locally published mpp-ui and mpp-core artifacts
201202
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
202203

203204
intellijPlatform {
@@ -317,9 +318,36 @@ project(":") {
317318
implementation(project(":mpp-idea-exts:ext-terminal"))
318319
implementation(project(":mpp-idea-exts:devins-lang"))
319320

320-
// mpp-core dependency for root project - allow Compose dependencies for compilation
321-
// Runtime will use IntelliJ's bundled Compose via bundledModule
321+
implementation("io.ktor:ktor-client-core:3.2.2")
322+
implementation("io.ktor:ktor-client-cio:3.2.2")
323+
implementation("io.ktor:ktor-client-content-negotiation:3.2.2")
324+
implementation("io.ktor:ktor-serialization-kotlinx-json:3.2.2")
325+
implementation("io.ktor:ktor-client-logging:3.2.2")
326+
327+
// mpp-core dependency for root project - use published artifact
322328
implementation("cc.unitmesh:mpp-core:${prop("mppVersion")}")
329+
330+
// mpp-ui dependency - use Maven coordinates (requires publishToMavenLocal first)
331+
// Exclude all Compose/androidx to use IntelliJ's bundled versions
332+
implementation("cc.unitmesh:mpp-ui:${prop("mppVersion")}") {
333+
exclude(group = "org.jetbrains.compose.ui")
334+
exclude(group = "org.jetbrains.compose.foundation")
335+
exclude(group = "org.jetbrains.compose.material")
336+
exclude(group = "org.jetbrains.compose.material3")
337+
exclude(group = "org.jetbrains.compose.runtime")
338+
exclude(group = "org.jetbrains.compose.animation")
339+
exclude(group = "org.jetbrains.compose.components")
340+
exclude(group = "org.jetbrains.compose.desktop")
341+
exclude(group = "org.jetbrains.androidx.lifecycle")
342+
exclude(group = "androidx.lifecycle")
343+
exclude(group = "androidx.annotation")
344+
exclude(group = "androidx.collection")
345+
exclude(group = "androidx.activity")
346+
exclude(group = "androidx.core")
347+
exclude(group = "androidx.appcompat")
348+
exclude(group = "org.jetbrains.skiko")
349+
exclude(group = "org.jetbrains.skia")
350+
}
323351
}
324352

325353
tasks {

mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaMcpConfigDialog.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import com.intellij.util.ui.JBUI
3434
import kotlinx.coroutines.flow.distinctUntilChanged
3535
import kotlinx.coroutines.launch
3636
import kotlinx.serialization.json.Json
37-
import org.jetbrains.jewel.bridge.compose
37+
import org.jetbrains.jewel.bridge.JewelComposePanel
3838
import org.jetbrains.jewel.foundation.theme.JewelTheme
3939
import org.jetbrains.jewel.ui.component.*
4040
import org.jetbrains.jewel.ui.component.Text
@@ -108,7 +108,7 @@ class IdeaMcpConfigDialogWrapper(
108108
override fun createSouthPanel(): JComponent? = null
109109

110110
override fun createCenterPanel(): JComponent {
111-
val dialogPanel = compose {
111+
val dialogPanel = JewelComposePanel {
112112
IdeaMcpConfigDialogContent(
113113
project = project,
114114
onDismiss = { close(CANCEL_EXIT_CODE) }

mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/editor/IdeaModelConfigDialogWrapper.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import com.intellij.openapi.project.Project
44
import com.intellij.openapi.ui.DialogWrapper
55
import com.intellij.util.ui.JBUI
66
import cc.unitmesh.llm.ModelConfig
7-
import org.jetbrains.jewel.bridge.compose
7+
import org.jetbrains.jewel.bridge.JewelComposePanel
88
import java.awt.Dimension
99
import javax.swing.JComponent
1010

@@ -29,7 +29,7 @@ class IdeaModelConfigDialogWrapper(
2929
override fun createSouthPanel(): JComponent? = null
3030

3131
override fun createCenterPanel(): JComponent {
32-
val dialogPanel = compose {
32+
val dialogPanel = JewelComposePanel {
3333
IdeaModelConfigDialogContent(
3434
currentConfig = currentConfig,
3535
currentConfigName = currentConfigName,

mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/renderer/JewelRenderer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package cc.unitmesh.devins.idea.renderer
22

33
import cc.unitmesh.agent.plan.AgentPlan
44
import cc.unitmesh.agent.plan.MarkdownPlanParser
5-
import cc.unitmesh.agent.plan.TaskStatus as PlanTaskStatus
65
import cc.unitmesh.agent.render.BaseRenderer
76
import cc.unitmesh.devins.llm.MessageRole
87
import cc.unitmesh.agent.render.RendererUtils
@@ -12,6 +11,7 @@ import cc.unitmesh.agent.render.ToolCallDisplayInfo
1211
import cc.unitmesh.agent.render.ToolCallInfo
1312
import cc.unitmesh.agent.tool.ToolType
1413
import cc.unitmesh.agent.tool.toToolType
14+
import cc.unitmesh.devins.llm.Message
1515
import cc.unitmesh.llm.compression.TokenInfo
1616
import com.intellij.openapi.diagnostic.Logger
1717
import kotlinx.coroutines.flow.MutableStateFlow

mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/IdeaAgentToolWindowFactory.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import com.intellij.openapi.wm.ToolWindow
88
import com.intellij.openapi.wm.ToolWindowFactory
99
import cc.unitmesh.devins.idea.services.CoroutineScopeHolder
1010
import org.jetbrains.jewel.bridge.addComposeTab
11-
import org.jetbrains.jewel.foundation.JewelFlags
1211

1312
/**
1413
* Factory for creating the Agent ToolWindow with tab-based navigation.
@@ -31,8 +30,7 @@ class IdeaAgentToolWindowFactory : ToolWindowFactory {
3130
override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) {
3231
// Enable custom popup rendering to use JBPopup instead of default Compose implementation
3332
// This fixes z-index issues when Compose Popup is used with SwingPanel (e.g., EditorTextField)
34-
JewelFlags.useCustomPopupRenderer = true
35-
33+
// JewelFlags.useCustomPopupRenderer = true
3634
createAgentPanel(project, toolWindow)
3735
}
3836

mpp-idea/src/main/kotlin/cc/unitmesh/devins/idea/toolwindow/remote/IdeaRemoteAgentClient.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package cc.unitmesh.devins.idea.toolwindow.remote
22

33
import cc.unitmesh.agent.RemoteAgentEvent
44
import com.google.gson.Gson
5-
import com.google.gson.reflect.TypeToken
65
import io.ktor.client.*
76
import io.ktor.client.engine.cio.*
87
import io.ktor.client.plugins.sse.*
@@ -26,7 +25,7 @@ class IdeaRemoteAgentClient(
2625
private val httpClient: HttpClient = HttpClient(CIO) {
2726
install(SSE) {
2827
reconnectionTime = 30.seconds
29-
maxReconnectionAttempts = 3
28+
// maxReconnectionAttempts = 3
3029
}
3130

3231
// We handle HTTP errors manually to provide better error messages

mpp-ui/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ plugins {
1616
id("app.cash.sqldelight") version "2.1.0"
1717
id("de.comahe.i18n4k") version "0.11.1"
1818
alias(libs.plugins.ktlint)
19+
`maven-publish`
1920
}
2021

2122
repositories {
@@ -40,6 +41,7 @@ i18n4k {
4041
sourceCodeLocales = listOf("en", "zh")
4142
}
4243

44+
group = "cc.unitmesh"
4345
version = project.findProperty("mppVersion") as String? ?: "0.1.5"
4446

4547
kotlin {

0 commit comments

Comments
 (0)