Skip to content

Commit 5859754

Browse files
committed
feat: migration to MPS 2025.2
1 parent 7a25794 commit 5859754

File tree

15 files changed

+184
-232
lines changed

15 files changed

+184
-232
lines changed

.github/workflows/mps-compatibility.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ jobs:
1616
matrix:
1717
version:
1818
# also adjust the compatibility version range of the MPS plugin
19-
- "2023.2"
20-
- "2023.3"
21-
# - "2024.1"
19+
- "2025.2"
2220
steps:
2321
- uses: actions/checkout@v5
2422
# - uses: actions/setup-node@v3

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ See also https://www.jetbrains.com/help/idea/directories-used-by-the-ide-to-stor
1717

1818
You may have to create the plugins folder if it doesn't exist yet.
1919

20-
Currently, these MPS versions are supported: 2023.2, 2023.3
20+
Currently, these MPS versions are supported: 2025.2
2121

2222
# Usage
2323

build.gradle.kts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import org.jetbrains.intellij.tasks.BuildPluginTask
1+
import org.jetbrains.intellij.platform.gradle.tasks.BuildPluginTask
22
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
33
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
44
import org.jetbrains.kotlin.gradle.plugin.KotlinMultiplatformPluginWrapper
@@ -21,7 +21,8 @@ plugins {
2121
id("com.dorongold.task-tree") version "4.0.1"
2222
alias(libs.plugins.kotlin.multiplatform) apply false
2323
alias(libs.plugins.kotlin.serialization) apply false
24-
id("org.jetbrains.intellij") version "1.17.4" apply false
24+
alias(libs.plugins.intellij2) apply false
25+
alias(libs.plugins.intellij2.migration) apply false
2526
alias(libs.plugins.npm.publish) apply false
2627
}
2728

