Skip to content

Commit

Permalink
feat(bulk-model-sync-gradle): continue on error support for local target
Browse files Browse the repository at this point in the history
  • Loading branch information
mhuster23 committed Feb 19, 2024
1 parent b81e08d commit 621f5e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,6 @@ class ModelSyncGradlePlugin : Plugin<Project> {
previousTask: TaskProvider<*>,
jsonDir: File,
) {
if (syncDirection.continueOnError) {
println("Continue on error is currently not supported for local targets")
}

val localTarget = syncDirection.target as LocalTarget
val importName = "${syncDirection.name}ImportIntoMps"
val resolvedDependencies = mpsDependencies.resolvedConfiguration.files
Expand All @@ -195,6 +191,7 @@ class ModelSyncGradlePlugin : Plugin<Project> {
"-Dmodelix.mps.model.sync.bulk.input.modules=${syncDirection.includedModules.joinToString(",")}",
"-Dmodelix.mps.model.sync.bulk.input.modules.prefixes=${syncDirection.includedModulePrefixes.joinToString(",")}",
"-Dmodelix.mps.model.sync.bulk.repo.path=${localTarget.repositoryDir?.absolutePath}",
"-Dmodelix.mps.model.sync.bulk.input.continueOnError=${syncDirection.continueOnError}",
"-Xmx${localTarget.mpsHeapSize}",
localTarget.mpsDebugPort?.let { "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=$it" },
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ object MPSBulkSynchronizer {
val includedModuleNames = parseRawPropertySet(System.getProperty("modelix.mps.model.sync.bulk.input.modules"))
val includedModulePrefixes = parseRawPropertySet(System.getProperty("modelix.mps.model.sync.bulk.input.modules.prefixes"))
val inputPath = System.getProperty("modelix.mps.model.sync.bulk.input.path")
val continueOnError = System.getProperty("modelix.mps.model.sync.bulk.input.continueOnError", "false").toBoolean()
val jsonFiles = File(inputPath).listFiles()?.filter {
it.extension == "json" && isModuleIncluded(it.nameWithoutExtension, includedModuleNames, includedModulePrefixes)
}
Expand All @@ -78,7 +79,7 @@ object MPSBulkSynchronizer {
access.executeCommand {
val repoAsNode = MPSRepositoryAsNode(repository)
println("Importing modules...")
ModelImporter(repoAsNode).importFilesAsRootChildren(jsonFiles)
ModelImporter(repoAsNode, continueOnError).importFilesAsRootChildren(jsonFiles)
println("Import finished.")
}
}
Expand Down

0 comments on commit 621f5e8

Please sign in to comment.