generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 478
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
1107 lines (952 loc) · 47.2 KB
/
build.gradle.kts
File metadata and controls
1107 lines (952 loc) · 47.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import groovy.util.Node
import groovy.xml.XmlParser
import org.jetbrains.changelog.Changelog
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType.IntellijIdeaUltimate
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
import org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformDependenciesExtension
import org.jetbrains.intellij.platform.gradle.extensions.IntelliJPlatformTestingExtension
import org.jetbrains.intellij.platform.gradle.tasks.RunIdeTask
import org.jetbrains.intellij.platform.gradle.utils.extensionProvider
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
// The same as `--stacktrace` param
gradle.startParameter.showStacktrace = ShowStacktrace.ALWAYS
@Suppress("DSL_SCOPE_VIOLATION")
plugins {
id("java") // Java support
kotlin("jvm") version "2.2.0"
kotlin("plugin.compose") version "2.2.0"
kotlin("plugin.serialization") version "2.2.0"
id("org.jetbrains.intellij.platform") version "2.10.2"
id("org.jetbrains.changelog") version "2.2.0"
id("org.jetbrains.grammarkit") version "2022.3.2.2"
}
fun properties(key: String) = providers.gradleProperty(key)
fun environment(key: String) = providers.environmentVariable(key)
val basePluginArchiveName = "autodev-jetbrains"
val javaScriptPlugins = listOf("JavaScript")
val pycharmPlugins = listOf(prop("pythonPlugin"))
val javaPlugins = listOf("com.intellij.java", "org.jetbrains.kotlin")
val rustPlugins = listOf(
prop("rustPlugin"),
"org.toml.lang"
)
val platformVersion = prop("platformVersion").toInt()
val ideaPlugins = listOf(
"com.intellij.java",
"org.jetbrains.plugins.gradle",
"org.jetbrains.idea.maven",
"org.jetbrains.kotlin",
"JavaScript"
)
var lang = extra.properties["lang"] ?: "java"
changelog {
version.set(properties("pluginVersion"))
groups.empty()
path.set(rootProject.file("CHANGELOG.md").toString())
repositoryUrl.set(properties("pluginRepositoryUrl"))
itemPrefix.set("*")
}
repositories {
mavenLocal() // For locally published mpp-ui and mpp-core artifacts
mavenCentral()
google()
// Required for mpp-ui's webview dependencies (jogamp)
maven("https://jogamp.org/deployment/maven")
maven("https://oss.sonatype.org/content/repositories/snapshots/")
maven("https://packages.jetbrains.team/maven/p/ij/intellij-dependencies/")
intellijPlatform {
defaultRepositories()
jetbrainsRuntime()
}
}
// Global exclusions for heavy dependencies not needed in IntelliJ plugin
// These exclusions apply to ALL configurations including transitive dependencies from includeBuild projects
configurations.all {
exclude(group = "aws.sdk.kotlin") // AWS SDK (~30MB) - from ai.koog:prompt-executor-bedrock-client
exclude(group = "aws.smithy.kotlin") // AWS Smithy runtime
exclude(group = "org.apache.tika") // Apache Tika (~100MB) - document parsing
exclude(group = "org.apache.poi") // Apache POI - Office document parsing (from Tika)
exclude(group = "org.apache.pdfbox") // PDFBox (~10MB) - PDF parsing
exclude(group = "net.sourceforge.plantuml") // PlantUML (~20MB) - from dev.snipme:highlights
exclude(group = "org.jsoup") // Jsoup HTML parser
exclude(group = "ai.koog", module = "prompt-executor-bedrock-client") // Bedrock executor
// Redis/Lettuce - not needed in IDEA plugin (~5MB)
exclude(group = "io.lettuce")
// RSyntaxTextArea - IDEA has its own editor (~1.3MB)
exclude(group = "com.fifesoft")
// Netty - not needed for IDEA plugin (~3MB)
exclude(group = "io.netty")
// pty4j/jediterm - IDEA has its own terminal (~3MB)
exclude(group = "org.jetbrains.pty4j")
exclude(group = "org.jetbrains.jediterm")
// Note: ktor-serialization-kotlinx-json is NOT excluded globally because it's required
// by ai.koog:prompt-executor-llms-all (AbstractOpenAILLMClient) at runtime.
// It's included as an explicit dependency with coroutines excluded below.
// Exclude kotlinx-serialization-json-io to prevent conflicts with IntelliJ's bundled libraries
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-io")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-io-jvm")
}
kotlin {
jvmToolchain(17)
compilerOptions {
freeCompilerArgs.addAll(
listOf(
"-opt-in=androidx.compose.foundation.ExperimentalFoundationApi"
)
)
}
}
configure(subprojects) {
apply {
plugin("idea")
plugin("kotlin")
plugin("org.jetbrains.intellij.platform.module")
}
repositories {
mavenCentral()
intellijPlatform {
defaultRepositories()
jetbrainsRuntime()
}
}
intellijPlatform {
instrumentCode = false
buildSearchableOptions = false
}
idea {
module {
generatedSourceDirs.add(file("src/gen"))
isDownloadJavadoc = true
isDownloadSources = true
}
}
configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
}
}
tasks {
prepareSandbox { enabled = false }
}
val testOutput = configurations.create("testOutput")
sourceSets {
main {
java.srcDirs("src/gen")
}
}
dependencies {
// Use compileOnly for kotlinx libraries - IntelliJ provides these at runtime
compileOnly("org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0")
implementation("com.knuddels:jtokkit:1.1.0")
testOutput(sourceSets.test.get().output.classesDirs)
testImplementation("junit:junit:4.13.2")
testImplementation("org.opentest4j:opentest4j:1.3.0")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:5.9.3")
testImplementation("org.assertj:assertj-core:3.24.2")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-debug:1.7.0") {
exclude(group = "net.java.dev.jna", module = "jna-platform")
exclude(group = "net.java.dev.jna", module = "jna")
}
// Note: testFramework is configured in each individual project's dependencies block
// because it requires IntelliJ Platform IDE to be resolved first
}
}
project(":") {
apply {
plugin("org.jetbrains.changelog")
plugin("org.jetbrains.intellij.platform")
}
// Kotlin compiler options for Compose
tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
freeCompilerArgs.addAll(
listOf(
"-opt-in=androidx.compose.foundation.ExperimentalFoundationApi"
)
)
}
}
// Handle duplicate resources from dependencies
tasks.named<Copy>("processResources") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
// Copy all resources from submodules to main plugin JAR
// These are required for IntelliJ to load the plugin modules correctly
from(project(":mpp-idea-core").file("src/main/resources"))
from(project(":mpp-idea-lang:pycharm").file("src/main/resources"))
from(project(":mpp-idea-lang:java").file("src/main/resources"))
from(project(":mpp-idea-lang:kotlin").file("src/main/resources"))
from(project(":mpp-idea-lang:javascript").file("src/main/resources"))
from(project(":mpp-idea-lang:goland").file("src/main/resources"))
from(project(":mpp-idea-lang:rust").file("src/main/resources"))
from(project(":mpp-idea-exts:ext-database").file("src/main/resources"))
from(project(":mpp-idea-exts:ext-git").file("src/main/resources"))
from(project(":mpp-idea-exts:ext-terminal").file("src/main/resources"))
from(project(":mpp-idea-exts:devins-lang").file("src/main/resources"))
from(project(":mpp-idea-exts:nanodsl-lang").file("src/main/resources"))
}
repositories {
mavenCentral()
mavenLocal() // For locally published mpp-ui and mpp-core artifacts
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
intellijPlatform {
defaultRepositories()
jetbrainsRuntime()
}
}
intellijPlatform {
projectName = basePluginArchiveName
pluginConfiguration {
id = "cc.unitmesh.devins.idea"
name = "AutoDev Xiuper - One Platform. All Phases. Every Device."
version = prop("pluginVersion")
ideaVersion {
sinceBuild = prop("pluginSinceBuild")
untilBuild = prop("pluginUntilBuild")
}
vendor {
name = "Phodal Huang"
}
}
pluginVerification {
freeArgs = listOf("-mute", "TemplateWordInPluginId,ForbiddenPluginIdPrefix")
ides {
ide(IntellijIdeaUltimate, "2025.2")
select {
types = listOf(IntellijIdeaUltimate)
sinceBuild = "252"
untilBuild = "253.*"
}
}
}
instrumentCode = false
buildSearchableOptions = false
}
dependencies {
intellijPlatform {
pluginVerifier()
intellijIde(prop("ideaVersion"))
if (hasProp("jbrVersion")) {
jetbrainsRuntime(prop("jbrVersion"))
} else {
jetbrainsRuntime()
}
val pluginList: MutableList<String> = mutableListOf(
"Git4Idea",
"org.jetbrains.plugins.terminal",
"org.intellij.plugins.markdown",
"com.jetbrains.sh"
)
when (lang) {
"idea" -> {
pluginList += javaPlugins
}
"python" -> {
pluginList += pycharmPlugins
}
"go" -> {
pluginList += listOf("org.jetbrains.plugins.go")
}
"rust" -> {
pluginList += rustPlugins
}
}
intellijPlugins(pluginList)
// Compose support dependencies (bundled in IDEA 252+)
// Note: Jewel modules are not available in IU-252, only use platform.compose
// Compose support dependencies (bundled in IDEA 252+)
bundledModules(
"intellij.libraries.skiko",
"intellij.libraries.compose.foundation.desktop",
"intellij.platform.jewel.foundation",
"intellij.platform.jewel.ui",
"intellij.platform.jewel.ideLafBridge",
"intellij.platform.compose"
)
testFramework(TestFrameworkType.Bundled)
testFramework(TestFrameworkType.Platform)
}
// Required by IntelliJ's bundled JUnit 5 session listener (uses junit.framework.TestCase)
testImplementation("junit:junit:4.13.2")
implementation(project(":mpp-idea-core"))
implementation(project(":mpp-idea-lang:java"))
implementation(project(":mpp-idea-lang:kotlin"))
implementation(project(":mpp-idea-lang:pycharm"))
implementation(project(":mpp-idea-lang:javascript"))
implementation(project(":mpp-idea-lang:goland"))
implementation(project(":mpp-idea-lang:rust"))
implementation(project(":mpp-idea-exts:ext-database"))
implementation(project(":mpp-idea-exts:ext-git"))
implementation(project(":mpp-idea-exts:ext-terminal"))
implementation(project(":mpp-idea-exts:devins-lang"))
implementation(project(":mpp-idea-exts:nanodsl-lang"))
// Ktor dependencies - required at runtime by ai.koog:prompt-executor-llms-all
// (AbstractOpenAILLMClient uses ContentNegotiation and JsonSupport for HTTP client)
// Must exclude kotlinx dependencies to use IntelliJ's bundled versions
implementation("io.ktor:ktor-client-core:3.2.2") {
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-io")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-io-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-io-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-io-core-jvm")
}
implementation("io.ktor:ktor-client-cio:3.2.2") {
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-io")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-io-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-io-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-io-core-jvm")
}
implementation("io.ktor:ktor-client-content-negotiation:3.2.2") {
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-io")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-io-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-io-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-io-core-jvm")
}
implementation("io.ktor:ktor-serialization-kotlinx-json:3.2.2") {
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-io")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-io-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-io-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-io-core-jvm")
}
compileOnly("io.ktor:ktor-client-logging:3.2.2")
// Use compileOnly for coroutines - IntelliJ provides these at runtime
// This ensures we compile against the same API but use IntelliJ's ClassLoader at runtime
// Note: We use Dispatchers.EDT from IntelliJ Platform instead of Dispatchers.Swing
compileOnly("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2")
// ===== ACP (Agent Client Protocol) =====
// Local ACP agent integration uses JSON-RPC over stdio.
// Exclude kotlinx deps to avoid conflicts with IntelliJ's bundled versions.
implementation("com.agentclientprotocol:acp:0.10.5") {
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core-jvm")
// We provide kotlinx-io explicitly below.
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-io-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-io-core-jvm")
}
// ACP stdio transport uses kotlinx-io (not bundled by IntelliJ).
implementation("org.jetbrains.kotlinx:kotlinx-io-core:0.8.0")
// mpp-core dependency for root project - use published artifact
implementation("cc.unitmesh:mpp-core:${prop("mppVersion")}") {
// Exclude Compose dependencies from mpp-core as well
exclude(group = "org.jetbrains.compose")
exclude(group = "org.jetbrains.compose.runtime")
exclude(group = "org.jetbrains.compose.foundation")
exclude(group = "org.jetbrains.compose.material3")
exclude(group = "org.jetbrains.compose.material")
exclude(group = "org.jetbrains.compose.ui")
exclude(group = "org.jetbrains.skiko")
// Exclude kotlinx libraries - IntelliJ provides its own
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-io")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-io-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-io-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-io-core-jvm")
// Note: Do NOT exclude ktor-client-content-negotiation - it's required at runtime by AbstractOpenAILLMClient
// We provide it explicitly above with kotlinx dependencies excluded
// Exclude only ktor-serialization-kotlinx-json from mpp-core (we provide it above)
exclude(group = "io.ktor", module = "ktor-serialization-kotlinx-json")
exclude(group = "io.ktor", module = "ktor-serialization-kotlinx-json-jvm")
// Note: Heavy dependencies (AWS, Tika, POI, PDFBox, PlantUML, Jsoup) are excluded globally above
}
// Note: mpp-ui dependency removed - configuration management moved to mpp-core
// Color definitions moved to IdeaAutoDevColors in mpp-idea
// Note: ComposeCharts library cannot be used due to ClassLoader conflicts with IntelliJ's Compose runtime
// Chart rendering is implemented manually using Compose Canvas API
// xiuper-ui for NanoDSL parsing and IR generation (used by NanoDSL preview editor)
// Only the JVM target is used, Compose dependencies are excluded to avoid ClassLoader conflicts
implementation("cc.unitmesh:xiuper-ui") {
// Exclude Compose dependencies - we use IntelliJ's bundled Compose via Jewel
exclude(group = "org.jetbrains.compose")
exclude(group = "org.jetbrains.compose.runtime")
exclude(group = "org.jetbrains.compose.foundation")
exclude(group = "org.jetbrains.compose.material3")
exclude(group = "org.jetbrains.compose.material")
exclude(group = "org.jetbrains.compose.ui")
exclude(group = "org.jetbrains.skiko")
// Exclude kotlinx libraries - IntelliJ provides its own
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core-jvm")
}
testImplementation(kotlin("test"))
}
tasks {
val projectName = project.extensionProvider.flatMap { it.projectName }
composedJar {
archiveBaseName.convention(projectName)
}
withType<RunIdeTask> {
// Default args for IDEA installation
jvmArgs("-Xmx768m", "-XX:+UseG1GC", "-XX:SoftRefLRUPolicyMSPerMB=50")
// Disable plugin auto reloading. See `com.intellij.ide.plugins.DynamicPluginVfsListener`
jvmArgs("-Didea.auto.reload.plugins=false")
// Don't show "Tip of the Day" at startup
jvmArgs("-Dide.show.tips.on.startup.default.value=false")
// uncomment if `unexpected exception ProcessCanceledException` prevents you from debugging a running IDE
// jvmArgs("-Didea.ProcessCanceledException=disabled")
}
patchPluginXml {
pluginDescription.set(provider { file("../src/description.html").readText() })
changelog {
version.set(properties("pluginVersion"))
groups.empty()
path.set(rootProject.file("CHANGELOG.md").toString())
repositoryUrl.set(properties("pluginRepositoryUrl"))
}
val changelog = project.changelog
// Get the latest available change notes from the changelog file
changeNotes.set(properties("pluginVersion").map { pluginVersion ->
with(changelog) {
renderItem(
(getOrNull(pluginVersion) ?: getUnreleased())
.withHeader(false)
.withEmptySections(false),
Changelog.OutputType.HTML,
)
}
})
}
buildPlugin {
archiveBaseName.set(basePluginArchiveName)
archiveVersion.set(prop("pluginVersion") + "-" + prop("platformVersion"))
}
publishPlugin {
dependsOn("patchChangelog")
token.set(environment("PUBLISH_TOKEN"))
channels.set(properties("pluginVersion").map {
listOf(it.split('-').getOrElse(1) { "default" }.split('.').first())
})
}
// Exclude large font files from mpp-ui that are not needed in IDEA plugin
// These fonts are for Desktop/WASM apps, IDEA has its own fonts
named<org.jetbrains.intellij.platform.gradle.tasks.PrepareSandboxTask>("prepareSandbox") {
// Exclude font files from the plugin distribution
// NotoSansSC-Regular.ttf (~18MB), NotoColorEmoji.ttf (~11MB x2), FiraCode fonts (~1MB)
exclude("**/fonts/**")
exclude("**/composeResources/**/font/**")
exclude("**/*.ttf")
exclude("**/*.otf")
// Also exclude icon files meant for desktop app
exclude("**/icon.icns")
exclude("**/icon.ico")
exclude("**/icon-512.png")
}
// Task to verify no conflicting dependencies are included
register("verifyNoDuplicateDependencies") {
group = "verification"
description = "Verifies that no Compose/Kotlinx dependencies are included that would conflict with IntelliJ's bundled versions"
val forbiddenPatterns = listOf(
"org.jetbrains.compose",
"org.jetbrains.skiko",
"kotlinx-coroutines-core",
"kotlinx-coroutines-swing",
"kotlinx-serialization-json",
"kotlinx-serialization-core"
)
// Capture dependency info at configuration time to avoid serializing Project
val runtimeClasspath = configurations.getByName("runtimeClasspath")
val dependencyNames = runtimeClasspath.incoming.artifacts.resolvedArtifacts.map { artifacts ->
artifacts.map { artifact ->
val id = artifact.id.componentIdentifier.displayName
id
}
}
inputs.property("dependencyNames", dependencyNames)
doLast {
val deps = dependencyNames.get()
val violations = mutableListOf<String>()
deps.forEach { fullName ->
forbiddenPatterns.forEach { pattern ->
if (fullName.contains(pattern)) {
violations.add(fullName)
}
}
}
if (violations.isNotEmpty()) {
throw GradleException("""
|DEPENDENCY CONFLICT DETECTED!
|The following dependencies will conflict with IntelliJ's bundled libraries:
|${violations.joinToString("\n") { " - $it" }}
|
|These dependencies must be excluded from mpp-ui and mpp-core.
""".trimMargin())
} else {
println("✓ No conflicting dependencies found in runtime classpath")
}
}
}
// Run verification before build
named("buildPlugin") {
dependsOn("verifyNoDuplicateDependencies")
}
}
}
project(":mpp-idea-core") {
apply {
plugin("org.jetbrains.kotlin.plugin.serialization")
}
dependencies {
implementation("cc.unitmesh:mpp-core:${prop("mppVersion")}") {
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-io")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-io-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-io-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-io-core-jvm")
// Note: Ktor client dependencies (content-negotiation, etc.) are NOT excluded here
// They are provided by root project dependencies with kotlinx exclusions
exclude(group = "io.ktor", module = "ktor-serialization-kotlinx-json")
exclude(group = "io.ktor", module = "ktor-serialization-kotlinx-json-jvm")
}
intellijPlatform {
intellijIde(prop("ideaVersion"))
intellijPlugins(ideaPlugins)
bundledPlugin("com.jetbrains.sh")
testFramework(TestFrameworkType.Bundled)
testFramework(TestFrameworkType.Platform)
}
implementation("org.jetbrains.xodus:xodus-openAPI:2.0.1")
implementation("org.jetbrains.xodus:xodus-environment:2.0.1")
implementation("org.jetbrains.xodus:xodus-entity-store:2.0.1")
implementation("org.jetbrains.xodus:xodus-vfs:2.0.1")
implementation("io.modelcontextprotocol:kotlin-sdk:0.7.2") {
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-io")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-io-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-io-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-io-core-jvm")
}
/// # Ktor - exclude kotlinx dependencies to use IntelliJ's bundled versions
implementation("io.ktor:ktor-client-cio:3.2.3") {
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-io")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-io-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-io-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-io-core-jvm")
}
implementation("io.ktor:ktor-server-sse:3.2.3") {
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-io")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-io-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-io-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-io-core-jvm")
}
implementation("io.github.a2asdk:a2a-java-sdk-client:0.3.0.Beta1")
implementation("io.reactivex.rxjava3:rxjava:3.1.10")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.1")
testImplementation(kotlin("test"))
testImplementation("com.squareup.okhttp3:mockwebserver:4.12.0") {
excludeKotlinDeps()
}
implementation("com.squareup.okhttp3:okhttp:4.12.0") {
excludeKotlinDeps()
}
implementation("com.squareup.okhttp3:okhttp-sse:4.12.0") {
excludeKotlinDeps()
}
implementation("org.reflections:reflections:0.10.2") {
exclude(group = "org.slf4j", module = "slf4j-api")
}
implementation("com.squareup.retrofit2:converter-jackson:2.11.0")
implementation("com.squareup.retrofit2:converter-gson:2.11.0")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.18.1")
implementation("com.fasterxml.jackson.core:jackson-databind:2.18.1")
implementation("org.commonmark:commonmark:0.21.0")
implementation("org.commonmark:commonmark-ext-gfm-tables:0.21.0")
implementation("com.jayway.jsonpath:json-path:2.9.0")
implementation("com.jsoizo:kotlin-csv-jvm:1.10.0") {
excludeKotlinDeps()
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core-jvm")
}
// kanban
implementation("org.kohsuke:github-api:1.326")
implementation("org.gitlab4j:gitlab4j-api:5.8.0")
// template engine
implementation("org.apache.velocity:velocity-engine-core:2.4.1")
// token count
implementation("com.knuddels:jtokkit:1.1.0")
// gitignore parsing library for fallback engine
implementation("nl.basjes.gitignore:gitignore-reader:1.6.0")
// Use compileOnly for kotlinx libraries - IntelliJ provides these at runtime
compileOnly("org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0")
}
task("resolveDependencies") {
doLast {
rootProject.allprojects
.map { it.configurations }
.flatMap { it.filter { c -> c.isCanBeResolved } }
.forEach { it.resolve() }
}
}
}
project(":mpp-idea-lang:pycharm") {
dependencies {
intellijPlatform {
intellijIde(prop("ideaVersion"))
intellijPlugins(ideaPlugins + pycharmPlugins)
}
implementation(project(":mpp-idea-core"))
}
}
project(":mpp-idea-lang:java") {
dependencies {
intellijPlatform {
intellijIde(prop("ideaVersion"))
intellijPlugins(ideaPlugins)
testFramework(TestFrameworkType.Plugin.Java)
}
implementation(project(":mpp-idea-core"))
implementation(project(":mpp-idea-exts:devins-lang"))
}
}
val cssPlugins = listOf(
"com.intellij.css",
"org.jetbrains.plugins.sass",
"org.jetbrains.plugins.less",
)
project(":mpp-idea-lang:javascript") {
dependencies {
intellijPlatform {
intellijIde(prop("ideaVersion"))
intellijPlugins(ideaPlugins)
intellijPlugins(javaScriptPlugins)
intellijPlugins(cssPlugins)
testFramework(TestFrameworkType.Plugin.JavaScript)
}
implementation(project(":mpp-idea-core"))
}
}
project(":mpp-idea-lang:kotlin") {
dependencies {
intellijPlatform {
intellijIde(prop("ideaVersion"))
intellijPlugins(ideaPlugins)
testFramework(TestFrameworkType.Plugin.Java)
}
implementation(project(":mpp-idea-core"))
implementation(project(":mpp-idea-lang:java"))
}
}
project(":mpp-idea-lang:rust") {
dependencies {
intellijPlatform {
intellijIde(prop("ideaVersion"))
intellijPlugins(ideaPlugins + rustPlugins)
}
implementation(project(":mpp-idea-core"))
}
}
project(":mpp-idea-lang:goland") {
dependencies {
intellijPlatform {
intellijIde(prop("ideaVersion"))
intellijPlugins(prop("goPlugin").split(',').map(String::trim).filter(String::isNotEmpty))
}
implementation(project(":mpp-idea-core"))
}
}
project(":mpp-idea-exts:ext-database") {
dependencies {
intellijPlatform {
intellijIde(prop("ideaVersion"))
intellijPlugins(ideaPlugins + "com.intellij.database")
}
implementation("cc.unitmesh:mpp-core:${prop("mppVersion")}") {
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core-jvm")
exclude(group = "io.ktor", module = "ktor-serialization-kotlinx-json")
exclude(group = "io.ktor", module = "ktor-serialization-kotlinx-json-jvm")
}
implementation(project(":mpp-idea-core"))
implementation(project(":mpp-idea-exts:devins-lang"))
}
}
project(":mpp-idea-exts:ext-git") {
dependencies {
intellijPlatform {
intellijIde(prop("ideaVersion"))
intellijPlugins(ideaPlugins + "Git4Idea")
}
implementation("cc.unitmesh:mpp-core:${prop("mppVersion")}") {
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core-jvm")
exclude(group = "io.ktor", module = "ktor-serialization-kotlinx-json")
exclude(group = "io.ktor", module = "ktor-serialization-kotlinx-json-jvm")
}
implementation(project(":mpp-idea-core"))
implementation(project(":mpp-idea-exts:devins-lang"))
// kanban
implementation("org.kohsuke:github-api:1.326")
implementation("org.gitlab4j:gitlab4j-api:5.8.0")
implementation("cc.unitmesh:git-commit-message:0.4.6") {
excludeKotlinDeps()
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core-jvm")
}
}
}
project(":mpp-idea-exts:ext-terminal") {
dependencies {
intellijPlatform {
intellijIde(prop("ideaVersion"))
intellijPlugins(ideaPlugins + "org.jetbrains.plugins.terminal")
}
implementation(project(":mpp-idea-core"))
}
}
project(":mpp-idea-exts:devins-lang") {
apply {
plugin("org.jetbrains.grammarkit")
plugin("org.jetbrains.kotlin.plugin.serialization")
}
dependencies {
intellijPlatform {
intellijIde(prop("ideaVersion"))
intellijPlugins(ideaPlugins + "org.intellij.plugins.markdown" + "com.jetbrains.sh" + "Git4Idea")
testFramework(TestFrameworkType.Plugin.Java)
}
implementation("com.jayway.jsonpath:json-path:2.9.0")
// Use compileOnly for kotlinx libraries - IntelliJ provides these at runtime
compileOnly("org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.0")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.7.1")
implementation("cc.unitmesh:mpp-core:${prop("mppVersion")}") {
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core-jvm")
exclude(group = "io.ktor", module = "ktor-serialization-kotlinx-json")
exclude(group = "io.ktor", module = "ktor-serialization-kotlinx-json-jvm")
}
implementation(project(":mpp-idea-core"))
}
tasks {
generateLexer {
sourceFile.set(file("src/grammar/DevInLexer.flex"))
targetOutputDir.set(file("src/gen/cc/unitmesh/devti/language/lexer"))
purgeOldFiles.set(true)
}
generateParser {
sourceFile.set(file("src/grammar/DevInParser.bnf"))
targetRootOutputDir.set(file("src/gen"))
pathToParser.set("cc/unitmesh/devti/language/parser/DevInParser.java")
pathToPsiRoot.set("cc/unitmesh/devti/language/psi")
purgeOldFiles.set(true)
}
withType<KotlinCompile> {
dependsOn(generateLexer, generateParser)
}
}
}
project(":mpp-idea-exts:nanodsl-lang") {
apply {
plugin("org.jetbrains.grammarkit")
plugin("org.jetbrains.kotlin.plugin.serialization")
}
dependencies {
intellijPlatform {
intellijIde(prop("ideaVersion"))
intellijPlugins(ideaPlugins)
testFramework(TestFrameworkType.Plugin.Java)
}
implementation("cc.unitmesh:mpp-core:${prop("mppVersion")}") {
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-coroutines-core-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-json-jvm")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core")
exclude(group = "org.jetbrains.kotlinx", module = "kotlinx-serialization-core-jvm")
exclude(group = "io.ktor", module = "ktor-serialization-kotlinx-json")
exclude(group = "io.ktor", module = "ktor-serialization-kotlinx-json-jvm")
}
implementation(project(":mpp-idea-core"))
}
tasks {
generateLexer {
sourceFile.set(file("src/grammar/NanoDSLLexer.flex"))
targetOutputDir.set(file("src/gen/cc/unitmesh/nanodsl/language/lexer"))
purgeOldFiles.set(true)
}
generateParser {
sourceFile.set(file("src/grammar/NanoDSLParser.bnf"))
targetRootOutputDir.set(file("src/gen"))
pathToParser.set("cc/unitmesh/nanodsl/language/parser/NanoDSLParser.java")
pathToPsiRoot.set("cc/unitmesh/nanodsl/language/psi")
purgeOldFiles.set(true)
}
withType<KotlinCompile> {
dependsOn(generateLexer, generateParser)
}
}
}
tasks.test {
useJUnitPlatform()
}
fun File.isPluginJar(): Boolean {
if (!isFile) return false
if (extension != "jar") return false
return zipTree(this).files.any { it.isManifestFile() }
}
fun File.isManifestFile(): Boolean {
if (extension != "xml") return false
val rootNode = try {
val parser = XmlParser()
parser.parse(this)