Skip to content

Commit

Permalink
Merge pull request #883 from JetBrains/feature/run-migrations
Browse files Browse the repository at this point in the history
Prepare to run migrations as part of the build
  • Loading branch information
sergej-koscejev authored Jul 10, 2024
2 parents 7a46f77 + 5dd81b5 commit 5720529
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 76 deletions.
44 changes: 13 additions & 31 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
plugins {
id 'de.itemis.mps.gradle.common' version '1.24.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'
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

Expand Down Expand Up @@ -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
Expand All @@ -547,37 +547,19 @@ 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<String> 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 }

mpsHome = mpsHomeDir
projectDirectories.from('code')
pluginRoots.from(usedPluginRoots)
maxHeapSize = '4G'

maxHeapSize = "4G"
// diagram migration from version 0 is currently not rerunnable, although it claims to be
excludeModuleMigration("de.itemis.mps.editor.diagram", 0)
}
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@
<property role="EcuMT" value="5731047739261374212" />
<property role="TrG5h" value="NestedTreeDiagram" />
<property role="19KtqR" value="true" />
<ref role="1TJDcQ" to="tpck:gw2VY9q" />
<ref role="1TJDcQ" to="tpck:gw2VY9q" resolve="BaseConcept" />
<node concept="1TJgyj" id="4Y8LoRLvr4V" role="1TKVEi">
<property role="IQ2ns" value="5731047739261563195" />
<property role="20lmBu" value="fLJjDmT/aggregation" />
Expand All @@ -351,7 +351,7 @@
<node concept="1TIwiD" id="4Y8LoRLw0Mi">
<property role="EcuMT" value="5731047739261717650" />
<property role="TrG5h" value="TreeSubDiagram" />
<ref role="1TJDcQ" to="tpck:gw2VY9q" />
<ref role="1TJDcQ" to="tpck:gw2VY9q" resolve="BaseConcept" />
<node concept="PrWs8" id="4Y8LoRLw1kE" role="PzmwI">
<ref role="PrY4T" node="37WsXDFJRg1" resolve="IBaseGraphTest" />
</node>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@
<reference id="5455284157993910961" name="concept" index="2pJxaS" />
<child id="5455284157993911099" name="values" index="2pJxcM" />
</concept>
<concept id="6985522012210254362" name="jetbrains.mps.lang.quotation.structure.NodeBuilderPropertyExpression" flags="nn" index="WxPPo">
<child id="6985522012210254363" name="expression" index="WxPPp" />
</concept>
<concept id="8182547171709614739" name="jetbrains.mps.lang.quotation.structure.NodeBuilderRef" flags="nn" index="36bGnv">
<reference id="8182547171709614741" name="target" index="36bGnp" />
</concept>
Expand Down Expand Up @@ -4221,17 +4224,19 @@
<ref role="2pJxaS" to="2qld:56jSwh$g_0B" resolve="ContentAlignment" />
<node concept="2pJxcG" id="56jSwh$nLti" role="2pJxcM">
<ref role="2pJxcJ" to="2qld:56jSwh$g_6I" resolve="alignment" />
<node concept="2OqwBi" id="56jSwh$nG6D" role="28ntcv">
<node concept="1XH99k" id="56jSwh$nFe9" role="2Oq$k0">
<ref role="1XH99l" to="2qld:56jSwh$g$O1" resolve="ContentAlignmentEnum" />
</node>
<node concept="2ViDtW" id="56jSwh$nG_$" role="2OqNvi">
<node concept="2OqwBi" id="56jSwh$nHq0" role="2ViJBj">
<node concept="2GrUjf" id="56jSwh$nGPT" role="2Oq$k0">
<ref role="2Gs0qQ" node="56jSwh$nD8c" resolve="contentAlignment" />
</node>
<node concept="liA8E" id="56jSwh$nJtv" role="2OqNvi">
<ref role="37wK5l" to="wyt6:~Enum.name()" resolve="name" />
<node concept="WxPPo" id="1pHFW3u9pZ6" role="28ntcv">
<node concept="2OqwBi" id="56jSwh$nG6D" role="WxPPp">
<node concept="1XH99k" id="56jSwh$nFe9" role="2Oq$k0">
<ref role="1XH99l" to="2qld:56jSwh$g$O1" resolve="ContentAlignmentEnum" />
</node>
<node concept="2ViDtW" id="56jSwh$nG_$" role="2OqNvi">
<node concept="2OqwBi" id="56jSwh$nHq0" role="2ViJBj">
<node concept="2GrUjf" id="56jSwh$nGPT" role="2Oq$k0">
<ref role="2Gs0qQ" node="56jSwh$nD8c" resolve="contentAlignment" />
</node>
<node concept="liA8E" id="56jSwh$nJtv" role="2OqNvi">
<ref role="37wK5l" to="wyt6:~Enum.name()" resolve="name" />
</node>
</node>
</node>
</node>
Expand Down Expand Up @@ -5164,17 +5169,19 @@
<ref role="2pJxaS" to="2qld:56jSwh$g_0B" resolve="ContentAlignment" />
<node concept="2pJxcG" id="1SEN4_CV_MV" role="2pJxcM">
<ref role="2pJxcJ" to="2qld:56jSwh$g_6I" resolve="alignment" />
<node concept="2OqwBi" id="1SEN4_CV_MW" role="28ntcv">
<node concept="1XH99k" id="1SEN4_CV_MX" role="2Oq$k0">
<ref role="1XH99l" to="2qld:56jSwh$g$O1" resolve="ContentAlignmentEnum" />
</node>
<node concept="2ViDtW" id="1SEN4_CV_MY" role="2OqNvi">
<node concept="2OqwBi" id="1SEN4_CV_MZ" role="2ViJBj">
<node concept="2GrUjf" id="1SEN4_CV_N0" role="2Oq$k0">
<ref role="2Gs0qQ" node="1SEN4_CV_ML" resolve="contentAlignment" />
</node>
<node concept="liA8E" id="1SEN4_CV_N1" role="2OqNvi">
<ref role="37wK5l" to="wyt6:~Enum.name()" resolve="name" />
<node concept="WxPPo" id="1pHFW3u9pZ7" role="28ntcv">
<node concept="2OqwBi" id="1SEN4_CV_MW" role="WxPPp">
<node concept="1XH99k" id="1SEN4_CV_MX" role="2Oq$k0">
<ref role="1XH99l" to="2qld:56jSwh$g$O1" resolve="ContentAlignmentEnum" />
</node>
<node concept="2ViDtW" id="1SEN4_CV_MY" role="2OqNvi">
<node concept="2OqwBi" id="1SEN4_CV_MZ" role="2ViJBj">
<node concept="2GrUjf" id="1SEN4_CV_N0" role="2Oq$k0">
<ref role="2Gs0qQ" node="1SEN4_CV_ML" resolve="contentAlignment" />
</node>
<node concept="liA8E" id="1SEN4_CV_N1" role="2OqNvi">
<ref role="37wK5l" to="wyt6:~Enum.name()" resolve="name" />
</node>
</node>
</node>
</node>
Expand Down Expand Up @@ -8075,17 +8082,19 @@
<ref role="2pJxaS" to="2qld:56jSwh$g_0B" resolve="ContentAlignment" />
<node concept="2pJxcG" id="3biyEnOppbx" role="2pJxcM">
<ref role="2pJxcJ" to="2qld:56jSwh$g_6I" resolve="alignment" />
<node concept="2OqwBi" id="3biyEnOppby" role="28ntcv">
<node concept="1XH99k" id="3biyEnOppbz" role="2Oq$k0">
<ref role="1XH99l" to="2qld:56jSwh$g$O1" resolve="ContentAlignmentEnum" />
</node>
<node concept="2ViDtW" id="3biyEnOppb$" role="2OqNvi">
<node concept="2OqwBi" id="3biyEnOppb_" role="2ViJBj">
<node concept="2GrUjf" id="3biyEnOppbA" role="2Oq$k0">
<ref role="2Gs0qQ" node="3biyEnOppbn" resolve="contentAlignment" />
</node>
<node concept="liA8E" id="3biyEnOppbB" role="2OqNvi">
<ref role="37wK5l" to="wyt6:~Enum.name()" resolve="name" />
<node concept="WxPPo" id="1pHFW3u9pZ8" role="28ntcv">
<node concept="2OqwBi" id="3biyEnOppby" role="WxPPp">
<node concept="1XH99k" id="3biyEnOppbz" role="2Oq$k0">
<ref role="1XH99l" to="2qld:56jSwh$g$O1" resolve="ContentAlignmentEnum" />
</node>
<node concept="2ViDtW" id="3biyEnOppb$" role="2OqNvi">
<node concept="2OqwBi" id="3biyEnOppb_" role="2ViJBj">
<node concept="2GrUjf" id="3biyEnOppbA" role="2Oq$k0">
<ref role="2Gs0qQ" node="3biyEnOppbn" resolve="contentAlignment" />
</node>
<node concept="liA8E" id="3biyEnOppbB" role="2OqNvi">
<ref role="37wK5l" to="wyt6:~Enum.name()" resolve="name" />
</node>
</node>
</node>
</node>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,9 @@
<reference id="5455284157993910961" name="concept" index="2pJxaS" />
<child id="5455284157993911099" name="values" index="2pJxcM" />
</concept>
<concept id="6985522012210254362" name="jetbrains.mps.lang.quotation.structure.NodeBuilderPropertyExpression" flags="nn" index="WxPPo">
<child id="6985522012210254363" name="expression" index="WxPPp" />
</concept>
</language>
<language id="1919c723-b60b-4592-9318-9ce96d91da44" name="de.itemis.mps.editor.celllayout">
<concept id="9000758320091481718" name="de.itemis.mps.editor.celllayout.structure.GridLayoutFlattenStyle" flags="lg" index="1QQdxR" />
Expand Down Expand Up @@ -14782,7 +14785,9 @@
<ref role="2pJxaS" to="2qld:5NyYfidQYgt" resolve="PredefinedEdgeStyle" />
<node concept="2pJxcG" id="5NyYfidRmQd" role="2pJxcM">
<ref role="2pJxcJ" to="2qld:5NyYfidQYC2" resolve="style" />
<node concept="2ZBlsa" id="5NyYfidRmZQ" role="28ntcv" />
<node concept="WxPPo" id="1pHFW3u9pZ9" role="28ntcv">
<node concept="2ZBlsa" id="5NyYfidRmZQ" role="WxPPp" />
</node>
</node>
</node>
</node>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<persistence version="9" />
<languages>
<use id="c72da2b9-7cce-4447-8389-f407dc1158b7" name="jetbrains.mps.lang.structure" version="9" />
<use id="982eb8df-2c96-4bd7-9963-11712ea622e5" name="jetbrains.mps.lang.resources" version="2" />
<devkit ref="78434eb8-b0e5-444b-850d-e7c4ad2da9ab(jetbrains.mps.devkit.aspect.structure)" />
</languages>
<imports>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8629,7 +8629,7 @@
</node>
<node concept="i0U1m" id="4Y8LoRLw0_3" role="i0UWM">
<ref role="i0Utg" node="4Y8LoRLw0$0" resolve="10" />
<ref role="i0Ul0" node="4Y8LoRLw0$7" resolve="5" />
<ref role="i0Ul0" node="4Y8LoRLw0$7" resolve="3" />
</node>
<node concept="G6Ax2" id="4Y8LoRLw0az" role="J81tK">
<property role="G6Av7" value="1.6" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7952,7 +7952,7 @@
</node>
<node concept="Rm8GO" id="1UvgBlYKDAn" role="3uHU7w">
<ref role="Rm8GQ" node="4KKQOHIOeog" resolve="MODEL2GRAPH" />
<ref role="1Px2BO" node="4KKQOHIOeoe" resolve="SyncDirection" />
<ref role="1Px2BO" node="4KKQOHIOeoe" resolve="JGraphModelSynchronizer.SyncDirection" />
</node>
</node>
<node concept="3clFbC" id="1UvgBlYN94k" role="3uHU7w">
Expand Down Expand Up @@ -9749,7 +9749,7 @@
<node concept="1rXfSq" id="OCogGtwW87" role="3clFbG">
<ref role="37wK5l" node="1O5GA4gi4Pj" resolve="model2Graph" />
<node concept="37vLTw" id="4Y8LoRLPYcB" role="37wK5m">
<ref role="3cqZAo" node="4Y8LoRLPYcx" resolve="cell" />
<ref role="3cqZAo" node="4Y8LoRLPYcx" resolve="rootDCell" />
</node>
</node>
</node>
Expand Down Expand Up @@ -30985,7 +30985,7 @@
<property role="TyiWL" value="false" />
<node concept="22lmx$" id="4yNptAl11zr" role="3clFbw">
<node concept="37vLTw" id="4yNptAl1cHI" role="3uHU7w">
<ref role="3cqZAo" node="4yNptAjMOaA" resolve="isDefaulStyle" />
<ref role="3cqZAo" node="4yNptAjMOaA" resolve="isDefaulEdgeStyle" />
</node>
<node concept="3clFbC" id="3P47XPXTDng" role="3uHU7B">
<node concept="37vLTw" id="3P47XPXTDnh" role="3uHU7B">
Expand Down Expand Up @@ -36617,12 +36617,12 @@
<node concept="3clFbF" id="4yNptAjLxxx" role="3cqZAp">
<node concept="37vLTI" id="4yNptAjL$jA" role="3clFbG">
<node concept="37vLTw" id="4yNptAjL$YU" role="37vLTx">
<ref role="3cqZAo" node="4yNptAjKS8K" resolve="customStyle" />
<ref role="3cqZAo" node="4yNptAjKS8K" resolve="defaultStyle" />
</node>
<node concept="2OqwBi" id="4yNptAjLxQV" role="37vLTJ">
<node concept="Xjq3P" id="4yNptAjLxxv" role="2Oq$k0" />
<node concept="2OwXpG" id="4yNptAjLyQU" role="2OqNvi">
<ref role="2Oxat6" node="4yNptAjLgV0" resolve="customStyle" />
<ref role="2Oxat6" node="4yNptAjLgV0" resolve="defaultStyle" />
</node>
</node>
</node>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</concept>
</language>
<language id="ceab5195-25ea-4f22-9b92-103b95ca8c0c" name="jetbrains.mps.lang.core">
<concept id="1169194658468" name="jetbrains.mps.lang.core.structure.INamedConcept" flags="ngI" index="TrEIO">
<concept id="1169194658468" name="jetbrains.mps.lang.core.structure.INamedConcept" flags="ng" index="TrEIO">
<property id="1169194664001" name="name" index="TrG5h" />
</concept>
</language>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<concept id="1068580123136" name="jetbrains.mps.baseLanguage.structure.StatementList" flags="sn" stub="5293379017992965193" index="3clFbS">
<child id="1068581517665" name="statement" index="3cqZAp" />
</concept>
<concept id="1204053956946" name="jetbrains.mps.baseLanguage.structure.IMethodCall" flags="ngI" index="1ndlxa">
<concept id="1204053956946" name="jetbrains.mps.baseLanguage.structure.IMethodCall" flags="ng" index="1ndlxa">
<reference id="1068499141037" name="baseMethodDeclaration" index="37wK5l" />
</concept>
</language>
Expand All @@ -64,7 +64,7 @@
</concept>
</language>
<language id="ceab5195-25ea-4f22-9b92-103b95ca8c0c" name="jetbrains.mps.lang.core">
<concept id="1169194658468" name="jetbrains.mps.lang.core.structure.INamedConcept" flags="ngI" index="TrEIO">
<concept id="1169194658468" name="jetbrains.mps.lang.core.structure.INamedConcept" flags="ng" index="TrEIO">
<property id="1169194664001" name="name" index="TrG5h" />
</concept>
</language>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<language slang="l:fd392034-7849-419d-9071-12563d152375:jetbrains.mps.baseLanguage.closures" version="0" />
<language slang="l:83888646-71ce-4f1c-9c53-c54016f6ad4f:jetbrains.mps.baseLanguage.collections" version="1" />
<language slang="l:f2801650-65d5-424e-bb1b-463a8781b786:jetbrains.mps.baseLanguage.javadoc" version="2" />
<language slang="l:760a0a8c-eabb-4521-8bfd-65db761a9ba3:jetbrains.mps.baseLanguage.logging" version="0" />
<language slang="l:ceab5195-25ea-4f22-9b92-103b95ca8c0c:jetbrains.mps.lang.core" version="2" />
<language slang="l:c0080a47-7e37-4558-bee9-9ae18e690549:jetbrains.mps.lang.extension" version="2" />
<language slang="l:446c26eb-2b7b-4bf0-9b35-f83fa582753e:jetbrains.mps.lang.modelapi" version="0" />
Expand Down

0 comments on commit 5720529

Please sign in to comment.