Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew build -PciBuild=true -Pgpr.token=${{ secrets.GITHUB_TOKEN }} -Pmps.version.major=2023.3
run: ./gradlew build -PciBuild=true -Pgpr.token=${{ secrets.GITHUB_TOKEN }} -Pmps.version.major=2025.2
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/mps-compatibility.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
matrix:
version:
# also adjust the compatibility version range of the MPS plugin
- "2023.2"
- "2023.3"
# - "2024.1"
- "2024.3"
- "2025.1"
- "2025.2"
steps:
- uses: actions/checkout@v5
# - uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ jobs:
-Pgpr.key=${{ secrets.GITHUB_TOKEN }}
-Pgpr.token=${{ secrets.GITHUB_TOKEN }}
-Pgpr.universalkey=${{ secrets.GHP_UNIVERSAL_PUBLISH_TOKEN }}
-Pmps.version.major=2023.3
-Pmps.version.major=2025.2
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ See also https://www.jetbrains.com/help/idea/directories-used-by-the-ide-to-stor

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

Currently, these MPS versions are supported: 2023.2, 2023.3
Currently, these MPS versions are supported: 2025.2

# Usage

Expand Down
10 changes: 5 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import org.jetbrains.intellij.tasks.BuildPluginTask
import org.jetbrains.intellij.platform.gradle.tasks.BuildPluginTask
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.plugin.KotlinMultiplatformPluginWrapper
Expand All @@ -21,7 +21,7 @@ plugins {
id("com.dorongold.task-tree") version "4.0.1"
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.kotlin.serialization) apply false
id("org.jetbrains.intellij") version "1.17.4" apply false
alias(libs.plugins.intellij2) apply false
alias(libs.plugins.npm.publish) apply false
}

