@@ -56,7 +56,8 @@ internal fun buildMpsRunConfigurationForLocalTarget(
56
56
val repositoryDir = checkNotNull(localTarget.repositoryDir) {
57
57
" syncDirection.target has no `repositoryDir` specified."
58
58
}
59
- val hasBaseRevision = (syncDirection.source as ? ServerSource )?.baseRevision != null
59
+ val source = syncDirection.source
60
+ val hasBaseRevision = (source as ? ServerSource )?.baseRevision != null
60
61
val config = MPSRunnerConfig (
61
62
mainClassName = " org.modelix.mps.model.sync.bulk.MPSBulkSynchronizer" ,
62
63
mainMethodName = if (hasBaseRevision) " importRepositoryFromModelServer" else " importRepository" ,
@@ -65,19 +66,25 @@ internal fun buildMpsRunConfigurationForLocalTarget(
65
66
workDir = jsonDir,
66
67
additionalModuleDirs = localTarget.mpsLibraries.toList() + repositoryDir,
67
68
plugins = createPluginConfig(localTarget.mpsPlugins),
68
- jvmArgs = listOfNotNull(
69
- " -Dmodelix.mps.model.sync.bulk.input.path=${jsonDir.absolutePath} " ,
70
- " -Dmodelix.mps.model.sync.bulk.input.modules=${syncDirection.includedModules.joinToString(" ," )} " ,
71
- " -Dmodelix.mps.model.sync.bulk.input.modules.prefixes=${syncDirection.includedModulePrefixes.joinToString(" ," )} " ,
72
- " -Dmodelix.mps.model.sync.bulk.repo.path=${repositoryDir.absolutePath} " ,
73
- " -Dmodelix.mps.model.sync.bulk.input.continueOnError=${syncDirection.continueOnError} " ,
74
- " -Dmodelix.mps.model.sync.bulk.server.repository=${(syncDirection.source as ServerSource ).repositoryId} " .takeIf { hasBaseRevision },
75
- " -Dmodelix.mps.model.sync.bulk.server.url=${(syncDirection.source as ServerSource ).url} " .takeIf { hasBaseRevision },
76
- " -Dmodelix.mps.model.sync.bulk.server.version.hash=${(syncDirection.source as ServerSource ).revision} " .takeIf { hasBaseRevision },
77
- " -Dmodelix.mps.model.sync.bulk.server.version.base.hash=${(syncDirection.source as ServerSource ).baseRevision} " .takeIf { hasBaseRevision },
78
- " -Xmx${localTarget.mpsHeapSize} " ,
79
- localTarget.mpsDebugPort?.let { " -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=$it " },
80
- ),
69
+ jvmArgs = buildList {
70
+ add(" -Dmodelix.mps.model.sync.bulk.input.path=${jsonDir.absolutePath} " )
71
+ val includeModuleValue = syncDirection.includedModules.joinToString(" ," )
72
+ add(" -Dmodelix.mps.model.sync.bulk.input.modules=$includeModuleValue " )
73
+ val includeModulePrefixesValue = syncDirection.includedModulePrefixes.joinToString(" ," )
74
+ add(" -Dmodelix.mps.model.sync.bulk.input.modules.prefixes=$includeModulePrefixesValue " )
75
+ add(" -Dmodelix.mps.model.sync.bulk.repo.path=${repositoryDir.absolutePath} " )
76
+ add(" -Dmodelix.mps.model.sync.bulk.input.continueOnError=${syncDirection.continueOnError} " )
77
+ add(" -Xmx${localTarget.mpsHeapSize} " )
78
+ if (localTarget.mpsDebugPort != null ) {
79
+ add(" -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=${localTarget.mpsDebugPort} " )
80
+ }
81
+ if (source is ServerSource && source.baseRevision != null ) {
82
+ add(" -Dmodelix.mps.model.sync.bulk.server.repository=${source.repositoryId} " )
83
+ add(" -Dmodelix.mps.model.sync.bulk.server.url=${source.url} " )
84
+ add(" -Dmodelix.mps.model.sync.bulk.server.version.hash=${source.revision} " )
85
+ add(" -Dmodelix.mps.model.sync.bulk.server.version.base.hash=${source.baseRevision} " )
86
+ }
87
+ },
81
88
)
82
89
return config
83
90
}
0 commit comments