From eac41b0c1cfd99758435ce6ba1d32ce71b0014e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergej=20Ko=C5=A1=C4=8Dejev?= Date: Wed, 3 Jul 2024 15:06:54 +0200 Subject: [PATCH 1/3] Use Remigrate task from mps-gradle-plugin --- build.gradle | 41 ++++++++++------------------------------- 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/build.gradle b/build.gradle index 16a6cc9c8..e9d3e45a2 100644 --- a/build.gradle +++ b/build.gradle @@ -1,13 +1,13 @@ plugins { - id 'de.itemis.mps.gradle.common' version '1.24.0.+' + id 'de.itemis.mps.gradle.common' version '1.27.0.+' id "com.github.breadmoirai.github-release" version "2.4.1" id 'maven-publish' id 'base' - id 'de.itemis.mps.gradle.launcher' version '2.3.0.+' } import de.itemis.mps.gradle.* import de.itemis.mps.gradle.tasks.MpsMigrate +import de.itemis.mps.gradle.tasks.Remigrate import de.itemis.mps.gradle.downloadJBR.DownloadJbrForPlatform import groovy.xml.XmlSlurper @@ -528,12 +528,12 @@ def usedPluginRoots = [ new File(mpsHomeDir, 'plugins/mps-tooltips'), new File(mpsHomeDir, 'plugins/mps-vcs'), new File(mpsHomeDir, 'plugins/mps-git4idea'), + new File(mpsHomeDir, 'plugins/mps-httpsupport'), ] tasks.register('migrate', MpsMigrate) { dependsOn(resolveMps, 'downloadJbr', 'build_languages', 'build_tests') - javaExecutable = layout.file( - tasks.named('downloadJbr', DownloadJbrForPlatform).map { it.javaExecutable }) + javaLauncher = tasks.named('downloadJbr', DownloadJbrForPlatform).flatMap { it.javaLauncher } haltOnPrecheckFailure = true haltOnDependencyError = true @@ -547,37 +547,16 @@ tasks.register('migrate', MpsMigrate) { maxHeapSize = '4G' } - -tasks.register('rerunMigrations', JavaExec) { +tasks.register('remigrate', Remigrate) { mustRunAfter('migrate') mustRunAfter('build_languages', 'build_tests') dependsOn(resolveMps, 'downloadJbr') - mpsBackendLauncher.builder() - .withMpsHome(mpsHomeDir) - .withJavaExecutable(tasks.named('downloadJbr', DownloadJbrForPlatform).map { it.javaExecutable.path }) - .configure(it) - - classpath(fileTree(mpsHomeDir) { - include("lib/**/*.jar") - }) - classpath(configurations.rerunMigrationsBackend) - mainClass = 'de.itemis.mps.gradle.migrate.MainKt' - - args("--project=${file('code')}") - - // rerun-migrations needs its own jar added as a plugin - argumentProviders.add(new CommandLineArgumentProvider() { - @Override - Iterable asArguments() { - def config = configurations.rerunMigrationsBackend - - ["--plugin=de.itemis.mps.buildbackends.rerun-migrations::" + - configurations.rerunMigrationsBackend.files(config.dependencies.first()).first()] - } - }) - args(usedPluginRoots.collect { "--plugin-root=$it".toString() }) + javaLauncher = tasks.named('downloadJbr', DownloadJbrForPlatform).flatMap { it.javaLauncher } - maxHeapSize = "4G" + mpsHome = mpsHomeDir + projectDirectories.from('code') + pluginRoots.from(usedPluginRoots) + maxHeapSize = '4G' } From 9a6ffda49ec8f77c0d24bd9b7f2cf2ac4317e69f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergej=20Ko=C5=A1=C4=8Dejev?= Date: Tue, 9 Jul 2024 19:08:33 +0200 Subject: [PATCH 2/3] Exclude diagram migration version 0 It is currently not rerunnable. --- build.gradle | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index e9d3e45a2..a49fade64 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'de.itemis.mps.gradle.common' version '1.27.0.+' + id 'de.itemis.mps.gradle.common' version '1.28.0.+' id "com.github.breadmoirai.github-release" version "2.4.1" id 'maven-publish' id 'base' @@ -559,4 +559,7 @@ tasks.register('remigrate', Remigrate) { projectDirectories.from('code') pluginRoots.from(usedPluginRoots) maxHeapSize = '4G' + + // diagram migration from version 0 is currently not rerunnable, although it claims to be + excludeModuleMigration("de.itemis.mps.editor.diagram", 0) } From 5dd81b50deb510089f1363c07c55bf3b0b0bd0b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergej=20Ko=C5=A1=C4=8Dejev?= Date: Tue, 9 Jul 2024 21:32:54 +0200 Subject: [PATCH 3/3] Run migrations --- ....mps.editor.diagram.demo.elk.structure.mps | 4 +- .../languageModels/behavior.mps | 75 +++++++++++-------- .../languageModels/editor.mps | 7 +- .../languageModels/structure.mps | 1 + ...is.mps.editor.diagram.demo.elk.sandbox.mps | 2 +- .../mps/editor/diagram/runtime/jgraph.mps | 10 +-- .../models/plugin.mps | 2 +- .../models/plugin.mps | 4 +- .../de.itemis.model.merge.runtime.msd | 1 + 9 files changed, 61 insertions(+), 45 deletions(-) diff --git a/code/diagram/languages/de.itemis.mps.editor.diagram.demo.elk/models/de.itemis.mps.editor.diagram.demo.elk.structure.mps b/code/diagram/languages/de.itemis.mps.editor.diagram.demo.elk/models/de.itemis.mps.editor.diagram.demo.elk.structure.mps index b468a5da4..30cff9379 100644 --- a/code/diagram/languages/de.itemis.mps.editor.diagram.demo.elk/models/de.itemis.mps.editor.diagram.demo.elk.structure.mps +++ b/code/diagram/languages/de.itemis.mps.editor.diagram.demo.elk/models/de.itemis.mps.editor.diagram.demo.elk.structure.mps @@ -328,7 +328,7 @@ - + @@ -351,7 +351,7 @@ - + diff --git a/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/behavior.mps b/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/behavior.mps index 2308335bc..47ba42ae4 100644 --- a/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/behavior.mps +++ b/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/behavior.mps @@ -280,6 +280,9 @@ + + + @@ -4221,17 +4224,19 @@ - - - - - - - - - - - + + + + + + + + + + + + + @@ -5164,17 +5169,19 @@ - - - - - - - - - - - + + + + + + + + + + + + + @@ -8075,17 +8082,19 @@ - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/editor.mps b/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/editor.mps index 56a82486c..38fa8af5b 100644 --- a/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/editor.mps +++ b/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/editor.mps @@ -361,6 +361,9 @@ + + + @@ -14782,7 +14785,9 @@ - + + + diff --git a/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/structure.mps b/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/structure.mps index 6671b1a80..73dddadf0 100644 --- a/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/structure.mps +++ b/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/structure.mps @@ -3,6 +3,7 @@ + diff --git a/code/diagram/solutions/de.itemis.mps.editor.diagram.demo.elk.sandbox/models/de.itemis.mps.editor.diagram.demo.elk.sandbox.mps b/code/diagram/solutions/de.itemis.mps.editor.diagram.demo.elk.sandbox/models/de.itemis.mps.editor.diagram.demo.elk.sandbox.mps index 0801c152b..8a64c106a 100644 --- a/code/diagram/solutions/de.itemis.mps.editor.diagram.demo.elk.sandbox/models/de.itemis.mps.editor.diagram.demo.elk.sandbox.mps +++ b/code/diagram/solutions/de.itemis.mps.editor.diagram.demo.elk.sandbox/models/de.itemis.mps.editor.diagram.demo.elk.sandbox.mps @@ -8629,7 +8629,7 @@ - + diff --git a/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/jgraph.mps b/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/jgraph.mps index 6b649ed13..5d595b8a4 100644 --- a/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/jgraph.mps +++ b/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/jgraph.mps @@ -7952,7 +7952,7 @@ - + @@ -9749,7 +9749,7 @@ - + @@ -30985,7 +30985,7 @@ - + @@ -36617,12 +36617,12 @@ - + - + diff --git a/code/shadowmodels/languages/de.q60.mps.virtualinterfaces/models/plugin.mps b/code/shadowmodels/languages/de.q60.mps.virtualinterfaces/models/plugin.mps index c2ae26442..0fb366511 100644 --- a/code/shadowmodels/languages/de.q60.mps.virtualinterfaces/models/plugin.mps +++ b/code/shadowmodels/languages/de.q60.mps.virtualinterfaces/models/plugin.mps @@ -30,7 +30,7 @@ - + diff --git a/code/shadowmodels/solutions/de.q60.mps.polymorphicfunctions.runtime/models/plugin.mps b/code/shadowmodels/solutions/de.q60.mps.polymorphicfunctions.runtime/models/plugin.mps index 667b6b092..eba6d7240 100644 --- a/code/shadowmodels/solutions/de.q60.mps.polymorphicfunctions.runtime/models/plugin.mps +++ b/code/shadowmodels/solutions/de.q60.mps.polymorphicfunctions.runtime/models/plugin.mps @@ -53,7 +53,7 @@ - + @@ -64,7 +64,7 @@ - + diff --git a/code/solutions/de.itemis.model.merge.runtime/de.itemis.model.merge.runtime.msd b/code/solutions/de.itemis.model.merge.runtime/de.itemis.model.merge.runtime.msd index 5ade07e46..e1cf087d4 100644 --- a/code/solutions/de.itemis.model.merge.runtime/de.itemis.model.merge.runtime.msd +++ b/code/solutions/de.itemis.model.merge.runtime/de.itemis.model.merge.runtime.msd @@ -29,6 +29,7 @@ +