Expand Down Expand Up @@ -116,7 +116,7 @@ subprojects {

plugins.withType<KotlinPluginWrapper> {
extensions.configure<KotlinJvmProjectExtension> {
jvmToolchain(17)
jvmToolchain(21)
sourceSets.all {
if (!name.lowercase().contains("test")) {
languageSettings {
Expand All @@ -129,7 +129,7 @@ subprojects {

plugins.withType<KotlinMultiplatformPluginWrapper> {
extensions.configure<KotlinMultiplatformExtension> {
jvmToolchain(17)
jvmToolchain(21)
sourceSets.all {
if (!name.lowercase().contains("test")) {
languageSettings {
Expand All @@ -151,7 +151,7 @@ rootProject.plugins.withType(org.jetbrains.kotlin.gradle.targets.js.yarn.YarnPlu
copyMps()

// make all 'packJsPackage' tasks depend on all 'kotlinNodeJsSetup' tasks, because gradle complained about this being missing
tasks.register("setupNodeEverywhere") {
tasks.register<Task>("setupNodeEverywhere") {
dependsOn(":kernelf-apigen:kotlinNodeJsSetup")
dependsOn(":kernelf-editor:kotlinNodeJsSetup")
dependsOn(":parser:kotlinNodeJsSetup")
Expand Down
1 change: 1 addition & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {

dependencies {
implementation(kotlin("stdlib"))
implementation("com.google.code.gson:gson:2.13.2")
}

repositories {
Expand Down
52 changes: 50 additions & 2 deletions buildSrc/src/main/kotlin/org/modelix/CopyMps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package org.modelix

import com.google.gson.JsonArray
import com.google.gson.JsonParser
import org.gradle.api.Project
import org.gradle.api.artifacts.ModuleDependency
import org.gradle.api.file.Directory
Expand All @@ -24,12 +26,13 @@ import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.exclude
import java.io.File
import java.util.zip.ZipInputStream
import java.util.zip.ZipOutputStream

val Project.mpsMajorVersion: String get() {
if (project != rootProject) return rootProject.mpsMajorVersion
return project.findProperty("mps.version.major")?.toString()?.takeIf { it.isNotEmpty() }
?: project.findProperty("mps.version")?.toString()?.takeIf { it.isNotEmpty() }?.replace(Regex("""(20\d\d\.\d+).*"""), "$1")
?: "2023.2"
?: "2025.2"
}

val Project.mpsVersion: String get() {
Expand All @@ -47,7 +50,10 @@ val Project.mpsVersion: String get() {
"2022.3" to "2022.3.3",
"2023.2" to "2023.2.2",
"2023.3" to "2023.3.2",
"2024.1" to "2024.1.1",
"2024.1" to "2024.1.5",
"2024.3" to "2024.3.2",
"2025.1" to "2025.1.1",
"2025.2" to "2025.2.1",
)[it],
) { "Unknown MPS version: $it" }
}
Expand Down Expand Up @@ -136,6 +142,48 @@ fun Project.copyMps(): File {
buildTxt.writeText("$prefix$buildNumber")
}

// fix product-info.json
val productInfoFile = mpsHomeDir.get().asFile.resolve("product-info.json")
val productInfo = productInfoFile.takeIf { it.exists() }?.reader()?.use { reader ->
JsonParser.parseReader(reader)
}?.asJsonObject
if (productInfo != null) {
if (!productInfo.has("bundledPlugins")) productInfo.add("bundledPlugins", JsonArray())
if (!productInfo.has("modules")) productInfo.add("modules", JsonArray())
if (!productInfo.has("layout")) productInfo.add("layout", JsonArray())

val currentOS = org.gradle.internal.os.OperatingSystem.current()
val currentOSString = when {
currentOS.isMacOsX -> "macOS"
currentOS.isWindows -> "Windows"
else -> "Linux"
}
val launches = productInfo.getAsJsonArray("launch").asList()
if (!launches.any { it.asJsonObject.get("os").asString == currentOSString && it.asJsonObject.get("arch").asString == System.getProperty("os.arch") }) {
launches.add(
launches.first().deepCopy().also {
it.asJsonObject.addProperty("os", currentOSString)
it.asJsonObject.addProperty("arch", System.getProperty("os.arch"))
}
)
}

productInfoFile.writeText(productInfo.toString())
}

// add missing module-descriptors.jar
val moduleDescriptorsFile = mpsHomeDir.get().asFile.resolve("modules").resolve("module-descriptors.jar")
if (!moduleDescriptorsFile.exists()) {
moduleDescriptorsFile.parentFile.mkdirs()
moduleDescriptorsFile.outputStream().use { fos ->
ZipOutputStream(fos).use {}
}
}

// fix bin/mps64.vmoptions
val vmOptionsFile = mpsHome.resolve("bin").resolve("mps64.vmoptions")
vmOptionsFile.writeText(vmOptionsFile.readLines().filterNot { it.trim().startsWith("#") }.joinToString("\n"))

println("Extracting MPS done.")
return mpsHome
}
57 changes: 30 additions & 27 deletions editor-common-mps/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import org.jetbrains.intellij.tasks.PrepareSandboxTask
import org.jetbrains.intellij.platform.gradle.tasks.PrepareSandboxTask
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.modelix.buildtools.KnownModuleIds
import org.modelix.buildtools.buildStubsSolutionJar
Expand All @@ -8,11 +8,17 @@ import org.modelix.mpsPluginsDir

plugins {
kotlin("jvm")
id("org.jetbrains.intellij")
alias(libs.plugins.intellij2)
}

kotlin {
jvmToolchain(17)
jvmToolchain(21)
}

repositories {
intellijPlatform {
defaultRepositories()
}
}

dependencies {
Expand All @@ -32,13 +38,23 @@ dependencies {
api(libs.modelix.mps.model.adapters, excludeMPSLibraries)
api(libs.modelix.model.api.gen.runtime, excludeMPSLibraries)
api(project(":reverse-mpsadapters"), excludeMPSLibraries)

intellijPlatform {
local(mpsHomeDir)
}
}

// Configure Gradle IntelliJ Plugin
// Read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
intellij {
localPath = mpsHomeDir.map { it.asFile.absolutePath }
intellijPlatform {
instrumentCode = false
buildSearchableOptions = false
pluginConfiguration {
id = "org.modelix.mps.editor.common"
name = "Shared Libraries for Other Modelix Plugins"
// ideaVersion {
// sinceBuild = "$mpsPlatformVersion"
// untilBuild = "$mpsPlatformVersion.*"
// }
}
}

kotlin {
Expand All @@ -49,45 +65,32 @@ kotlin {
}

tasks {
patchPluginXml {
sinceBuild.set("232")
untilBuild.set("233.*")
}

buildSearchableOptions {
enabled = false
}

runIde {
autoReloadPlugins.set(true)
}

val pluginDir = mpsPluginsDir
if (pluginDir != null) {
val installMpsPlugin = register<Sync>("installMpsPlugin") {
dependsOn(prepareSandbox)
from(project.layout.buildDirectory.dir("idea-sandbox/plugins/${project.name}"))
from(prepareSandbox.map { it.pluginDirectory.get() })
into(pluginDir.resolve(project.name))
}
register("installMpsDevPlugins") {
register<Task>("installMpsDevPlugins") {
dependsOn(installMpsPlugin)
}
}

withType(PrepareSandboxTask::class.java) {
intoChild(pluginName.map { "$it/META-INF" })
rootSpec.addChild().into(pluginName.map { "$it/META-INF" })
.from(project.layout.projectDirectory.file("src/main/resources/META-INF"))
.exclude("plugin.xml")
intoChild(pluginName.map { "$it/META-INF" })
.from(patchPluginXml.flatMap { it.outputFiles })
rootSpec.addChild().into(pluginName.map { "$it/META-INF" })
.from(patchPluginXml.flatMap { it.outputFile })

doLast {
val ownJar: File = pluginJar.get().asFile
val runtimeJars = configurations.getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME).resolvedConfiguration.files + ownJar
val runtimeJars = configurations.getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME).incoming.files + ownJar
buildStubsSolutionJar {
solutionName("org.modelix.mps.editor.common.stubs")
solutionId("208eaf68-fd3a-497a-a4b6-4923ff457c3b")
outputFolder(defaultDestinationDir.get().resolve(project.name).resolve("languages"))
outputFolder(defaultDestinationDirectory.get().asFile.resolve(project.name).resolve("languages"))
runtimeJars.forEach {
javaJar(it.name)
// kotlinJar(it.name)
Expand Down
8 changes: 7 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ modelix-mps-buildtools = { id = "org.modelix.mps.build-tools", version.ref = "mo
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
intellij1 = { id = "org.jetbrains.intellij", version = "1.17.4" }
intellij2 = { id = "org.jetbrains.intellij.platform", version.ref = "intellijGradle" }
intellij2-migration = { id = "org.jetbrains.intellij.platform.migration", version.ref = "intellijGradle" }

[versions]
modelixCore = "16.3.0"
modelixCore = "16.4.0"
modelixBuildtools="2.0.1"
kotlin = "2.2.21"
intellijGradle = "2.10.2"

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

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
4 changes: 2 additions & 2 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion interpreter-vm/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

kotlin {
jvmToolchain(17)
jvmToolchain(21)
jvm()
js(IR) {
browser {}
Expand Down
4 changes: 2 additions & 2 deletions kernelf-editor/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ val generatorOutputDir = file("src/commonMain/kotlin_gen")
val tsGeneratorOutputDir = file("../kernelf-angular-demo/src/gen")

kotlin {
jvmToolchain(17)
jvmToolchain(21)
jvm()
js(IR) {
browser {
Expand Down Expand Up @@ -153,7 +153,7 @@ tasks.named("packJsPackage") {
val productionLibraryByKotlinOutputDirectory = layout.buildDirectory.dir("compileSync/js/main/productionLibrary/kotlin")
val preparedProductionLibraryOutputDirectory = layout.buildDirectory.dir("npmPublication")

val patchTypesScriptInProductionLibrary = tasks.register("patchTypesScriptInProductionLibrary") {
val patchTypesScriptInProductionLibrary = tasks.register<Task>("patchTypesScriptInProductionLibrary") {
dependsOn("compileProductionLibraryKotlinJs")
inputs.dir(productionLibraryByKotlinOutputDirectory)
outputs.dir(preparedProductionLibraryOutputDirectory)
Expand Down
2 changes: 1 addition & 1 deletion kernelf-ssr-demo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ application {
}

kotlin {
jvmToolchain(17)
jvmToolchain(21)
}
Loading
Loading