Skip to content

Commit

Permalink
Merge pull request #146 from modelix/mps-editor-tests
Browse files Browse the repository at this point in the history
[DRAFT] Test for the SSR editor plugin for MPS
  • Loading branch information
slisson authored Apr 30, 2024
2 parents 58e9771 + 3551916 commit 8a443f8
Show file tree
Hide file tree
Showing 59 changed files with 1,407 additions and 368 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/mps-compatibility.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ jobs:
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew :projectional-editor-ssr-mps:build -PciBuild=true -Pgpr.token=${{ secrets.GITHUB_TOKEN }} -Pmps.version.major=${{ matrix.version }}
run: >-
./gradlew
:projectional-editor-ssr-mps:build
:projectional-editor-ssr-mps-languages:build
-PciBuild=true
-Pgpr.token=${{ secrets.GITHUB_TOKEN }}
-Pmps.version.major=${{ matrix.version }}
- name: Archive test report
uses: actions/upload-artifact@v4
if: always()
Expand Down
5 changes: 2 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
# - id: end-of-file-fixer # disabled, because it modifies MPS XML files
- id: check-toml
- id: check-yaml
- id: check-added-large-files
- id: check-merge-conflict
- id: check-symlinks
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: trailing-whitespace
# - id: trailing-whitespace # disabled, because it modifies multiline string literals to invalid values
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.4.0
hooks:
Expand Down
4 changes: 4 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ plugins {
`kotlin-dsl`
}

dependencies {
implementation(kotlin("stdlib"))
}

repositories {
mavenCentral()
}
10 changes: 9 additions & 1 deletion buildSrc/src/main/kotlin/org/modelix/CopyMps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ val Project.mpsMajorVersion: String get() {
if (project != rootProject) return rootProject.mpsVersion
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.3"
?: "2023.2"
}