@@ -151,7 +152,7 @@ rootProject.plugins.withType(org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlu
151152
copyMps()
152153

153154
// make all 'packJsPackage' tasks depend on all 'kotlinNodeJsSetup' tasks, because gradle complained about this being missing
154-
tasks.register("setupNodeEverywhere") {
155+
tasks.register<Task>("setupNodeEverywhere") {
155156
dependsOn(":kernelf-apigen:kotlinNodeJsSetup")
156157
dependsOn(":kernelf-editor:kotlinNodeJsSetup")
157158
dependsOn(":parser:kotlinNodeJsSetup")

buildSrc/src/main/kotlin/org/modelix/CopyMps.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ val Project.mpsMajorVersion: String get() {
2929
if (project != rootProject) return rootProject.mpsMajorVersion
3030
return project.findProperty("mps.version.major")?.toString()?.takeIf { it.isNotEmpty() }
3131
?: project.findProperty("mps.version")?.toString()?.takeIf { it.isNotEmpty() }?.replace(Regex("""(20\d\d\.\d+).*"""), "$1")
32-
?: "2023.2"
32+
?: "2025.2"
3333
}
3434

3535
val Project.mpsVersion: String get() {
@@ -48,6 +48,8 @@ val Project.mpsVersion: String get() {
4848
"2023.2" to "2023.2.2",
4949
"2023.3" to "2023.3.2",
5050
"2024.1" to "2024.1.1",
51+
"2025.1" to "2025.1.1",
52+
"2025.2" to "2025.2.1",
5153
)[it],
5254
) { "Unknown MPS version: $it" }
5355
}

editor-common-mps/build.gradle.kts

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import org.jetbrains.intellij.tasks.PrepareSandboxTask
1+
import org.jetbrains.intellij.platform.gradle.tasks.PrepareSandboxTask
22
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
33
import org.modelix.buildtools.KnownModuleIds
44
import org.modelix.buildtools.buildStubsSolutionJar
@@ -8,11 +8,17 @@ import org.modelix.mpsPluginsDir
88

99
plugins {
1010
kotlin("jvm")
11-
id("org.jetbrains.intellij")
11+
alias(libs.plugins.intellij2)
1212
}
1313

1414
kotlin {
15-
jvmToolchain(17)
15+
jvmToolchain(21)
16+
}
17+
18+
repositories {
19+
intellijPlatform {
20+
defaultRepositories()
21+
}
1622
}
1723

1824
dependencies {
@@ -32,13 +38,23 @@ dependencies {
3238
api(libs.modelix.mps.model.adapters, excludeMPSLibraries)
3339
api(libs.modelix.model.api.gen.runtime, excludeMPSLibraries)
3440
api(project(":reverse-mpsadapters"), excludeMPSLibraries)
41+
42+
intellijPlatform {
43+
local(mpsHomeDir)
44+
}
3545
}
3646

37-
// Configure Gradle IntelliJ Plugin
38-
// Read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
39-
intellij {
40-
localPath = mpsHomeDir.map { it.asFile.absolutePath }
47+
intellijPlatform {
4148
instrumentCode = false
49+
buildSearchableOptions = false
50+
pluginConfiguration {
51+
id = "org.modelix.mps.editor.common"
52+
name = "Shared Libraries for Other Modelix Plugins"
53+
// ideaVersion {
54+
// sinceBuild = "$mpsPlatformVersion"
55+
// untilBuild = "$mpsPlatformVersion.*"
56+
// }
57+
}
4258
}
4359

4460
kotlin {
@@ -49,45 +65,32 @@ kotlin {
4965
}
5066

5167
tasks {
52-
patchPluginXml {
53-
sinceBuild.set("232")
54-
untilBuild.set("233.*")
55-
}
56-
57-
buildSearchableOptions {
58-
enabled = false
59-
}
60-
61-
runIde {
62-
autoReloadPlugins.set(true)
63-
}
64-
6568
val pluginDir = mpsPluginsDir
6669
if (pluginDir != null) {
6770
val installMpsPlugin = register<Sync>("installMpsPlugin") {
6871
dependsOn(prepareSandbox)
6972
from(project.layout.buildDirectory.dir("idea-sandbox/plugins/${project.name}"))
7073
into(pluginDir.resolve(project.name))
7174
}
72-
register("installMpsDevPlugins") {
75+
register<Task>("installMpsDevPlugins") {
7376
dependsOn(installMpsPlugin)
7477
}
7578
}
7679

7780
withType(PrepareSandboxTask::class.java) {
78-
intoChild(pluginName.map { "$it/META-INF" })
81+
rootSpec.addChild().into(pluginName.map { "$it/META-INF" })
7982
.from(project.layout.projectDirectory.file("src/main/resources/META-INF"))
8083
.exclude("plugin.xml")
81-
intoChild(pluginName.map { "$it/META-INF" })
82-
.from(patchPluginXml.flatMap { it.outputFiles })
84+
rootSpec.addChild().into(pluginName.map { "$it/META-INF" })
85+
.from(patchPluginXml.flatMap { it.outputFile })
8386

8487
doLast {
8588
val ownJar: File = pluginJar.get().asFile
86-
val runtimeJars = configurations.getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME).resolvedConfiguration.files + ownJar
89+
val runtimeJars = configurations.getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME).incoming.files + ownJar
8790
buildStubsSolutionJar {
8891
solutionName("org.modelix.mps.editor.common.stubs")
8992
solutionId("208eaf68-fd3a-497a-a4b6-4923ff457c3b")
90-
outputFolder(defaultDestinationDir.get().resolve(project.name).resolve("languages"))
93+
outputFolder(defaultDestinationDirectory.get().asFile.resolve(project.name).resolve("languages"))
9194
runtimeJars.forEach {
9295
javaJar(it.name)
9396
// kotlinJar(it.name)

gradle/libs.versions.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ modelix-mps-buildtools = { id = "org.modelix.mps.build-tools", version.ref = "mo
77
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
88
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
99
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
10+
intellij1 = { id = "org.jetbrains.intellij", version = "1.17.4" }
11+
intellij2 = { id = "org.jetbrains.intellij.platform", version.ref = "intellijGradle" }
12+
intellij2-migration = { id = "org.jetbrains.intellij.platform.migration", version.ref = "intellijGradle" }
1013

1114
[versions]
12-
modelixCore = "16.3.0"
15+
modelixCore = "16.4.0"
1316
modelixBuildtools="2.0.1"
1417
kotlin = "2.2.21"
18+
intellijGradle = "2.10.2"
1519

1620
[libraries]
1721
modelix-model-api = { group = "org.modelix", name = "model-api", version.ref = "modelixCore" }
@@ -27,3 +31,5 @@ modelix-build-tools-lib = { group = "org.modelix.mps", name = "build-tools-lib",
2731
kotlin-logging = { group = "io.github.oshai", name = "kotlin-logging", version = "7.0.13" }
2832
slf4j-api = { group = "org.slf4j", name = "slf4j-api", version = "2.0.17" }
2933
kotlin-collections-immutable = { group = "org.jetbrains.kotlinx", name = "kotlinx-collections-immutable", version = "0.4.0" }
34+
mps = { group = "com.jetbrains", name = "mps", version = "2025.2.1" }
35+

gradle/wrapper/gradle-wrapper.jar

59 Bytes
Binary file not shown.

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.14.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-all.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)