val Project.mpsVersion: String get() {
Expand Down Expand Up @@ -61,6 +61,14 @@ val Project.mpsHomeDir: Provider<Directory> get() {
return project.layout.buildDirectory.dir("mps-$mpsVersion")
}

val Project.mpsPluginsDir: File? get() {
val candidates = listOfNotNull(
project.findProperty("mps$mpsPlatformVersion.plugins.dir")?.toString()?.let { file(it) },
System.getProperty("user.home")?.let { file(it).resolve("/Library/Application Support/JetBrains/MPS2023.2/plugins/") },
)
return candidates.firstOrNull { it.isDirectory }
}

fun Project.copyMps(): File {
if (project != rootProject) return rootProject.copyMps()

Expand Down
5 changes: 3 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ npm-publish = { id = "dev.petuska.npm.publish", version = "3.4.2" }
modelix-mps-buildtools = { id = "org.modelix.mps.build-tools", version.ref = "modelixBuildtools" }

[versions]
modelixCore = "7.2.0-pr707.7a5dda1"
modelixBuildtools="1.4.1"
modelixCore = "7.3.0"
modelixBuildtools="1.4.2-kotlin.support"

[libraries]
modelix-model-api = { group = "org.modelix", name = "model-api", version.ref = "modelixCore" }
Expand All @@ -21,3 +21,4 @@ modelix-model-datastructure = { group = "org.modelix", name = "model-datastructu
modelix-mps-model-adapters = { group = "org.modelix.mps", name = "model-adapters", version.ref = "modelixCore" }
kotlin-logging = { group = "io.github.oshai", name = "kotlin-logging", version = "6.0.9" }
kotlin-html = "org.jetbrains.kotlinx:kotlinx-html:0.11.0"
modelix-build-tools-lib = { group = "org.modelix.mps", name = "build-tools-lib", version.ref = "modelixBuildtools" }
4 changes: 2 additions & 2 deletions kernelf-angular-demo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ val updateTsModelApiVersion = tasks.create("updateTsModelApiVersion") {
var text = packageJsonFile.readText()
println("ts-model-api path: $localPath")
val replacement = if (localPath.exists()) {
""""@modelix/ts-model-api": "file:${localPath.relativeTo(projectDir)}""""
""""@modelix/ts-model-api": "file:${localPath.relativeTo(projectDir).toString().replace("\\", "\\\\")}""""
} else {
""""@modelix/ts-model-api": "${rootProject.property("ts-model-api.version")}""""
}
println("ts-model-api version: $replacement")
text = text.replace(Regex(""""@modelix/ts-model-api": ".*""""), replacement)
text = text.replace(Regex(""""@modelix/ts-model-api": ".*""""), { replacement })
packageJsonFile.writeText(text)
}
}
Expand Down
13 changes: 6 additions & 7 deletions mps/.mps/modules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
<project version="4">
<component name="MPSProject">
<projectModules>
<modulePath path="$PROJECT_DIR$/devkits/org.modelix.mps.webaspect.devkit/org.modelix.mps.webaspect.devkit.devkit" folder="" />
<modulePath path="$PROJECT_DIR$/languages/org.modelix.mps.notation/org.modelix.mps.notation.mpl" folder="" />
<modulePath path="$PROJECT_DIR$/org.modelix.mps.baseLanguage2kotlin/org.modelix.mps.baseLanguage2kotlin.mpl" folder="" />
<modulePath path="$PROJECT_DIR$/org.modelix.mps.editor.ssr.stubs/org.modelix.mps.editor.ssr.stubs.msd" folder="" />
<modulePath path="$PROJECT_DIR$/org.modelix.mps.notation.runtime/org.modelix.mps.notation.runtime.msd" folder="" />
<modulePath path="$PROJECT_DIR$/solutions/org.modelix.mps.notation.impl.baseLanguage/org.modelix.mps.notation.impl.baseLanguage.msd" folder="" />
<modulePath path="$PROJECT_DIR$/solutions/org.modelix.mps.webaspect.genplan/org.modelix.mps.webaspect.genplan.msd" folder="" />
<modulePath path="$PROJECT_DIR$/modules/org.modelix.mps.baseLanguage2kotlin/org.modelix.mps.baseLanguage2kotlin.mpl" folder="" />
<modulePath path="$PROJECT_DIR$/modules/org.modelix.mps.notation.impl.baseLanguage/org.modelix.mps.notation.impl.baseLanguage.msd" folder="" />
<modulePath path="$PROJECT_DIR$/modules/org.modelix.mps.notation/org.modelix.mps.notation.mpl" folder="" />
<modulePath path="$PROJECT_DIR$/modules/org.modelix.mps.webaspect.devkit/org.modelix.mps.webaspect.devkit.devkit" folder="" />
<modulePath path="$PROJECT_DIR$/modules/org.modelix.mps.webaspect.genplan/org.modelix.mps.webaspect.genplan.msd" folder="" />
<modulePath path="$PROJECT_DIR$/stubs-template/org.modelix.mps.editor.ssr.stubs/org.modelix.mps.editor.ssr.stubs.msd" folder="" />
</projectModules>
</component>
</project>
11 changes: 8 additions & 3 deletions mps/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@ plugins {
}

mpsBuild {
dependsOn(":projectional-editor-ssr-mps:buildPlugin")
mpsHome = mpsHomeDir.get().asFile.absolutePath
javaHome = Jvm.current().javaHome

search(".")
search("../projectional-editor-ssr-mps/build/idea-sandbox/plugins/projectional-editor-ssr-mps")
search("modules")
publication("editor-languages") {
module("org.modelix.mps.webaspect.devkit")
module("org.modelix.mps.webaspect.genplan")
module("org.modelix.mps.baseLanguage2kotlin")
module("org.modelix.mps.notation")
}
publication("already-packaged-modules") {
module("org.modelix.mps.editor.ssr.stubs")
publication("baseLanguage-notation") {
module("org.modelix.mps.notation.impl.baseLanguage")
}
}

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<concept id="737165568293720756" name="org.modelix.mps.notation.structure.IndentCell" flags="ng" index="2OWiap" />
<concept id="737165568293545234" name="org.modelix.mps.notation.structure.ChildrenCollectionCell" flags="ng" index="2OWXkZ">
<reference id="737165568293545559" name="link" index="2OWXpU" />
<reference id="737165568293545885" name="subconceptToInsert" index="2OWXuK" />
<child id="737165568293546266" name="layout" index="2OWX$R" />
<child id="7525355686451955469" name="separatorCell" index="1r02wH" />
</concept>
Expand Down Expand Up @@ -121,6 +122,7 @@
<node concept="2OWiap" id="CUW2QYNjjz" role="2OY0$2" />
<node concept="2OWXkZ" id="CUW2QYMNqb" role="2OY0$2">
<ref role="2OWXpU" to="tpee:4EqhHTp4Mw3" resolve="member" />
<ref role="2OWXuK" to="tpee:1hodSy9TH5A" resolve="PlaceholderMember" />
<node concept="2OYvdK" id="CUW2QYNjnP" role="2OWX$R" />
</node>
</node>
Expand Down Expand Up @@ -238,6 +240,7 @@
<ref role="3JBHV4" to="tpee:fzclF80" resolve="StatementList" />
<node concept="2OWXkZ" id="42C8o9nAVwl" role="3JBHQ1">
<ref role="2OWXpU" to="tpee:fzcqZ_x" resolve="statement" />
<ref role="2OWXuK" to="tpee:fzclF8l" resolve="Statement" />
<node concept="2OYvdK" id="42C8o9nAVwo" role="2OWX$R" />
</node>
</node>
Expand Down Expand Up @@ -1437,7 +1440,10 @@
<ref role="3JBHV4" to="tpee:h_B$H5g" resolve="AbstractOperation" />
<node concept="3JB3jO" id="4JzlXapjSpU" role="3JBHQ1" />
</node>
<node concept="3JBHHy" id="4dQjfTHY9SY" role="3JBHiB" />
<node concept="3JBH_3" id="m1OUzpj50M" role="3JBHiB">
<ref role="3JBHV4" to="tpee:1hodSy9TH5A" resolve="PlaceholderMember" />
<node concept="3JB3jO" id="m1OUzpj59Z" role="3JBHQ1" />
</node>
</node>
<node concept="3JBFZQ" id="22f9nDgKep2">
<property role="TrG5h" value="jetbrains.mps.lang.smodel" />
Expand Down
Loading

0 comments on commit 8a443f8

Please sign in to comment.