author
int64 658
755k
| date
stringlengths 19
19
| timezone
int64 -46,800
43.2k
| hash
stringlengths 40
40
| message
stringlengths 5
490
| mods
list | language
stringclasses 20
values | license
stringclasses 3
values | repo
stringlengths 5
68
| original_message
stringlengths 12
491
|
---|---|---|---|---|---|---|---|---|---|
426,496 | 03.03.2022 10:18:47 | -3,600 | f2c922752db7c40d5e526648bf10cad4428f2970 | A workspace can have a name that is shown in the workspace list | [
{
"change_type": "MODIFY",
"old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/Workspace.kt",
"new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/Workspace.kt",
"diff": "@@ -24,6 +24,7 @@ import java.util.*\n@Serializable\ndata class Workspace(var id: String,\n+ var name: String? = null,\nval mpsVersion: String? = null,\nval modelRepositories: List<ModelRepository> = listOf(),\nval gitRepositories: List<GitRepository> = listOf(),\n"
},
{
"change_type": "MODIFY",
"old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt",
"new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt",
"diff": "@@ -48,11 +48,12 @@ fun Application.workspaceManagerModule() {\nbody {\nh1 { text(\"Workspaces\") }\nul {\n- manager.getWorkspaceIds().forEach {\n+ manager.getWorkspaceIds().forEach { workspaceId ->\n+ val workspace = manager.getWorkspaceForId(workspaceId)?.first\nli {\na {\n- href = \"$it/edit\"\n- text(it)\n+ href = \"$workspaceId/edit\"\n+ text((workspace?.name ?: \"<no name>\") + \" ($workspaceId)\")\n}\n}\n}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | A workspace can have a name that is shown in the workspace list |
426,496 | 03.03.2022 10:19:11 | -3,600 | 3e1db64cc34465b792bda9f85d413160f9e2210d | Workspace edit page now has a link back to the workspace list | [
{
"change_type": "MODIFY",
"old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt",
"new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt",
"diff": "@@ -120,6 +120,11 @@ fun Application.workspaceManagerModule() {\nbody {\ndiv {\na {\n+ href = \"../\"\n+ text(\"Workspace List\")\n+ }\n+ a {\n+ style = \"margin-left: 24px\"\nhref = \"../$workspaceHash/download-modules/queue\"\ntext(\"Download Modules\")\n}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Workspace edit page now has a link back to the workspace list |
426,496 | 03.03.2022 10:19:46 | -3,600 | 30b59db20aa1d3e0c3deae345e64a829df4e6c33 | Index page of the Modelix cluster now has a link to the workspace list | [
{
"change_type": "MODIFY",
"old_path": "proxy/index.html",
"new_path": "proxy/index.html",
"diff": "<html>\n<head>\n- <title>modelix</title>\n+ <title>Modelix</title>\n</head>\n<body>\n-<h1>modelix</h1>\n+<h1>Modelix</h1>\n-<a href=\"ui/\">Repository</a>\n+<a href=\"workspace-manager/\">Workspaces</a>\n</body>\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Index page of the Modelix cluster now has a link to the workspace list |
426,496 | 03.03.2022 11:11:28 | -3,600 | 6bbb8ddbb1f98ba2063918da3bdb04309af7eab8 | Fixed the mpsbuild gradle plugin | [
{
"change_type": "RENAME",
"old_path": "gradle-mpsbuild-plugin/src/main/resources/META-INF/gradle-plugins/modelix-gradle-build-plugin.properties",
"new_path": "gradle-mpsbuild-plugin/src/main/resources/META-INF/gradle-plugins/modelix-gradle-mpsbuild-plugin.properties",
"diff": ""
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/GenerationPlanBuilder.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/GenerationPlanBuilder.kt",
"diff": "*/\npackage org.modelix.buildtools\n+import kotlin.math.max\n+\nclass GenerationPlanBuilder(val availableModules: FoundModules, val ignoredModules: Set<ModuleId>) {\nval plan: GenerationPlan = GenerationPlan()\nprivate val processedNodes: MutableSet<DependencyGraph.DependencyNode> = HashSet()\n@@ -29,7 +31,10 @@ class GenerationPlanBuilder(val availableModules: FoundModules, val ignoredModul\nprocessedNodes += node\nnode.getDependencies().forEach { build(it) }\n- var chunkIndex = (node.getDependencies().mapNotNull { chunkIndexes[it] }.maxOrNull() ?: -1) + 1\n+ var chunkIndex = -1\n+ val dependencyChunkIndexes = node.getDependencies().mapNotNull { chunkIndexes[it] }\n+ .forEach { chunkIndex = max(it, chunkIndex) }\n+ chunkIndex++\n// Too large chunks require too much memory\nwhile (plan.chunkSize(chunkIndex) > 20) {\nchunkIndex++\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Fixed the mpsbuild gradle plugin |
426,496 | 03.03.2022 12:35:56 | -3,600 | 9a36bb9acef5fb488e00496a5fb37162b8d52324 | Show list of uploads with a button to add/remove them from the workspace | [
{
"change_type": "MODIFY",
"old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManager.kt",
"new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManager.kt",
"diff": "@@ -190,7 +190,11 @@ class WorkspaceManager {\nreturn folder\n}\n- fun getUploadFolder(id: String) = File(File(directory, \"uploads\"), id)\n+ private fun getUploadsFolder() = File(directory, \"uploads\")\n+\n+ fun getExistingUploads(): List<File> = getUploadsFolder().listFiles()?.toList() ?: listOf()\n+\n+ fun getUploadFolder(id: String) = File(getUploadsFolder(), id)\nprivate fun buildWorkspaceDownloadFile(job: WorkspaceBuildJob): File {\nval workspace = job.workspace\n"
},
{
"change_type": "MODIFY",
"old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt",
"new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt",
"diff": "@@ -157,7 +157,55 @@ fun Application.workspaceManagerModule() {\nbr()\ndiv {\nstyle = \"border: 1px solid black; padding: 10px;\"\n- div { text(\"Upload file or directory (max ~200 MB):\") }\n+\n+ div { text(\"Uploads:\") }\n+ val allUploads = manager.getExistingUploads().associateBy { it.name }\n+ val uploadContent: (Map.Entry<String, File?>)->String = { uploads ->\n+ val fileNames: List<File> = (uploads.value?.listFiles()?.toList() ?: listOf())\n+ fileNames.joinToString(\", \") { it.name }\n+ }\n+ table {\n+ for (upload in allUploads.toSortedMap()) {\n+ tr {\n+ td { +upload.key }\n+ td { +uploadContent(upload) }\n+ td {\n+ if (workspace.uploads.contains(upload.key)) {\n+ form {\n+ action = \"./remove-upload\"\n+ method = FormMethod.post\n+ input {\n+ type = InputType.hidden\n+ name = \"uploadId\"\n+ value = upload.key\n+ }\n+ input {\n+ type = InputType.submit\n+ value = \"Remove\"\n+ }\n+ }\n+ } else {\n+ form {\n+ action = \"./use-upload\"\n+ method = FormMethod.post\n+ input {\n+ type = InputType.hidden\n+ name = \"uploadId\"\n+ value = upload.key\n+ }\n+ input {\n+ type = InputType.submit\n+ value = \"Add\"\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ br()\n+ br()\n+ div { text(\"Upload new file or directory (max ~200 MB):\") }\nform {\naction = \"./upload\"\nmethod = FormMethod.post\n@@ -341,6 +389,24 @@ fun Application.workspaceManagerModule() {\ncall.respondRedirect(\"./edit\")\n}\n+ post(\"{workspaceId}/use-upload\") {\n+ val workspaceId = call.parameters[\"workspaceId\"]!!\n+ val uploadId = call.receiveParameters()[\"uploadId\"]!!\n+ val workspace = manager.getWorkspaceForId(workspaceId)?.first!!\n+ workspace.uploads += uploadId\n+ manager.update(workspace)\n+ call.respondRedirect(\"./edit\")\n+ }\n+\n+ post(\"{workspaceId}/remove-upload\") {\n+ val workspaceId = call.parameters[\"workspaceId\"]!!\n+ val uploadId = call.receiveParameters()[\"uploadId\"]!!\n+ val workspace = manager.getWorkspaceForId(workspaceId)?.first!!\n+ workspace.uploads -= uploadId\n+ manager.update(workspace)\n+ call.respondRedirect(\"./edit\")\n+ }\n+\nstatic {\nresources(\"html\")\n}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Show list of uploads with a button to add/remove them from the workspace |
426,496 | 03.03.2022 15:02:03 | -3,600 | 29bce98ef92634f15a07856747654adad31f482f | print dependency cycles | [
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/DependencyGraph.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/DependencyGraph.kt",
"diff": "@@ -61,6 +61,16 @@ class DependencyGraph(val moduleResolver: ModuleResolver) {\nprivate fun mergeCycles() {\nval cycleFinder = CycleFinder()\nmodule2node.values.forEach { cycleFinder.process(it) }\n+\n+ for (cycle in cycleFinder.cycles) {\n+ val modules = cycle.flatMap { it.modules }\n+ .filter { it.moduleType == ModuleType.Language || it.moduleType == ModuleType.Solution }\n+ if (!modules.any { it.owner is SourceModuleOwner }) continue\n+ if (modules.size > 1) {\n+ println(\"Dependency cycle: \" + modules.joinToString(\" -> \") { it.name })\n+ }\n+ }\n+\nfor (cycle in cycleFinder.cycles) {\nval nodesToMerge = cycle.map { it.getMergedNode() }.distinct()\nif (nodesToMerge.size <= 1) continue\n@@ -129,13 +139,13 @@ class DependencyGraph(val moduleResolver: ModuleResolver) {\nprivate inner class CycleFinder {\nval processed = HashSet<DependencyNode>()\n- val cycles: MutableList<List<DependencyNode>> = ArrayList()\n+ val cycles: LinkedHashSet<LinkedHashSet<DependencyNode>> = LinkedHashSet()\nval currentStack = ArrayList<DependencyNode>()\nfun process(node: DependencyNode) {\nval index = currentStack.indexOf(node)\nif (index != -1) {\n- cycles += currentStack.drop(index)\n+ cycles += LinkedHashSet(currentStack.drop(index))\n}\nif (processed.contains(node)) return\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModulesMiner.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModulesMiner.kt",
"diff": "@@ -117,8 +117,8 @@ class ModulesMiner() {\nif (modulesXmlFile.exists() && modulesXmlFile.isFile) {\nval moduleFiles = readModulesXml(modulesXmlFile, file)\n.filter { !isModuleFileIgnored(it, file, fileFilter) }\n- println(\"MPS project found in $file. Loading only modules that are part of the project:\")\n- moduleFiles.forEach { println(\" $it\") }\n+// println(\"MPS project found in $file. Loading only modules that are part of the project:\")\n+// moduleFiles.forEach { println(\" $it\") }\nmoduleFiles.forEach { moduleFile -> collectModules(moduleFile, owner, origin, result, fileFilter) }\n} else {\nval pluginXml = File(File(file, \"META-INF\"), \"plugin.xml\")\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | print dependency cycles |
426,496 | 03.03.2022 16:07:16 | -3,600 | 3a7c5d3da85ad03b1efe90133f4371901fc31c93 | Documentation for workspaces | [
{
"change_type": "MODIFY",
"old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt",
"new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt",
"diff": "@@ -47,6 +47,10 @@ fun Application.workspaceManagerModule() {\n}\nbody {\nh1 { text(\"Workspaces\") }\n+ p {\n+ +\"A workspace allows to deploy an MPS project and all of its dependencies to Modelix and edit it in the browser.\"\n+ +\"Solutions are synchronized with the model server and between all MPS instances.\"\n+ }\nul {\nmanager.getWorkspaceIds().forEach { workspaceId ->\nval workspace = manager.getWorkspaceForId(workspaceId)?.first\n@@ -140,6 +144,9 @@ fun Application.workspaceManagerModule() {\n}\n}\nbr()\n+ div {\n+ style = \"display: flex\"\n+ div {\nform {\naction = \"./update\"\nmethod = FormMethod.post\n@@ -154,6 +161,96 @@ fun Application.workspaceManagerModule() {\nvalue = \"Save Changes\"\n}\n}\n+ }\n+ div {\n+ style = \"display: inline-block\"\n+ ul {\n+ li {\n+ b { +\"name\" }\n+ +\": Is just shown to the user in the workspace list.\"\n+ }\n+ li {\n+ b { +\"mpsVersion\" }\n+ +\": Currently not used.\"\n+ +\" A workspace is always executed with MPS version that is installed in the Modelix cluster.\"\n+ }\n+ li {\n+ b { +\"modelRepositories\" }\n+ +\": Currently not used. A separate repository on the model server is created for each workspace.\"\n+ +\" The ID of the repository for this workspace is \"\n+ i { +\"workspace_${workspace.id}\" }\n+ +\".\"\n+ }\n+ li {\n+ b { +\"gitRepositories\" }\n+ +\": Git repository containing an MPS project. No build script is required.\"\n+ +\" Modelix will build all languages including their dependencies after cloning the repository.\"\n+ +\" If this repository is not public, credentials can be specified.\"\n+ +\" Alternatively, a project can be uploaded as a .zip file. (see below)\"\n+ ul {\n+ li {\n+ b { +\"url\" }\n+ +\": Address of the Git repository.\"\n+ }\n+ li {\n+ b { +\"name\" }\n+ +\": Currently not used.\"\n+ }\n+ li {\n+ b { +\"branch\" }\n+ +\": If no commitHash is specified, the latest commit from this branch is used.\"\n+ }\n+ li {\n+ b { +\"commitHash\" }\n+ +\": A Git commit hash can be specified to ensure that always the same version is used.\"\n+ }\n+ li {\n+ b { +\"paths\" }\n+ +\": If this repository contains additional modules that you don't want to use in Modelix,\"\n+ +\" you can specify a list of folders that you want to include.\"\n+ }\n+ li {\n+ b { +\"credentials\" }\n+ +\": The credentials are encrypted before they are stored.\"\n+ ul {\n+ li { b { +\"user\" } }\n+ li { b { +\"password\" } }\n+ }\n+ }\n+ }\n+ }\n+ li {\n+ b { +\"mavenRepositories\" }\n+ +\": Some artifacts are bundled with Modelix.\"\n+ +\" If you additional ones, here you can specify maven repositories that contain them.\"\n+ ul {\n+ li {\n+ b { +\"url\" }\n+ +\": You probably want to use this one: \"\n+ i { +\"https://projects.itemis.de/nexus/content/repositories/mbeddr/\" }\n+ }\n+ }\n+ }\n+ li {\n+ b { +\"mavenDependencies\" }\n+ +\": Maven coordinates to a .zip file containing MPS modules/plugins.\"\n+ +\" Example: \"\n+ i { +\"de.itemis.mps:extensions:2020.3.2179.1ee9c94:zip\" }\n+ +\". You can also add one of the bundled artifacts by clicking on it (see below)\"\n+ }\n+ li {\n+ b { +\"uploads\" }\n+ +\": There is a special section for managing uploads. Directly editing this list is not required.\"\n+ }\n+ li {\n+ b { +\"ignoredModules\" }\n+ +\": A list of MPS module IDs that should be excluding from generation.\"\n+ +\" Also missing dependencies that should be ignored can be listed here.\"\n+ +\" This section is usually used when the generation fails and editing the project is not possible.\"\n+ }\n+ }\n+ }\n+ }\nbr()\ndiv {\nstyle = \"border: 1px solid black; padding: 10px;\"\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Documentation for workspaces |
426,496 | 04.03.2022 14:58:40 | -3,600 | b4bf50957880dc4cfaa2ba78eb826c5f44885d1d | Build script generator also packages modules as jars | [
{
"change_type": "DELETE",
"old_path": "generator-test-project/mps-generate-script.xml",
"new_path": null,
"diff": "-<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n-<project default=\"generate\">\n- <property location=\"/Users/slisson/mps/mps203/modelix/artifacts/mps\" name=\"mps.home\"/>\n- <property location=\"${mps.home}\" name=\"mps_home\"/>\n- <property location=\"${mps.home}\" name=\"artifacts.mps\"/>\n- <path id=\"path.mps.ant.path\">\n- <pathelement location=\"${mps.home}/lib/ant/lib/ant-mps.jar\"/>\n- <pathelement location=\"${mps.home}/lib/log4j.jar\"/>\n- <pathelement location=\"${mps.home}/lib/jdom.jar\"/>\n- </path>\n- <target depends=\"declare-mps-tasks\" name=\"generate\">\n- <echo message=\"generating\"/>\n- <generate createStaticRefs=\"false\" fork=\"true\" hideWarnings=\"false\" logLevel=\"warn\" parallelMode=\"false\" skipUnmodifiedModels=\"false\" strictMode=\"false\" targetJavaVersion=\"11\" useInplaceTransform=\"false\">\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/mps-stubs.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/baseLanguage/jetbrains.mps.baseLanguage.logging.runtime.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/baseLanguage/jetbrains.mps.baseLanguage.tuples.runtime.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/runtimes/jetbrains.mps.lang.behavior.runtime.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/runtimes/jetbrains.mps.lang.constraints.rules.runtime.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/runtimes/jetbrains.mps.lang.feedback.problem.rt.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/runtimes/jetbrains.mps.lang.feedback.api.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/runtimes/jetbrains.mps.lang.feedback.problem.rules.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/runtimes/jetbrains.mps.lang.messages.api.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.descriptor.aspects.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/baseLanguage/jetbrains.mps.baseLanguage.regexp.runtime.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.typesystemEngine.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/make/jetbrains.mps.make.runtime.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/make/jetbrains.mps.make.script.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/make/jetbrains.mps.make.facet.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.refactoring.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.script.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.textGen.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/text/jetbrains.mps.lang.text.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.slanguage.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/baseLanguage/jetbrains.mps.baseLanguage.regexp.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/make/jetbrains.mps.smodel.resources.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/make/jetbrains.mps.make.facets.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.smodel.query.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.plugin.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.checkedName.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.findUsages.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.typesystem.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/plaf/jetbrains.mps.baseLanguage.search.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.scopes.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.rulesAndMessages.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/baseLanguage/jetbrains.mps.baseLanguage.blTypes.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.intentions.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/baseLanguage/jetbrains.mps.baseLanguage.builders.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/util/jetbrains.mps.project.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/tools/jetbrains.mps.tool.common.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/tools/jetbrains.mps.core.tool.environment.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/baseLanguage/jetbrains.mps.baseLanguage.jdk8.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/util/jetbrains.mps.java.stub.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/make/jetbrains.mps.make.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/plaf/jetbrains.mps.ide.platform.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.access.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.resources.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.messages.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.generator.generationContext.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.util.order.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.generator.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.extension.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.aspect.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.feedback.skeleton.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.feedback.problem.failingRule.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.pattern.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.dataFlow.analyzers.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.dataFlow.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.constraints.rules.skeleton.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.constraints.rules.kinds.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.constraints.rules.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.context.defs.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.context.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.feedback.problem.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.feedback.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/runtimes/jetbrains.mps.lang.feedback.problem.legacy-constraints.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/runtimes/jetbrains.mps.lang.feedback.problem.structure.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.feedback.problem.structural.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.feedback.problem.childAndProp.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.feedback.problem.scopes.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.feedback.messages.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.constraints.msg.specification.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.sharedConcepts.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.constraints.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.project.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.descriptor.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.actions.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/baseLanguage/jetbrains.mps.baseLanguageInternal.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.modelapi.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.baseLanguage.lightweightdsl.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/baseLanguage/jetbrains.mps.baseLanguage.jdk7.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/baseLanguage/jetbrains.mps.baseLanguage.classifiers.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/plaf/jetbrains.mps.baseLanguage.util.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.structure.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.quotation.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/baseLanguage/jetbrains.mps.baseLanguage.scopes.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/baseLanguage/jetbrains.mps.baseLanguage.tuples.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/baseLanguage/jetbrains.mps.baseLanguage.checkedDots.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/baseLanguage/jetbrains.mps.baseLanguage.logging.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/runtimes/jetbrains.mps.refactoring.runtime.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.behavior.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.smodel.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.scopes.runtime.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.migration.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/util/jetbrains.mps.refactoring.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/plaf/jetbrains.mps.ide.refactoring.platform.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.refactoring.participant.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/runtimes/jetbrains.mps.lang.migration.runtime.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/baseLanguage/jetbrains.mps.baseLanguage.collections.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/runtimes/jetbrains.mps.findUsages.runtime.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/runtimes/jetbrains.mps.lang.smodel.query.runtime.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/editor/jetbrains.mps.editorlang.runtime.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/editor/jetbrains.mps.editor.runtime.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.editor.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/xml/jetbrains.mps.core.xml.sax.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/util/jetbrains.mps.kernel.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/util/jetbrains.mps.runtime.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/runtimes/jetbrains.mps.dataFlow.runtime.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.traceable.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/runtimes/jetbrains.mps.lang.behavior.api.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/runtimes/jetbrains.mps.analyzers.runtime.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/baseLanguage/jetbrains.mps.baseLanguage.extensionMethods.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/baseLanguage/jetbrains.mps.baseLanguage.closures.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/baseLanguage/collections.runtime.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.core.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/baseLanguage/jetbrains.mps.baseLanguage.references.runtime.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/baseLanguage/closures.runtime.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/baseLanguage/jetbrains.mps.baseLanguage.javadoc.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/runtimes/jetbrains.mps.lang.feedback.context.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/baseLanguage/jetbrains.mps.baseLanguage.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/languageDesign/jetbrains.mps.lang.generator.generationParameters.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/devkits/jetbrains.mps.devkit.general-purpose.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/devkits/jetbrains.mps.devkit.aspect.constraints.rules.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/devkits/jetbrains.mps.devkit.aspect.constraints.rulesAndMessages.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/devkits/jetbrains.mps.devkit.aspect.constraints.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/devkits/jetbrains.mps.devkit.aspect.typesystem.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/devkits/jetbrains.mps.devkit.aspect.structure.jar\"/>\n- <library file=\"/Users/slisson/mps/mps203/modelix/artifacts/mps/languages/devkits/jetbrains.mps.devkit.templates.jar\"/>\n- <chunk>\n- <module file=\"/Users/slisson/mps/mps203/modelix/generator-test-project/languages/test.org.modelix.generatortestproject.L1/test.org.modelix.generatortestproject.L1.mpl\"/>\n- </chunk>\n- <chunk>\n- <module file=\"/Users/slisson/mps/mps203/modelix/generator-test-project/languages/test.org.modelix.generatortestproject.L2/test.org.modelix.generatortestproject.L2.mpl\"/>\n- </chunk>\n- <chunk>\n- <module file=\"/Users/slisson/mps/mps203/modelix/generator-test-project/solutions/test.org.modelix.generatortestproject.S2/test.org.modelix.generatortestproject.S2.msd\"/>\n- </chunk>\n- <jvmargs>\n- <arg value=\"-ea\"/>\n- <arg value=\"-Xmx2G\"/>\n- </jvmargs>\n- </generate>\n- </target>\n- <target name=\"declare-mps-tasks\">\n- <taskdef classpathref=\"path.mps.ant.path\" resource=\"jetbrains/mps/build/ant/antlib.xml\"/>\n- </target>\n-</project>\n"
},
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.java",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.java",
"diff": "@@ -65,7 +65,8 @@ public class MPSBuildPlugin implements Plugin<Project> {\nproject.getDependencies().create(\"org.modelix:mps-model-plugin:\" + modelixVersion));\n}\n- File antScriptFile = new File(project.getProjectDir(), \"mps-generate-script.xml\");\n+ File buildDir = new File(new File(project.getProjectDir(), \"build\"), \"mpsbuild\");\n+ File antScriptFile = new File(buildDir, \"build-modules.xml\");\nTask generatorAntScript = project.getTasks().create(\"generatorAntScript\");\nAction<Task> action = task -> {\nModulesMiner modulesMiner = new ModulesMiner();\n@@ -87,7 +88,7 @@ public class MPSBuildPlugin implements Plugin<Project> {\nmodulesMiner.searchInFolder(mpsHome);\n}\nBuildScriptGenerator generator = new BuildScriptGenerator(modulesMiner, null,\n- Collections.emptySet(), Collections.emptyMap());\n+ Collections.emptySet(), Collections.emptyMap(), buildDir);\nString xml = generator.generateXML();\ntry {\nFileUtils.writeStringToFile(antScriptFile, xml, StandardCharsets.UTF_8);\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -22,7 +22,8 @@ import kotlin.io.path.pathString\nclass BuildScriptGenerator(val modulesMiner: ModulesMiner,\nval modulesToGenerate: List<ModuleId>? = null,\nval ignoredModules: Set<ModuleId> = HashSet(),\n- val macros: Map<String, File> = HashMap()) {\n+ val macros: Map<String, File> = HashMap(),\n+ val buildDir: File = File(\".\", \"build\")) {\nfun buildModules(antScriptFile: File = File.createTempFile(\"mps-build-script\", \".xml\", File(\".\")), outputHandler: ((String)->Unit)? = null) {\nval xml = generateXML()\n@@ -50,7 +51,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n.filter { it.owner is SourceModuleOwner && it.moduleType == ModuleType.Language }\n.map { it.moduleId }\n.toList()\n- val plan = generatePlan(modulesToGenerate_ - ignoredModules.toSet())\n+ val (plan, dependencyGraph) = generatePlan(modulesToGenerate_ - ignoredModules.toSet())\nval dbf = DocumentBuilderFactory.newInstance()\nval db = dbf.newDocumentBuilder()\n@@ -89,6 +90,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n}\n}\n+ // target: generate\nnewChild(\"target\") {\nsetAttribute(\"name\", \"generate\")\nsetAttribute(\"depends\", \"declare-mps-tasks\")\n@@ -141,24 +143,153 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n}\n}\n+ // target: declare-mps-tasks\nnewChild(\"target\") {\nsetAttribute(\"name\", \"declare-mps-tasks\")\nnewChild(\"taskdef\") {\nsetAttribute(\"resource\", \"jetbrains/mps/build/ant/antlib.xml\")\nsetAttribute(\"classpathref\", \"path.mps.ant.path\")\n+ }\n+ }\n+\n+ // target: compile.___.__.___\n+ val sourceModules = plan.chunks.flatMap { it.modules }.filter { it.owner is SourceModuleOwner }\n+ val generatorModules = sourceModules.flatMap { it.owner.modules.values - it }\n+ val modulesToCompile = sourceModules + generatorModules\n+ for (sourceModule in modulesToCompile) {\n+ newChild(\"target\") {\n+ setAttribute(\"name\", \"compile.${sourceModule.name}\")\n+\n+ val taskDependencies = sourceModule.dependencies\n+ .mapNotNull { modulesMiner.getModules().getModules()[it.id] }\n+ .filter { it.owner is SourceModuleOwner }\n+ .joinToString(\", \") { \"compile.${it.name}\" }\n+ setAttribute(\"depends\", taskDependencies)\n+\n+ newChild(\"mkdir\") {\n+ setAttribute(\"dir\", getCompileOutputDir(sourceModule).absolutePath)\n+ }\n+ newChild(\"javac\") {\n+ setAttribute(\"destdir\", getCompileOutputDir(sourceModule).absolutePath)\n+ setAttribute(\"fork\", \"false\")\n+ setAttribute(\"encoding\", \"utf8\")\n+ setAttribute(\"includeantruntime\", \"false\")\n+ setAttribute(\"debug\", \"true\")\n+ setAttribute(\"source\", \"11\")\n+ setAttribute(\"target\", \"11\")\n+ newChild(\"compilerarg\") {\n+ setAttribute(\"value\", \"-Xlint:none\")\n+ }\n+ newChild(\"src\") {\n+ newChild(\"path\") {\n+ setAttribute(\"location\", getSourceGenDir(sourceModule).pathString)\n+ }\n+ }\n+ newChild(\"classpath\") {\n+ if (mpsHome != null) {\n+ for (jar in File(mpsHome, \"lib\").walk().filter { it.extension == \"jar\" }) {\n+ newChild(\"fileset\") {\n+ setAttribute(\"file\", jar.absolutePath)\n+ }\n+ }\n+ }\n+\n+ val classPath = dependencyGraph.getNode(sourceModule.moduleId)!!\n+ .getTransitiveDependencies()\n+ .flatMap { it.modules }\n+ .flatMap { getClassPath(it) }\n+ .map { it.canonicalFile }\n+ .distinct()\n+ for (cpItem in classPath) {\n+ if (cpItem.isFile) {\n+ newChild(\"fileset\") {\n+ setAttribute(\"file\", cpItem.absolutePath)\n+ }\n+ } else {\n+ newChild(\"pathelement\") {\n+ setAttribute(\"path\", cpItem.absolutePath)\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ // target: compile\n+ newChild(\"target\") {\n+ setAttribute(\"depends\", modulesToCompile.joinToString(\", \") { \"compile.${it.name}\" })\n+ setAttribute(\"name\", \"compile\")\n+ }\n+\n+ newChild(\"target\") {\n+ setAttribute(\"name\", \"create-modules-output-dir\")\n+ setAttribute(\"depends\", \"declare-mps-tasks\")\n+ newChild(\"mkdir\") {\n+ setAttribute(\"dir\", getPackagedModulesDir().absolutePath)\n+ }\n+ }\n+\n+ // target: assemble.___.__.___\n+ for (sourceModule in modulesToCompile) {\n+ newChild(\"target\") {\n+ setAttribute(\"name\", \"assemble.${sourceModule.name}\")\n+ setAttribute(\"depends\", \"create-modules-output-dir, compile.${sourceModule.name}\")\n+ newChild(\"jar\") {\n+ setAttribute(\"destfile\", getJarFile(sourceModule).absolutePath)\n+ setAttribute(\"duplicate\", \"preserve\")\n+ newChild(\"fileset\") {\n+ setAttribute(\"dir\", getCompileOutputDir(sourceModule).absolutePath)\n+ }\n+ newChild(\"fileset\") {\n+ setAttribute(\"dir\", getSourceGenDir(sourceModule).pathString)\n+ setAttribute(\"includes\", \"**/trace.info, **/exports, **/*.mps, **/checkpoints\")\n+ }\n+ newChild(\"fileset\") {\n+ setAttribute(\"dir\", sourceModule.owner.path.getLocalAbsolutePath().parent.pathString)\n+ setAttribute(\"includes\", \"icons/**, resources/**\")\n}\n}\n}\n+ }\n+\n+ // target: assemble\n+ newChild(\"target\") {\n+ setAttribute(\"name\", \"assemble\")\n+ setAttribute(\"depends\", modulesToCompile.joinToString(\", \") { \"assemble.${it.name}\" })\n+ }\n+ }\ndoc.createElement(\"target\")\nreturn doc\n}\n- fun generatePlan(modulesToGenerate: List<ModuleId>): GenerationPlan {\n+ private fun getJarFile(module: FoundModule) = File(getPackagedModulesDir(), module.name + \".jar\")\n+ private fun getSrcJarFile(module: FoundModule) = File(getPackagedModulesDir(), module.name + \"-src.jar\")\n+ private fun getPackagedModulesDir() = File(buildDir, \"packaged-modules\")\n+ private fun getCompileOutputDir() = File(buildDir, \"java-out\")\n+ private fun getCompileOutputDir(module: FoundModule) = File(getCompileOutputDir(), module.name)\n+ private fun getSourceGenDir(module: FoundModule) = module.owner.path.getLocalAbsolutePath().parent.resolve(\"source_gen\")\n+ private fun getClassPath(module: FoundModule): List<File> {\n+ return when(val owner = module.owner) {\n+ is SourceModuleOwner -> {\n+ listOf(getCompileOutputDir(module))\n+ }\n+ is LibraryModuleOwner -> {\n+ listOf(owner.path.getLocalAbsolutePath().toFile())\n+ }\n+ is PluginModuleOwner -> {\n+ owner.path.getLocalAbsolutePath().resolve(\"lib\").toFile()\n+ .walk().filter { it.extension == \"jar\" }.toList()\n+ }\n+ else -> throw RuntimeException(\"Unknown owner: $owner\")\n+ }\n+ }\n+\n+ private fun generatePlan(modulesToGenerate: List<ModuleId>): Pair<GenerationPlan, DependencyGraph> {\nval planBuilder = GenerationPlanBuilder(modulesMiner.getModules(), ignoredModules)\n- planBuilder.build(modulesToGenerate.mapNotNull { modulesMiner.getModules().getModules()[it] })\n- return planBuilder.plan\n+ val dependencyGraph = planBuilder.build(modulesToGenerate.mapNotNull { modulesMiner.getModules().getModules()[it] })\n+ return planBuilder.plan to dependencyGraph\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/DependencyGraph.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/DependencyGraph.kt",
"diff": "@@ -19,6 +19,8 @@ class DependencyGraph(val moduleResolver: ModuleResolver) {\nfun getRoots() = module2node.values.filter { it.isRoot() }\n+ fun getNode(moduleId: ModuleId) = module2node[moduleId]\n+\nfun load(modules: Iterable<FoundModule>) {\nmodules.forEach { load(it) }\npostprocess()\n@@ -135,6 +137,14 @@ class DependencyGraph(val moduleResolver: ModuleResolver) {\nfun getReverseDependencies() = HashSet(reverseDependencies)\nfun isRoot() = reverseDependencies.isEmpty()\n+\n+ fun getTransitiveDependencies(result: MutableSet<DependencyNode> = HashSet()): Set<DependencyNode> {\n+ if (!result.contains(this)) {\n+ result += dependencies\n+ dependencies.forEach { it.getTransitiveDependencies(result) }\n+ }\n+ return result\n+ }\n}\nprivate inner class CycleFinder {\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/GenerationPlanBuilder.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/GenerationPlanBuilder.kt",
"diff": "@@ -20,10 +20,11 @@ class GenerationPlanBuilder(val availableModules: FoundModules, val ignoredModul\nprivate val processedNodes: MutableSet<DependencyGraph.DependencyNode> = HashSet()\nprivate val chunkIndexes: MutableMap<DependencyGraph.DependencyNode, Int> = HashMap()\n- fun build(modules: Iterable<FoundModule>) {\n+ fun build(modules: Iterable<FoundModule>): DependencyGraph {\nval dependencyGraph = DependencyGraph(ModuleResolver(availableModules, ignoredModules))\ndependencyGraph.load(modules)\ndependencyGraph.getRoots().forEach { build(it) }\n+ return dependencyGraph\n}\nprivate fun build(node: DependencyGraph.DependencyNode) {\n@@ -32,7 +33,7 @@ class GenerationPlanBuilder(val availableModules: FoundModules, val ignoredModul\nnode.getDependencies().forEach { build(it) }\nvar chunkIndex = -1\n- val dependencyChunkIndexes = node.getDependencies().mapNotNull { chunkIndexes[it] }\n+ node.getDependencies().mapNotNull { chunkIndexes[it] }\n.forEach { chunkIndex = max(it, chunkIndex) }\nchunkIndex++\n// Too large chunks require too much memory\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Build script generator also packages modules as jars |
426,496 | 04.03.2022 15:58:22 | -3,600 | a9f77d790e0c29d40ad2e7b313a2df2d65cab389 | Build script generator also packages modules as jars (2) | [
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -182,7 +182,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n}\nnewChild(\"src\") {\nnewChild(\"path\") {\n- setAttribute(\"location\", getSourceGenDir(sourceModule).pathString)\n+ setAttribute(\"location\", getSourceGenDir(sourceModule).absolutePath)\n}\n}\nnewChild(\"classpath\") {\n@@ -235,6 +235,48 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nnewChild(\"target\") {\nsetAttribute(\"name\", \"assemble.${sourceModule.name}\")\nsetAttribute(\"depends\", \"create-modules-output-dir, compile.${sourceModule.name}\")\n+ newChild(\"mkdir\") {\n+ setAttribute(\"dir\", getJarTempDir(sourceModule).absolutePath)\n+ }\n+ val metaInfFolder = File(getJarTempDir(sourceModule), \"META-INF\")\n+ newChild(\"mkdir\") {\n+ setAttribute(\"dir\", metaInfFolder.absolutePath)\n+ }\n+ newChild(\"echoxml\") {\n+ setAttribute(\"file\", File(metaInfFolder, \"module.xml\").absolutePath)\n+ newChild(\"module\") {\n+ setAttribute(\"namespace\", sourceModule.name)\n+ val typeString: String = when (sourceModule.moduleType) {\n+ ModuleType.Generator -> \"generator\"\n+ ModuleType.Solution -> \"solution\"\n+ ModuleType.Language -> \"language\"\n+ ModuleType.Devkit -> \"devkit\"\n+ }\n+ setAttribute(\"type\", typeString)\n+ setAttribute(\"uuid\", sourceModule.moduleId.id)\n+ newChild(\"dependencies\") {\n+// newChild(\"module\") {\n+// setAttribute(\"ref\", \"\")\n+// setAttribute(\"kind\", \"rt\")\n+// }\n+ }\n+ newChild(\"uses\") {\n+// newChild(\"language\") {\n+// setAttribute(\"id\", \"\")\n+// }\n+ }\n+ newChild(\"classpath\") {\n+ newChild(\"entry\") {\n+ setAttribute(\"path\", \".\")\n+ }\n+ }\n+ newChild(\"sources\") {\n+ setAttribute(\"jar\", \"${sourceModule.name}-src.jar\")\n+ setAttribute(\"descriptor\", sourceModule.owner.path.getLocalAbsolutePath().toFile().name)\n+ }\n+ }\n+ }\n+ // ___.__.___.jar\nnewChild(\"jar\") {\nsetAttribute(\"destfile\", getJarFile(sourceModule).absolutePath)\nsetAttribute(\"duplicate\", \"preserve\")\n@@ -242,7 +284,10 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nsetAttribute(\"dir\", getCompileOutputDir(sourceModule).absolutePath)\n}\nnewChild(\"fileset\") {\n- setAttribute(\"dir\", getSourceGenDir(sourceModule).pathString)\n+ setAttribute(\"dir\", getJarTempDir(sourceModule).absolutePath)\n+ }\n+ newChild(\"fileset\") {\n+ setAttribute(\"dir\", getSourceGenDir(sourceModule).absolutePath)\nsetAttribute(\"includes\", \"**/trace.info, **/exports, **/*.mps, **/checkpoints\")\n}\nnewChild(\"fileset\") {\n@@ -250,6 +295,33 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nsetAttribute(\"includes\", \"icons/**, resources/**\")\n}\n}\n+ // ___.__.___-src.jar\n+ newChild(\"copyModels\") {\n+ setAttribute(\"todir\", getModelsTempDir(sourceModule).absolutePath)\n+ newChild(\"fileset\") {\n+ setAttribute(\"dir\", getModelsDir(sourceModule).absolutePath)\n+ setAttribute(\"includes\", \"**/*.mps, **/*.mpsr, **/.model\")\n+ }\n+ }\n+ newChild(\"jar\") {\n+ setAttribute(\"destfile\", getSrcJarFile(sourceModule).absolutePath)\n+ setAttribute(\"duplicate\", \"preserve\")\n+ newChild(\"fileset\") {\n+ setAttribute(\"dir\", getSourceGenDir(sourceModule).absolutePath)\n+ newChild(\"exclude\") { setAttribute(\"name\", \"**/trace.info\") }\n+ newChild(\"exclude\") { setAttribute(\"name\", \"**/exports\") }\n+ newChild(\"exclude\") { setAttribute(\"name\", \"**/checkpoints\") }\n+ newChild(\"exclude\") { setAttribute(\"name\", \"**/*.mps\") }\n+ }\n+ newChild(\"zipfileset\") {\n+ setAttribute(\"file\", sourceModule.owner.path.getLocalAbsolutePath().pathString)\n+ setAttribute(\"prefix\", \"module\")\n+ }\n+ newChild(\"zipfileset\") {\n+ setAttribute(\"dir\", getModelsTempDir(sourceModule).absolutePath)\n+ setAttribute(\"prefix\", \"module/models\")\n+ }\n+ }\n}\n}\n@@ -266,11 +338,16 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n}\nprivate fun getJarFile(module: FoundModule) = File(getPackagedModulesDir(), module.name + \".jar\")\n+ private fun getJarTempDir(module: FoundModule) = File(getPackagedModulesTempDir(), module.name)\nprivate fun getSrcJarFile(module: FoundModule) = File(getPackagedModulesDir(), module.name + \"-src.jar\")\nprivate fun getPackagedModulesDir() = File(buildDir, \"packaged-modules\")\n+ private fun getPackagedModulesTempDir() = File(buildDir, \"packaged-modules-tmp\")\n+ private fun getModelsTempDir() = File(buildDir, \"models-tmp\")\n+ private fun getModelsTempDir(module: FoundModule) = File(getModelsTempDir(), module.name)\nprivate fun getCompileOutputDir() = File(buildDir, \"java-out\")\nprivate fun getCompileOutputDir(module: FoundModule) = File(getCompileOutputDir(), module.name)\n- private fun getSourceGenDir(module: FoundModule) = module.owner.path.getLocalAbsolutePath().parent.resolve(\"source_gen\")\n+ private fun getSourceGenDir(module: FoundModule) = module.owner.path.getLocalAbsolutePath().parent.resolve(\"source_gen\").toFile()\n+ private fun getModelsDir(module: FoundModule) = module.owner.path.getLocalAbsolutePath().parent.resolve(\"models\").toFile()\nprivate fun getClassPath(module: FoundModule): List<File> {\nreturn when(val owner = module.owner) {\nis SourceModuleOwner -> {\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Build script generator also packages modules as jars (2) |
426,496 | 04.03.2022 17:45:07 | -3,600 | 1fb80114eb2972aa80b7b571e52a66cc89cdff21 | Build script generator also packages modules as jars (3) | [
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -16,6 +16,7 @@ package org.modelix.buildtools\nimport org.modelix.headlessmps.ProcessExecutor\nimport org.w3c.dom.Document\nimport java.io.File\n+import java.nio.file.Path\nimport javax.xml.parsers.DocumentBuilderFactory\nimport kotlin.io.path.pathString\n@@ -231,13 +232,21 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n}\n// target: assemble.___.__.___\n- for (sourceModule in modulesToCompile) {\n+ for (sourceModule in sourceModules) {\n+ val generatorModule: FoundModule? = (sourceModule.owner.modules.values - sourceModule).firstOrNull()\n+ val moduleFolder = sourceModule.owner.path.getLocalAbsolutePath().parent\nnewChild(\"target\") {\nsetAttribute(\"name\", \"assemble.${sourceModule.name}\")\n- setAttribute(\"depends\", \"create-modules-output-dir, compile.${sourceModule.name}\")\n+ val targetDependencies = sourceModule.owner.modules.values.map { \"compile.${it.name}\" } + \"create-modules-output-dir\"\n+ setAttribute(\"depends\", targetDependencies.joinToString(\", \"))\nnewChild(\"mkdir\") {\nsetAttribute(\"dir\", getJarTempDir(sourceModule).absolutePath)\n}\n+ if (generatorModule != null) {\n+ newChild(\"mkdir\") {\n+ setAttribute(\"dir\", getJarTempDir(generatorModule).absolutePath)\n+ }\n+ }\nval metaInfFolder = File(getJarTempDir(sourceModule), \"META-INF\")\nnewChild(\"mkdir\") {\nsetAttribute(\"dir\", metaInfFolder.absolutePath)\n@@ -295,14 +304,35 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nsetAttribute(\"includes\", \"icons/**, resources/**\")\n}\n}\n+ // ___.__.___-generator.jar\n+ if (generatorModule != null) {\n+ newChild(\"jar\") {\n+ setAttribute(\"destfile\", getJarFile(generatorModule).absolutePath)\n+ setAttribute(\"duplicate\", \"preserve\")\n+ newChild(\"fileset\") {\n+ setAttribute(\"dir\", getCompileOutputDir(generatorModule).absolutePath)\n+ }\n+ newChild(\"fileset\") {\n+ setAttribute(\"dir\", getJarTempDir(generatorModule).absolutePath)\n+ }\n+ newChild(\"fileset\") {\n+ setAttribute(\"dir\", getSourceGenDir(generatorModule).absolutePath)\n+ setAttribute(\"includes\", \"**/trace.info, **/exports, **/*.mps, **/checkpoints\")\n+ }\n+ }\n+ }\n// ___.__.___-src.jar\n+ val modelFolders = findModelFolders(sourceModule)\n+ for (modelFolder in modelFolders) {\n+ val modelFolderRelative = moduleFolder.relativize(modelFolder.toPath())\nnewChild(\"copyModels\") {\n- setAttribute(\"todir\", getModelsTempDir(sourceModule).absolutePath)\n+ setAttribute(\"todir\", getModelsTempDir(sourceModule).toPath().resolve(modelFolderRelative).pathString)\nnewChild(\"fileset\") {\n- setAttribute(\"dir\", getModelsDir(sourceModule).absolutePath)\n+ setAttribute(\"dir\", modelFolder.absolutePath)\nsetAttribute(\"includes\", \"**/*.mps, **/*.mpsr, **/.model\")\n}\n}\n+ }\nnewChild(\"jar\") {\nsetAttribute(\"destfile\", getSrcJarFile(sourceModule).absolutePath)\nsetAttribute(\"duplicate\", \"preserve\")\n@@ -319,7 +349,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n}\nnewChild(\"zipfileset\") {\nsetAttribute(\"dir\", getModelsTempDir(sourceModule).absolutePath)\n- setAttribute(\"prefix\", \"module/models\")\n+ setAttribute(\"prefix\", \"module\")\n}\n}\n}\n@@ -328,7 +358,15 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n// target: assemble\nnewChild(\"target\") {\nsetAttribute(\"name\", \"assemble\")\n- setAttribute(\"depends\", modulesToCompile.joinToString(\", \") { \"assemble.${it.name}\" })\n+ setAttribute(\"depends\", sourceModules.joinToString(\", \") { \"assemble.${it.name}\" })\n+ }\n+\n+ // target: clean\n+ newChild(\"target\") {\n+ setAttribute(\"name\", \"clean\")\n+ newChild(\"delete\") { setAttribute(\"dir\", getPackagedModulesDir().absolutePath) }\n+ newChild(\"delete\") { setAttribute(\"dir\", getPackagedModulesTempDir().absolutePath) }\n+ newChild(\"delete\") { setAttribute(\"dir\", getCompileOutputDir().absolutePath) }\n}\n}\n@@ -337,17 +375,70 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nreturn doc\n}\n- private fun getJarFile(module: FoundModule) = File(getPackagedModulesDir(), module.name + \".jar\")\n- private fun getJarTempDir(module: FoundModule) = File(getPackagedModulesTempDir(), module.name)\n+ private fun getJarFile(module: FoundModule): File {\n+ return if (module.moduleType == ModuleType.Generator) {\n+ File(getPackagedModulesDir(), module.name + \"-generator.jar\")\n+ } else {\n+ File(getPackagedModulesDir(), module.name + \".jar\")\n+ }\n+ }\n+ private fun getJarTempDir(module: FoundModule): File {\n+ return if (module.moduleType == ModuleType.Generator) {\n+ File(getPackagedModulesTempDir(), module.name + \"-generator\")\n+ } else {\n+ File(getPackagedModulesTempDir(), module.name)\n+ }\n+ }\nprivate fun getSrcJarFile(module: FoundModule) = File(getPackagedModulesDir(), module.name + \"-src.jar\")\nprivate fun getPackagedModulesDir() = File(buildDir, \"packaged-modules\")\nprivate fun getPackagedModulesTempDir() = File(buildDir, \"packaged-modules-tmp\")\nprivate fun getModelsTempDir() = File(buildDir, \"models-tmp\")\n- private fun getModelsTempDir(module: FoundModule) = File(getModelsTempDir(), module.name)\n+ private fun getModelsTempDir(module: FoundModule): File {\n+ return if (module.moduleType == ModuleType.Generator) {\n+ File(getModelsTempDir(), module.name + \"-generator\")\n+ } else {\n+ File(getModelsTempDir(), module.name)\n+ }\n+ }\n+ private fun findModelFolders(module: FoundModule): List<File> {\n+ val moduleFolder = module.owner.path.getLocalAbsolutePath().parent\n+ return moduleFolder.toFile().walk()\n+ .filter { getParentFolderNames(it).all { name -> name != \"classes_gen\" } }\n+ .filter { it.extension == \"mps\" || it.extension == \"mpsr\" || it.name == \".model\" }\n+ .map { it.parentFile }.distinct()\n+ .toList()\n+ }\n+ private fun getParentFolderNames(file: File): List<String> {\n+ var parent: File? = file\n+ val result = ArrayList<String>()\n+ while (parent != null) {\n+ result += parent.name\n+ parent = parent.parentFile\n+ }\n+ return result\n+ }\nprivate fun getCompileOutputDir() = File(buildDir, \"java-out\")\n- private fun getCompileOutputDir(module: FoundModule) = File(getCompileOutputDir(), module.name)\n- private fun getSourceGenDir(module: FoundModule) = module.owner.path.getLocalAbsolutePath().parent.resolve(\"source_gen\").toFile()\n- private fun getModelsDir(module: FoundModule) = module.owner.path.getLocalAbsolutePath().parent.resolve(\"models\").toFile()\n+ private fun getCompileOutputDir(module: FoundModule): File {\n+ return if (module.moduleType == ModuleType.Generator) {\n+ File(getCompileOutputDir(), module.name + \"-generator\")\n+ } else {\n+ File(getCompileOutputDir(), module.name)\n+ }\n+ }\n+ private fun getSourceGenDir(module: FoundModule): File {\n+ return if (module.moduleType == ModuleType.Generator) {\n+ module.owner.path.getLocalAbsolutePath().parent.resolve(\"generator\").resolve(\"source_gen\").toFile()\n+ } else {\n+ module.owner.path.getLocalAbsolutePath().parent.resolve(\"source_gen\").toFile()\n+ }\n+ }\n+ private fun getModelsDir(module: FoundModule): File {\n+ return if (module.moduleType == ModuleType.Generator) {\n+ module.owner.path.getLocalAbsolutePath().parent.resolve(\"generator\").resolve(\"template\").toFile()\n+ } else {\n+ module.owner.path.getLocalAbsolutePath().parent.resolve(\"models\").toFile()\n+ }\n+ }\nprivate fun getClassPath(module: FoundModule): List<File> {\nreturn when(val owner = module.owner) {\nis SourceModuleOwner -> {\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Build script generator also packages modules as jars (3) |
426,496 | 04.03.2022 18:16:01 | -3,600 | b332cc6f9f556a60e7b9beae574b0c442584167e | Build script generator also packages modules as jars (4) | [
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -231,22 +231,14 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n}\n}\n- // target: assemble.___.__.___\n- for (sourceModule in sourceModules) {\n- val generatorModule: FoundModule? = (sourceModule.owner.modules.values - sourceModule).firstOrNull()\n- val moduleFolder = sourceModule.owner.path.getLocalAbsolutePath().parent\n+ // target: assemble.___.__.___ and assemble.generator.___.__.___\n+ for (sourceModule in modulesToCompile) {\nnewChild(\"target\") {\n- setAttribute(\"name\", \"assemble.${sourceModule.name}\")\n- val targetDependencies = sourceModule.owner.modules.values.map { \"compile.${it.name}\" } + \"create-modules-output-dir\"\n- setAttribute(\"depends\", targetDependencies.joinToString(\", \"))\n+ setAttribute(\"name\", getAssembleTargetName(sourceModule))\n+ setAttribute(\"depends\", \"compile.${sourceModule.name}, create-modules-output-dir\")\nnewChild(\"mkdir\") {\nsetAttribute(\"dir\", getJarTempDir(sourceModule).absolutePath)\n}\n- if (generatorModule != null) {\n- newChild(\"mkdir\") {\n- setAttribute(\"dir\", getJarTempDir(generatorModule).absolutePath)\n- }\n- }\nval metaInfFolder = File(getJarTempDir(sourceModule), \"META-INF\")\nnewChild(\"mkdir\") {\nsetAttribute(\"dir\", metaInfFolder.absolutePath)\n@@ -304,23 +296,14 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nsetAttribute(\"includes\", \"icons/**, resources/**\")\n}\n}\n- // ___.__.___-generator.jar\n- if (generatorModule != null) {\n- newChild(\"jar\") {\n- setAttribute(\"destfile\", getJarFile(generatorModule).absolutePath)\n- setAttribute(\"duplicate\", \"preserve\")\n- newChild(\"fileset\") {\n- setAttribute(\"dir\", getCompileOutputDir(generatorModule).absolutePath)\n- }\n- newChild(\"fileset\") {\n- setAttribute(\"dir\", getJarTempDir(generatorModule).absolutePath)\n- }\n- newChild(\"fileset\") {\n- setAttribute(\"dir\", getSourceGenDir(generatorModule).absolutePath)\n- setAttribute(\"includes\", \"**/trace.info, **/exports, **/*.mps, **/checkpoints\")\n- }\n}\n}\n+ for (sourceModule in sourceModules) {\n+ val moduleFolder = sourceModule.owner.path.getLocalAbsolutePath().parent\n+ newChild(\"target\") {\n+ setAttribute(\"name\", getAssembleTargetName(sourceModule.owner as SourceModuleOwner))\n+ val targetDependencies = sourceModule.owner.modules.values.map { getAssembleTargetName(it) } + \"create-modules-output-dir\"\n+ setAttribute(\"depends\", targetDependencies.joinToString(\", \"))\n// ___.__.___-src.jar\nval modelFolders = findModelFolders(sourceModule)\nfor (modelFolder in modelFolders) {\n@@ -358,7 +341,8 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n// target: assemble\nnewChild(\"target\") {\nsetAttribute(\"name\", \"assemble\")\n- setAttribute(\"depends\", sourceModules.joinToString(\", \") { \"assemble.${it.name}\" })\n+ setAttribute(\"depends\", sourceModules.map { it.owner as SourceModuleOwner }\n+ .joinToString(\", \") { getAssembleTargetName(it) })\n}\n// target: clean\n@@ -375,6 +359,17 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nreturn doc\n}\n+ private fun getAssembleTargetName(module: FoundModule): String {\n+ return if (module.moduleType == ModuleType.Generator) {\n+ \"assemble.generator.${module.name}\"\n+ } else {\n+ \"assemble.${module.name}\"\n+ }\n+ }\n+ private fun getAssembleTargetName(owner: SourceModuleOwner): String {\n+ val module = owner.modules.values.first()\n+ return \"assemble.all.${module.name}\"\n+ }\nprivate fun getJarFile(module: FoundModule): File {\nreturn if (module.moduleType == ModuleType.Generator) {\nFile(getPackagedModulesDir(), module.name + \"-generator.jar\")\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Build script generator also packages modules as jars (4) |
426,496 | 04.03.2022 21:59:01 | -3,600 | 59e6cfa738dc21d43bfb60f27e6fab1fc9bca797 | Support multiple generators | [
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -359,9 +359,16 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nreturn doc\n}\n+ private fun getGeneratorIndex(module: FoundModule): Int {\n+ return module.owner.modules.values.filter { it.moduleType == ModuleType.Generator }.indexOf(module)\n+ }\n+ private fun getGeneratorIndexPart(module: FoundModule): String {\n+ val index = getGeneratorIndex(module)\n+ return if (index == 0) \"\" else \"-$index\"\n+ }\nprivate fun getAssembleTargetName(module: FoundModule): String {\nreturn if (module.moduleType == ModuleType.Generator) {\n- \"assemble.generator.${module.name}\"\n+ \"assemble.generator${getGeneratorIndex(module)}.${module.name}\"\n} else {\n\"assemble.${module.name}\"\n}\n@@ -372,14 +379,16 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n}\nprivate fun getJarFile(module: FoundModule): File {\nreturn if (module.moduleType == ModuleType.Generator) {\n- File(getPackagedModulesDir(), getNonGeneratorModule(module).name + \"-generator.jar\")\n+ val indexPart = getGeneratorIndexPart(module)\n+ File(getPackagedModulesDir(), getNonGeneratorModule(module).name + \"$indexPart-generator.jar\")\n} else {\nFile(getPackagedModulesDir(), module.name + \".jar\")\n}\n}\nprivate fun getJarTempDir(module: FoundModule): File {\nreturn if (module.moduleType == ModuleType.Generator) {\n- File(getPackagedModulesTempDir(), module.name + \"-generator\")\n+ val indexPart = getGeneratorIndexPart(module)\n+ File(getPackagedModulesTempDir(), module.name + \"$indexPart-generator\")\n} else {\nFile(getPackagedModulesTempDir(), module.name)\n}\n@@ -400,7 +409,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nprivate fun getModelsTempDir() = File(buildDir, \"models-tmp\")\nprivate fun getModelsTempDir(module: FoundModule): File {\nreturn if (module.moduleType == ModuleType.Generator) {\n- File(getModelsTempDir(), module.name + \"-generator\")\n+ File(getModelsTempDir(), module.name + \"${getGeneratorIndexPart(module)}-generator\")\n} else {\nFile(getModelsTempDir(), module.name)\n}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Support multiple generators |
426,496 | 06.03.2022 11:56:49 | -3,600 | 4d473908f86371f080f8ce67c790a7a78feb417d | More knowledge is extracted from modules that allows computation of the correct classpath | [
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -159,12 +159,33 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nval modulesToCompile = sourceModules + generatorModules\nfor (sourceModule in modulesToCompile) {\nnewChild(\"target\") {\n- setAttribute(\"name\", \"compile.${sourceModule.name}\")\n+ setAttribute(\"name\", getCompileTargetName(sourceModule))\n+ val moduleTypeOrdinal: (FoundModule)->Int = {\n+ when (it.moduleType) {\n+ ModuleType.Solution -> 0\n+ ModuleType.Language -> 1\n+ ModuleType.Generator -> 2\n+ ModuleType.Devkit -> 3\n+ }\n+ }\nval taskDependencies = sourceModule.dependencies\n+ .asSequence()\n+ .filter { it.type == DependencyType.Classpath }\n.mapNotNull { modulesMiner.getModules().getModules()[it.id] }\n.filter { it.owner is SourceModuleOwner }\n- .joinToString(\", \") { \"compile.${it.name}\" }\n+ .plus(sourceModule.owner.modules.values.filter { it.moduleType == ModuleType.Language })\n+ .minus(sourceModule)\n+ // break cycle between language and its runtime solution\n+ .minus(sourceModule.dependencies\n+ .mapNotNull { modulesMiner.getModules().getModules()[it.id] }\n+ .filter { moduleTypeOrdinal(it) > moduleTypeOrdinal(sourceModule) }\n+ .filter { dep -> dep.dependencies.any { it.id == sourceModule.moduleId } }\n+ .toSet()\n+ )\n+ .map { getCompileTargetName(it) }\n+ .minus(getCompileTargetName(sourceModule))\n+ .joinToString(\", \")\nsetAttribute(\"depends\", taskDependencies)\nnewChild(\"mkdir\") {\n@@ -198,6 +219,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nval classPath = dependencyGraph.getNode(sourceModule.moduleId)!!\n.getTransitiveDependencies()\n.flatMap { it.modules }\n+ .plus(sourceModule.owner.modules.values.filter { it.moduleType == ModuleType.Language && it != sourceModule })\n.flatMap { getClassPath(it) }\n.map { it.canonicalFile }\n.distinct()\n@@ -219,7 +241,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n// target: compile\nnewChild(\"target\") {\n- setAttribute(\"depends\", modulesToCompile.joinToString(\", \") { \"compile.${it.name}\" })\n+ setAttribute(\"depends\", modulesToCompile.joinToString(\", \") { getCompileTargetName(it) })\nsetAttribute(\"name\", \"compile\")\n}\n@@ -235,7 +257,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nfor (sourceModule in modulesToCompile) {\nnewChild(\"target\") {\nsetAttribute(\"name\", getAssembleTargetName(sourceModule))\n- setAttribute(\"depends\", \"compile.${sourceModule.name}, create-modules-output-dir\")\n+ setAttribute(\"depends\", \"${getCompileTargetName(sourceModule)}, create-modules-output-dir\")\nnewChild(\"mkdir\") {\nsetAttribute(\"dir\", getJarTempDir(sourceModule).absolutePath)\n}\n@@ -305,6 +327,9 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nval targetDependencies = sourceModule.owner.modules.values.map { getAssembleTargetName(it) } + \"create-modules-output-dir\"\nsetAttribute(\"depends\", targetDependencies.joinToString(\", \"))\n// ___.__.___-src.jar\n+ newChild(\"mkdir\") {\n+ setAttribute(\"dir\", getModelsTempDir(sourceModule).absolutePath)\n+ }\nval modelFolders = findModelFolders(sourceModule)\nfor (modelFolder in modelFolders) {\nval modelFolderRelative = moduleFolder.relativize(modelFolder.toPath())\n@@ -366,6 +391,13 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nval index = getGeneratorIndex(module)\nreturn if (index == 0) \"\" else \"-$index\"\n}\n+ private fun getCompileTargetName(module: FoundModule): String {\n+ return if (module.moduleType == ModuleType.Generator) {\n+ \"compile.generator${getGeneratorIndex(module)}.${module.name}\"\n+ } else {\n+ \"compile.${module.name}\"\n+ }\n+ }\nprivate fun getAssembleTargetName(module: FoundModule): String {\nreturn if (module.moduleType == ModuleType.Generator) {\n\"assemble.generator${getGeneratorIndex(module)}.${module.name}\"\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/FoundModule.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/FoundModule.kt",
"diff": "*/\npackage org.modelix.buildtools\n-class FoundModule(val moduleId: ModuleId, val name: String, val owner: ModuleOwner, val moduleType: ModuleType) {\n+import org.w3c.dom.Element\n+\n+class FoundModule(val moduleId: ModuleId,\n+ var name: String,\n+ val owner: ModuleOwner,\n+ var moduleType: ModuleType) {\nval dependencies: MutableSet<ModuleDependency> = LinkedHashSet()\n+ var moduleDescriptor: Element? = null\n+ var deploymentDescriptor: Element? = null\ninit {\nowner.modules[moduleId] = this\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModuleIdAndName.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModuleIdAndName.kt",
"diff": "*/\npackage org.modelix.buildtools\n-class ModuleIdAndName(val id: ModuleId, val name: String?) {\n+data class ModuleIdAndName(val id: ModuleId, val name: String?) {\n+ companion object {\n+ fun fromReference(text: String): ModuleIdAndName {\n+ // 1ed103c3-3aa6-49b7-9c21-6765ee11f224(MPS.Editor)\n+ val matchResult = Regex(\"\"\"~?(.+)\\((.+)\\)\"\"\").matchEntire(text)\n+ if (matchResult == null) return ModuleIdAndName(ModuleId(text), null)\n+ return ModuleIdAndName(ModuleId(matchResult.groupValues[1]), matchResult.groupValues[2])\n+ }\n+\n+ fun fromLanguageRef(text: String): ModuleIdAndName {\n+ // l:f3061a53-9226-4cc5-a443-f952ceaf5816:jetbrains.mps.baseLanguage\n+ val matchResult = Regex(\"\"\"l:(.+):(.+)\"\"\").matchEntire(text)\n+ if (matchResult == null) return ModuleIdAndName(ModuleId(text), null)\n+ return ModuleIdAndName(ModuleId(matchResult.groupValues[1]), matchResult.groupValues[2])\n+ }\n+ }\n+\noverride fun toString(): String {\nreturn \"$id($name)\"\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModuleOwner.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModuleOwner.kt",
"diff": "@@ -18,6 +18,10 @@ import kotlin.io.path.pathString\nabstract class ModuleOwner(val path: ModulePath) {\nval modules: MutableMap<ModuleId, FoundModule> = LinkedHashMap()\n+ fun getOrCreateModule(id: ModuleId, name: String, type: ModuleType): FoundModule {\n+ return modules.computeIfAbsent(id) { FoundModule(id, name, this, type) }\n+ }\n+\nfun getWorkspaceRelativePath(): String {\nreturn \"\\$MODELIX_WORKSPACE\\$/\" + path.getWorkspaceRelativePath().pathString\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModulesMiner.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModulesMiner.kt",
"diff": "@@ -187,7 +187,12 @@ class ModulesMiner() {\nval typeString = if (doc.tagName == \"module\") doc.getAttribute(\"type\") else doc.tagName\nval type = typeMap[typeString]\n?: throw RuntimeException(\"Unknown module type: $typeString\")\n- val module = FoundModule(uuid, name, owner, type)\n+ val module = owner.getOrCreateModule(uuid, name, type)\n+ if (doc.tagName == \"module\") {\n+ module.deploymentDescriptor = doc\n+ } else {\n+ module.moduleDescriptor = doc\n+ }\nval modules = listOf(module) + readModule(doc, missedUUIDs, module)\nif (missedUUIDs.isNotEmpty()) {\nthrow RuntimeException(\"More dependencies found for module $name: $missedUUIDs\")\n@@ -244,7 +249,7 @@ class ModulesMiner() {\nmissedUUIDs -= idString\nval generatorId = ModuleId(idString)\nval generatorName = node.getAttribute(\"namespace\")\n- val generatorModule = FoundModule(generatorId, generatorName, module.owner, ModuleType.Generator)\n+ val generatorModule = module.owner.getOrCreateModule(generatorId, generatorName, ModuleType.Generator)\nmoduleForChildren = generatorModule\nmodules += generatorModule\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/XmlUtils.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/XmlUtils.kt",
"diff": "@@ -54,6 +54,7 @@ fun Node.children(): List<Node> {\n}\nfun Node.childElements(): List<Element> = children().filterIsInstance<Element>()\n+fun Node.childElements(tag: String): List<Element> = children().filterIsInstance<Element>().filter { it.tagName == tag }\nfun Element.newChild(tag: String, body: Element.()->Unit): Element {\nval child = ownerDocument.createElement(tag)\n@@ -62,6 +63,15 @@ fun Element.newChild(tag: String, body: Element.()->Unit): Element {\nreturn child\n}\n+fun Element.getAttribute(name: String, default: String): String {\n+ return getAttributeOrNull(name) ?: default\n+}\n+\n+fun Element.getAttributeOrNull(name: String): String? {\n+ return getAttribute(name).ifEmpty { null }\n+}\n+\n+\nfun xmlToString(doc: Document): String {\nval transformerFactory: TransformerFactory = TransformerFactory.newInstance()\nval transformer: Transformer = transformerFactory.newTransformer()\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/modulepersistence/DeploymentDescriptor.kt",
"diff": "+/*\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+/*\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.modelix.buildtools.modulepersistence\n+\n+import org.modelix.buildtools.ModuleId\n+import org.modelix.buildtools.ModuleIdAndName\n+import org.modelix.buildtools.ModuleType\n+import org.modelix.buildtools.childElements\n+import org.w3c.dom.Element\n+import java.nio.file.Path\n+\n+class DeploymentDescriptor(val xml: Element, val modulePath: Path) {\n+ val id: ModuleId\n+ val name: String\n+ val type: ModuleType\n+ val dependencies: List<Dependency>\n+ val usedLanguages: List<ModuleIdAndName>\n+ val classpath: List<String>\n+ val sourcesJarName: String\n+ val descriptorFileName: String\n+\n+ init {\n+ val idString = xml.getAttribute(\"uuid\")\n+ require(idString.isNotEmpty()) { \"uuid missing\" }\n+ id = ModuleId(idString)\n+ name = xml.getAttribute(\"namespace\")\n+ type = when (val typeString = xml.getAttribute(\"type\")) {\n+ \"solution\" -> ModuleType.Solution\n+ \"language\" -> ModuleType.Language\n+ \"generator\" -> ModuleType.Generator\n+ \"devkit\" -> ModuleType.Devkit\n+ else -> throw RuntimeException(\"Unknown module type: $typeString\")\n+ }\n+ dependencies = xml.childElements(\"dependencies\").flatMap { it.childElements(\"module\") }\n+ .map { Dependency(it) }\n+ usedLanguages = xml.childElements(\"uses\").flatMap { it.childElements(\"language\") }\n+ .map { ModuleIdAndName.fromLanguageRef(it.getAttribute(\"id\")) }\n+ classpath = xml.childElements(\"classpath\").flatMap { it.childElements(\"entry\") }\n+ .map { it.getAttribute(\"path\") }\n+ val sources = xml.childElements(\"sources\").first()\n+ sourcesJarName = sources.getAttribute(\"jar\")\n+ descriptorFileName = sources.getAttribute(\"descriptor\")\n+ }\n+\n+ fun resolveSourcesJar(): Path {\n+ return if (sourcesJarName == \".\") {\n+ modulePath\n+ } else {\n+ modulePath.parent.resolve(sourcesJarName)\n+ }\n+ }\n+\n+ inner class Dependency(xml: Element) {\n+ val idAndName: ModuleIdAndName\n+ val scope: SDependencyScope\n+ init {\n+ idAndName = ModuleIdAndName.fromReference(xml.getAttribute(\"ref\"))\n+ scope = SDependencyScope.fromIdentity(xml.getAttribute(\"kind\")) ?: SDependencyScope.RUNTIME\n+ }\n+ }\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/modulepersistence/DevkitDescriptor.kt",
"diff": "+/*\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.modelix.buildtools.modulepersistence\n+\n+import org.modelix.buildtools.ModuleIdAndName\n+import org.modelix.buildtools.childElements\n+import org.modelix.buildtools.findTag\n+import org.modelix.buildtools.getAttributeOrNull\n+import org.w3c.dom.Element\n+\n+class DevkitDescriptor(xml: Element): ModuleDescriptor(xml) {\n+ val exportedLanguages: List<ModuleIdAndName>\n+ val exportedSolutions: List<ModuleIdAndName>\n+ val extendedDevkits: List<ModuleIdAndName>\n+ private val generationPlanModel: String?\n+\n+ init {\n+ exportedLanguages = xml.childElements(\"exported-language\")\n+ .map { ModuleIdAndName.fromReference(it.getAttribute(\"name\")) }\n+ exportedSolutions = xml.childElements(\"exported-solutions\")\n+ .flatMap { it.childElements(\"exported-solution\") }\n+ .map { ModuleIdAndName.fromReference(it.textContent) }\n+ extendedDevkits = xml.childElements(\"extendedDevKits\")\n+ .flatMap { it.childElements(\"extendedDevKit\") }\n+ .map { ModuleIdAndName.fromReference(it.textContent) }\n+ generationPlanModel = xml.findTag(\"generation-plan\")?.getAttributeOrNull(\"model\")\n+ }\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/modulepersistence/GeneratorDescriptor.kt",
"diff": "+/*\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+/*\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.modelix.buildtools.modulepersistence\n+\n+import org.modelix.buildtools.ModuleIdAndName\n+import org.modelix.buildtools.childElements\n+import org.modelix.buildtools.getAttribute\n+import org.modelix.buildtools.getAttributeOrNull\n+import org.w3c.dom.Element\n+\n+class GeneratorDescriptor(xml: Element, val languageDescriptor: LanguageDescriptor?) : ModuleDescriptor(xml) {\n+ val generateTemplates: Boolean\n+ val alias: String?\n+ val sourceLanguage: ModuleIdAndName?\n+ val dependsOnGenerators: List<ModuleIdAndName>\n+ val mappingPriorities: List<Element>\n+\n+ init {\n+ generateTemplates = xml.getAttribute(\"generate-templates\", \"false\").toBoolean()\n+ alias = xml.getAttributeOrNull(\"alias\")\n+ sourceLanguage = xml.childElements(\"source-language\")\n+ .map { ModuleIdAndName.fromReference(it.getAttribute(\"module\")) }\n+ .firstOrNull()\n+ dependsOnGenerators = xml.childElements(\"external-templates\")\n+ .flatMap { it.childElements(\"generator\") }\n+ .map { ModuleIdAndName.fromReference(it.getAttribute(\"generatorUID\")) }\n+ mappingPriorities = xml.childElements(\"mapping-priorities\")\n+ .flatMap { it.childElements(\"mapping-priority-rule\") }\n+ }\n+\n+ override fun getDefaultGeneratorOutputPath() = \"generator/source_gen\"\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/modulepersistence/LanguageDescriptor.kt",
"diff": "+/*\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+/*\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.modelix.buildtools.modulepersistence\n+\n+import org.modelix.buildtools.ModuleIdAndName\n+import org.modelix.buildtools.childElements\n+import org.w3c.dom.Element\n+\n+class LanguageDescriptor(xml: Element) : ModuleDescriptor(xml) {\n+ val languageVersion: Int\n+ val extendedLanguages: Set<ModuleIdAndName>\n+ private val accessoryModels: List<String>\n+ val generators: List<GeneratorDescriptor>\n+\n+ init {\n+ // see LanguageDescriptorPersistence in MPS\n+ languageVersion = xml.getAttribute(\"languageVersion\").toIntOrNull()\n+ ?: xml.getAttribute(\"version\").toIntOrNull()\n+ ?: 0\n+\n+ extendedLanguages = xml.childElements(\"extendedLanguages\")\n+ .flatMap { it.childElements(\"extendedLanguage\") }\n+ .map { ModuleIdAndName.fromReference(it.textContent) }\n+ .toSet()\n+\n+ // TODO deserialize model reference\n+ accessoryModels = (xml.childElements(\"accessoryModels\") + xml.childElements(\"library\"))\n+ .flatMap { it.childElements(\"model\") }\n+ .map { it.getAttribute(\"modelUID\") }\n+\n+ generators = xml.childElements(\"generators\").flatMap { it.childElements(\"generator\") }\n+ .map { GeneratorDescriptor(it, this) }\n+\n+ }\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/modulepersistence/ModuleDescriptor.kt",
"diff": "+/*\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.modelix.buildtools.modulepersistence\n+\n+import org.modelix.buildtools.ModuleId\n+import org.modelix.buildtools.ModuleIdAndName\n+import org.modelix.buildtools.childElements\n+import org.modelix.buildtools.getAttribute\n+import org.w3c.dom.Element\n+import java.nio.file.Path\n+\n+abstract class ModuleDescriptor(val xml: Element) {\n+ val id: ModuleId\n+ val name: String\n+ val moduleVersion: Int\n+ val generatorOutputPath: Path\n+ val moduleDependencies: List<ModuleDependency>\n+ val languageVersions: List<LanguageVersion>\n+ val dependencyVersions: List<DependencyVersion>\n+ val runtime: List<ModuleDependency>\n+ private val modelRoots: List<Element>\n+ private val facets: List<Element>\n+\n+ init {\n+ // see ModuleDescriptorPersistence in MPS\n+ val idString = xml.getAttribute(\"uuid\")\n+ require(idString.isNotEmpty()) { \"uuid missing\" }\n+ id = ModuleId(idString)\n+ name = xml.getAttribute(\"namespace\")\n+ moduleVersion = xml.getAttribute(\"moduleVersion\").toIntOrNull() ?: 0\n+ generatorOutputPath = Path.of(xml.getAttribute(\"generatorOutputPath\", getDefaultGeneratorOutputPath()))\n+ moduleDependencies = xml.childElements(\"dependencies\").flatMap { it.childElements(\"dependency\") }\n+ .map { ModuleDependency(it) }\n+ runtime = xml.childElements(\"runtime\").flatMap { it.childElements(\"dependency\") }\n+ .map { ModuleDependency(it) }\n+ languageVersions = xml.childElements(\"languageVersions\").flatMap { it.childElements(\"languageVersion\") }\n+ .map { LanguageVersion(it) }\n+ dependencyVersions = xml.childElements(\"dependencyVersions\").flatMap { it.childElements(\"module\") }\n+ .map { DependencyVersion(it) }\n+ modelRoots = xml.childElements(\"models\").flatMap { it.childElements(\"modelRoot\") }\n+ facets = xml.childElements(\"facets\").flatMap { it.childElements(\"facet\") }\n+ }\n+\n+ protected open fun getDefaultGeneratorOutputPath(): String = \"source_gen\"\n+\n+ inner class ModuleDependency(val xml: Element) {\n+ val idAndName: ModuleIdAndName\n+ val reexport: Boolean\n+ val scope: SDependencyScope?\n+ init {\n+ idAndName = ModuleIdAndName.fromReference(xml.textContent)\n+ reexport = xml.getAttribute(\"reexport\", \"true\").toBoolean()\n+ scope = SDependencyScope.fromIdentity(xml.getAttribute(\"scope\")) ?: SDependencyScope.DEFAULT\n+ }\n+ }\n+\n+ inner class LanguageVersion(val xml: Element) {\n+ val idAndName: ModuleIdAndName = ModuleIdAndName.fromLanguageRef(xml.getAttribute(\"slang\"))\n+ val version: Int = xml.getAttribute(\"version\").toInt()\n+ }\n+\n+ inner class DependencyVersion(val xml: Element) {\n+ val idAndName: ModuleIdAndName = ModuleIdAndName.fromReference(xml.getAttribute(\"reference\"))\n+ val version: Int = xml.getAttribute(\"version\").toInt()\n+ }\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/modulepersistence/SDependencyScope.kt",
"diff": "+/*\n+ * Copyright 2003-2014 JetBrains s.r.o.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.modelix.buildtools.modulepersistence\n+\n+/**\n+ * There are several types of dependencies between two modules.\n+ *\n+ * * DEFAULT - the dependency is resolved and is available on the classpath during the code generation, compilation and run phases\n+ * * DESIGN - the dependency between models that has effect only during editing and is removed during generation\n+ * * COMPILE - the dependency is resolved and is available on the classpath during the compilation and run phases\n+ * * RUNTIME - the dependency is only required when running the application, and should not be available on the classpath during compilation\n+ * * PROVIDED - the dependency is resolved and is available on the classpath during code generation and compilation, but is not included on the classpath at runtime.\n+ * This dependency scope is useful, when you have some container that provides the dependency at runtime.\n+ * * EXTENDS - the dependency between two languages that further enhances the DEFAULT dependency by allowing language extension\n+ * * GENERATES_INTO - the dependency between languages that indicates that he source language will be generated into the target language and thus the generated code needs the dependencies of the target language.\n+ *\n+ */\n+enum class SDependencyScope(private val myIdentity: String, private val myPresentation: String) {\n+ /* all types of modules */\n+ DEFAULT(\"regular\", \"Default\"),\n+\n+ /**\n+ * DESIGN dependency between generators indicates there's no run-time bound between the two.\n+ * Unlike DEFAULT and EXTENDS, which require target generator to be available at generation time,\n+ * DESIGN dependency serves primarily the purpose to declare priorities between generator without actually\n+ * enforcing inclusion of all dependant generators into generation process.\n+ */\n+ DESIGN(\"design\", \"Design\"), COMPILE(\"compile\", \"Compile\"), RUNTIME(\"rt\", \"Runtime\"), PROVIDED(\"external\", \"Provided\"), /* only between language modules */\n+\n+ /**\n+ * Applicable between either two language or two generator modules\n+ */\n+ EXTENDS(\"extend\", \"Extends\"),\n+\n+ /**\n+ * GENERATES_INTO indicates target languages this language's generators produce.\n+ * Effectively this mandates use of run-time dependencies of these target languages when models use dependant language.\n+ *\n+ * Applicable between two language modules only. HOWEVER, we shall consider to have this dependency for generator, either\n+ * as user-controlled way to state which languages generator uses for templates, or as a derived value based on generator's own\n+ * description of target languages. We need to state these languages anyway (instead of present approach to calculate them with TemplateModelScanner)\n+ * and we might collect these in addition to generator source language's GENERATES_INTO dependencies.\n+ * Note, present approach would change once generators are separate from the language, and multiple generators are possible - provided\n+ * each generator may target different languages, would be stupid to specify complete set of dependant runtimes with the source language.\n+ *\n+ * Given L1 and L2, with L1 GENERATES_INTO L2, L2 with run-time solution S2, and model M1 using L1, the dependency tells to include S2 of L2\n+ * as a runtime dependency for M1 outcome.\n+ */\n+ GENERATES_INTO(\"generate-into\", \"Generation Target\");\n+\n+ override fun toString(): String {\n+ return myPresentation\n+ }\n+\n+ /**\n+ * scope to string\n+ * @return identity one may use to persist the [scope][.fromIdentity]\n+ */\n+ fun identify(): String {\n+ return myIdentity\n+ }\n+\n+ companion object {\n+ /**\n+ * string to scope\n+ * @param identity value obtained from [.identify]\n+ * @return scope instance with specified identity\n+ */\n+ fun fromIdentity(identity: String?): SDependencyScope? {\n+ for (sd in values()) {\n+ if (sd.myIdentity == identity) {\n+ return sd\n+ }\n+ }\n+ return null\n+ }\n+ }\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/modulepersistence/SolutionDescriptor.kt",
"diff": "+/*\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.modelix.buildtools.modulepersistence\n+\n+import org.modelix.buildtools.findTag\n+import org.modelix.buildtools.getAttribute\n+import org.modelix.buildtools.getAttributeOrNull\n+import org.w3c.dom.Element\n+\n+class SolutionDescriptor(xml: Element): ModuleDescriptor(xml) {\n+ val pluginKind: SolutionKind?\n+ val compileInMps: Boolean\n+ val compileInIdea: Boolean\n+ val readOnlyStubs: Boolean\n+\n+ init {\n+ pluginKind = xml.getAttributeOrNull(\"pluginKind\")?.let { SolutionKind.valueOf(it) }\n+ compileInMps = xml.getAttribute(\"compileInMPS\", \"false\").toBoolean()\n+ compileInIdea = xml.findTag(\"compileInIDEA\") != null\n+ readOnlyStubs = xml.findTag(\"readOnlyStubs\") != null\n+\n+ }\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/modulepersistence/SolutionKind.kt",
"diff": "+/*\n+ * Copyright 2003-2011 JetBrains s.r.o.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.modelix.buildtools.modulepersistence\n+\n+/**\n+ * It was a temporary way to mark solution as a plugin (at that time: 10/25/11)\n+ * One can specify a solution kind in the properties dialog of MPS.\n+ * The SolutionKind establishes the place of the solution in the\n+ * MPS modules' hierarchy (Core - Editor - Workbench)\n+ * TODO: review the usages again\n+ */\n+enum class SolutionKind(private val myPresentation: String) {\n+ NONE(\"None\"),\n+ PLUGIN_CORE(\"Core plugin\"),\n+ PLUGIN_EDITOR(\"Editor plugin\"),\n+ PLUGIN_OTHER(\"Other\");\n+\n+ override fun toString(): String {\n+ return myPresentation\n+ }\n+}\n\\ No newline at end of file\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | More knowledge is extracted from modules that allows computation of the correct classpath |
426,496 | 06.03.2022 19:52:31 | -3,600 | ff7ac39e9cf499613351701c0d6e1f9c03f22739 | DependencyGraph is now reusable for the compile dependencies
It was specific to generator depenencies, but we also have to handle
cycles when running the java compiler. | [
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -499,7 +499,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n}\n}\n- private fun generatePlan(modulesToGenerate: List<ModuleId>): Pair<GenerationPlan, DependencyGraph> {\n+ private fun generatePlan(modulesToGenerate: List<ModuleId>): Pair<GenerationPlan, GeneratorDependencyGraph> {\nval planBuilder = GenerationPlanBuilder(modulesMiner.getModules(), ignoredModules)\nval dependencyGraph = planBuilder.build(modulesToGenerate.mapNotNull { modulesMiner.getModules().getModules()[it] })\nreturn planBuilder.plan to dependencyGraph\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/DependencyGraph.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/DependencyGraph.kt",
"diff": "*/\npackage org.modelix.buildtools\n-class DependencyGraph(val moduleResolver: ModuleResolver) {\n+abstract class DependencyGraph<ElementT, KeyT> {\n- private val module2node: MutableMap<ModuleId, DependencyNode> = HashMap()\n+ private val module2node: MutableMap<KeyT, DependencyNode> = HashMap()\n+\n+ abstract fun getKey(element: ElementT): KeyT\n+ abstract fun getDependencies(element: ElementT): Iterable<ElementT>\nfun getRoots() = module2node.values.filter { it.isRoot() }\n- fun getNode(moduleId: ModuleId) = module2node[moduleId]\n+ fun getNode(moduleId: KeyT) = module2node[moduleId]\n- fun load(modules: Iterable<FoundModule>) {\n+ fun load(modules: Iterable<ElementT>) {\nmodules.forEach { load(it) }\npostprocess()\n}\n- private fun load(module: FoundModule): DependencyNode {\n- var node = module2node[module.moduleId]\n+ private fun load(module: ElementT): DependencyNode {\n+ var node = module2node[getKey(module)]\nif (node != null) return node\nnode = DependencyNode()\nnode.modules += module\n- module2node[module.moduleId] = node\n+ module2node[getKey(module)] = node\n- for (dependency in module.getGenerationDependencies(moduleResolver)) {\n- val dependencyModule = moduleResolver.resolveModule(dependency, module)\n- if (dependencyModule != null) {\n- node.addDependency(load(dependencyModule))\n- }\n+ for (dependency in getDependencies(module)) {\n+ node.addDependency(load(dependency))\n}\nreturn node\n}\n- private fun postprocess() {\n- mergeGeneratorsAndLanguages()\n+ protected open fun postprocess() {\nmergeCycles()\n}\n- private fun mergeGeneratorsAndLanguages() {\n- val moduleOwners = moduleResolver.availableModules.getModules().values.map { it.owner }.filterIsInstance<SourceModuleOwner>().filter { it.modules.size > 1 }\n- for (moduleOwner in moduleOwners) {\n- val nodesToMerge = moduleOwner.modules.keys.mapNotNull { module2node[it] }.distinct()\n- if (nodesToMerge.size < 2) continue\n- for (source in nodesToMerge.drop(1)) {\n- mergeNodes(source, nodesToMerge.first())\n- }\n- }\n- }\n+ protected open fun cycleBeforeMerge(cycle: Set<DependencyNode>) {}\n- private fun mergeCycles() {\n+ fun mergeCycles() {\nval cycleFinder = CycleFinder()\nmodule2node.values.forEach { cycleFinder.process(it) }\nfor (cycle in cycleFinder.cycles) {\n- val modules = cycle.flatMap { it.modules }\n- .filter { it.moduleType == ModuleType.Language || it.moduleType == ModuleType.Solution }\n- if (!modules.any { it.owner is SourceModuleOwner }) continue\n- if (modules.size > 1) {\n- println(\"Dependency cycle: \" + modules.joinToString(\" -> \") { it.name })\n- }\n+ cycleBeforeMerge(cycle)\n}\nfor (cycle in cycleFinder.cycles) {\n@@ -82,13 +67,13 @@ class DependencyGraph(val moduleResolver: ModuleResolver) {\n}\n}\n- private fun mergeNodes(source: DependencyNode, target: DependencyNode) {\n+ protected fun mergeNodes(source: DependencyNode, target: DependencyNode) {\nif (source == target) {\nthrow RuntimeException(\"Attempt to merge a node into itself\")\n}\nsource.mergedInto = target\nfor (sourceModule in source.modules) {\n- module2node[sourceModule.moduleId] = target\n+ module2node[getKey(sourceModule)] = target\n}\ntarget.modules += source.modules\nsource.modules.clear()\n@@ -106,7 +91,7 @@ class DependencyGraph(val moduleResolver: ModuleResolver) {\ninner class DependencyNode {\n- val modules: MutableSet<FoundModule> = HashSet()\n+ val modules: MutableSet<ElementT> = HashSet()\nprivate val dependencies: MutableSet<DependencyNode> = HashSet()\nprivate val reverseDependencies: MutableSet<DependencyNode> = HashSet()\nvar mergedInto: DependencyNode? = null\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/GenerationPlanBuilder.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/GenerationPlanBuilder.kt",
"diff": "@@ -17,17 +17,17 @@ import kotlin.math.max\nclass GenerationPlanBuilder(val availableModules: FoundModules, val ignoredModules: Set<ModuleId>) {\nval plan: GenerationPlan = GenerationPlan()\n- private val processedNodes: MutableSet<DependencyGraph.DependencyNode> = HashSet()\n- private val chunkIndexes: MutableMap<DependencyGraph.DependencyNode, Int> = HashMap()\n+ private val processedNodes: MutableSet<DependencyGraph<FoundModule, ModuleId>.DependencyNode> = HashSet()\n+ private val chunkIndexes: MutableMap<DependencyGraph<FoundModule, ModuleId>.DependencyNode, Int> = HashMap()\n- fun build(modules: Iterable<FoundModule>): DependencyGraph {\n- val dependencyGraph = DependencyGraph(ModuleResolver(availableModules, ignoredModules))\n+ fun build(modules: Iterable<FoundModule>): GeneratorDependencyGraph {\n+ val dependencyGraph = GeneratorDependencyGraph(ModuleResolver(availableModules, ignoredModules))\ndependencyGraph.load(modules)\ndependencyGraph.getRoots().forEach { build(it) }\nreturn dependencyGraph\n}\n- private fun build(node: DependencyGraph.DependencyNode) {\n+ private fun build(node: DependencyGraph<FoundModule, ModuleId>.DependencyNode) {\nif (processedNodes.contains(node)) return\nprocessedNodes += node\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/GeneratorDependencyGraph.kt",
"diff": "+/*\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.modelix.buildtools\n+\n+class GeneratorDependencyGraph(val moduleResolver: ModuleResolver) : DependencyGraph<FoundModule, ModuleId>() {\n+ override fun getKey(element: FoundModule): ModuleId {\n+ return element.moduleId\n+ }\n+\n+ override fun getDependencies(element: FoundModule): Iterable<FoundModule> {\n+ return element.getGenerationDependencies(moduleResolver)\n+ .mapNotNull { moduleResolver.resolveModule(it, element) }\n+ }\n+\n+ fun mergeGeneratorsAndLanguages() {\n+ val moduleOwners = moduleResolver.availableModules.getModules().values.map { it.owner }\n+ .filterIsInstance<SourceModuleOwner>().filter { it.modules.size > 1 }\n+ for (moduleOwner in moduleOwners) {\n+ val nodesToMerge = moduleOwner.modules.keys.mapNotNull { getNode(it) }.distinct()\n+ if (nodesToMerge.size < 2) continue\n+ for (source in nodesToMerge.drop(1)) {\n+ mergeNodes(source, nodesToMerge.first())\n+ }\n+ }\n+ }\n+\n+ override fun postprocess() {\n+ mergeGeneratorsAndLanguages()\n+ super.postprocess()\n+ }\n+\n+ override fun cycleBeforeMerge(cycle: Set<DependencyNode>) {\n+ val modules = cycle.flatMap { it.modules }\n+ .filter { it.moduleType == ModuleType.Language || it.moduleType == ModuleType.Solution }\n+ if (!modules.any { it.owner is SourceModuleOwner }) return\n+ if (modules.size > 1) {\n+ println(\"Dependency cycle: \" + modules.joinToString(\" -> \") { it.name })\n+ }\n+ }\n+}\n\\ No newline at end of file\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | DependencyGraph is now reusable for the compile dependencies
It was specific to generator depenencies, but we also have to handle
cycles when running the java compiler. |
426,496 | 06.03.2022 21:07:17 | -3,600 | 278fe07d2a126e63af7c71034be5704f3fc01f28 | Compile dependency cycles are now handled | [
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -15,6 +15,7 @@ package org.modelix.buildtools\nimport org.modelix.headlessmps.ProcessExecutor\nimport org.w3c.dom.Document\n+import org.w3c.dom.Element\nimport java.io.File\nimport java.nio.file.Path\nimport javax.xml.parsers.DocumentBuilderFactory\n@@ -53,6 +54,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n.map { it.moduleId }\n.toList()\nval (plan, dependencyGraph) = generatePlan(modulesToGenerate_ - ignoredModules.toSet())\n+ val resolver = ModuleResolver(modulesMiner.getModules(), ignoredModules)\nval dbf = DocumentBuilderFactory.newInstance()\nval db = dbf.newDocumentBuilder()\n@@ -62,13 +64,11 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\ndoc.appendChild(this)\nsetAttribute(\"default\", \"generate\")\n- val mpsHome = modulesMiner.getModules().mpsHome\n- if (mpsHome != null) {\n+ val mpsHome = modulesMiner.getModules().mpsHome ?: throw RuntimeException(\"mps.home not found\")\nnewChild(\"property\") {\nsetAttribute(\"name\", \"mps.home\")\nsetAttribute(\"location\", mpsHome.canonicalPath)\n}\n- }\nnewChild(\"property\") {\nsetAttribute(\"name\", \"mps_home\")\nsetAttribute(\"location\", \"\\${mps.home}\")\n@@ -157,83 +157,46 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nval sourceModules = plan.chunks.flatMap { it.modules }.filter { it.owner is SourceModuleOwner }\nval generatorModules = sourceModules.flatMap { it.owner.modules.values - it }\nval modulesToCompile = sourceModules + generatorModules\n- for (sourceModule in modulesToCompile) {\n- newChild(\"target\") {\n- setAttribute(\"name\", getCompileTargetName(sourceModule))\n-\n- val moduleTypeOrdinal: (FoundModule)->Int = {\n- when (it.moduleType) {\n- ModuleType.Solution -> 0\n- ModuleType.Language -> 1\n- ModuleType.Generator -> 2\n- ModuleType.Devkit -> 3\n- }\n- }\n- val taskDependencies = sourceModule\n- .getClassPathDependencies(ModuleResolver(modulesMiner.getModules(), ignoredModules))\n- .asSequence()\n- .filter { it.owner is SourceModuleOwner }\n- .minus(sourceModule)\n- // break cycle between language and its runtime solution\n-// .minus(sourceModule.dependencies\n-// .mapNotNull { modulesMiner.getModules().getModules()[it.id] }\n-// .filter { moduleTypeOrdinal(it) > moduleTypeOrdinal(sourceModule) }\n-// .filter { dep -> dep.dependencies.any { it.id == sourceModule.moduleId } }\n-// .toSet()\n-// )\n- .map { getCompileTargetName(it) }\n- .minus(getCompileTargetName(sourceModule))\n- .joinToString(\", \")\n- setAttribute(\"depends\", taskDependencies)\n-\n- newChild(\"mkdir\") {\n- setAttribute(\"dir\", getCompileOutputDir(sourceModule).absolutePath)\n- }\n- newChild(\"javac\") {\n- setAttribute(\"destdir\", getCompileOutputDir(sourceModule).absolutePath)\n- setAttribute(\"fork\", \"false\")\n- setAttribute(\"encoding\", \"utf8\")\n- setAttribute(\"includeantruntime\", \"false\")\n- setAttribute(\"debug\", \"true\")\n- setAttribute(\"source\", \"11\")\n- setAttribute(\"target\", \"11\")\n- newChild(\"compilerarg\") {\n- setAttribute(\"value\", \"-Xlint:none\")\n- }\n- newChild(\"src\") {\n- newChild(\"path\") {\n- setAttribute(\"location\", getSourceGenDir(sourceModule).absolutePath)\n- }\n- }\n- newChild(\"classpath\") {\n- if (mpsHome != null) {\n- for (jar in File(mpsHome, \"lib\").walk().filter { it.extension == \"jar\" }) {\n- newChild(\"fileset\") {\n- setAttribute(\"file\", jar.absolutePath)\n- }\n- }\n- }\n-\n- val classPath = dependencyGraph.getNode(sourceModule.moduleId)!!\n- .getTransitiveDependencies()\n- .flatMap { it.modules }\n- .plus(sourceModule.owner.modules.values.filter { it.moduleType == ModuleType.Language && it != sourceModule })\n- .flatMap { getClassPath(it) }\n- .map { it.canonicalFile }\n- .distinct()\n- for (cpItem in classPath) {\n- if (cpItem.isFile) {\n- newChild(\"fileset\") {\n- setAttribute(\"file\", cpItem.absolutePath)\n- }\n+ val compileDependencyGraph = CompileDependencyGraph(resolver)\n+ compileDependencyGraph.load(modulesToCompile)\n+ var cycleIdSequence = 0\n+ val cycles = compileDependencyGraph.getNodes().filter { it.modules.any { it.owner is SourceModuleOwner } }\n+ val compileTargetNames = cycles.associateWith {\n+ if (it.modules.size == 1) {\n+ getCompileTargetName(it.modules.first())\n} else {\n- newChild(\"pathelement\") {\n- setAttribute(\"path\", cpItem.absolutePath)\n- }\n- }\n- }\n- }\n+ \"compile.cycle.${++cycleIdSequence}\"\n+ }\n+ }\n+ for (cycle in cycles) {\n+ val sourceModules = cycle.modules.filter { it.owner is SourceModuleOwner }\n+ var cycleOutputDir: File? = null\n+ val isCycle = cycle.modules.size > 1\n+ if (isCycle) {\n+ cycleOutputDir = File(getCompileOutputDir(), compileTargetNames[cycle]!!)\n+ createCompileTarget(\n+ modules = sourceModules,\n+ classPath = cycle.getTransitiveDependencies().flatMap { it.modules }.distinct().flatMap { getClassPath(it) },\n+ targetName = compileTargetNames[cycle]!!,\n+ targetDependencies = cycle.getDependencies().mapNotNull { compileTargetNames[it] },\n+ outputDir = cycleOutputDir,\n+ mpsHome = mpsHome\n+ )\n}\n+\n+ for (module in sourceModules) {\n+ var cp = cycle.getTransitiveDependencies().flatMap { it.modules }.distinct().flatMap { getClassPath(it) }\n+ if (cycleOutputDir != null) cp += cycleOutputDir\n+ var targetDependencies = cycle.getDependencies().mapNotNull { compileTargetNames[it] }\n+ if (isCycle) targetDependencies += compileTargetNames[cycle]!!\n+ createCompileTarget(\n+ modules = listOf(module),\n+ classPath = cp,\n+ targetName = getCompileTargetName(module),\n+ targetDependencies = targetDependencies,\n+ outputDir = getCompileOutputDir(module),\n+ mpsHome = mpsHome\n+ )\n}\n}\n@@ -382,6 +345,62 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nreturn doc\n}\n+ private fun Element.createCompileTarget(\n+ modules: List<FoundModule>,\n+ classPath: List<File>,\n+ targetName: String,\n+ targetDependencies: List<String>,\n+ outputDir: File,\n+ mpsHome: File,\n+ ) {\n+ newChild(\"target\") {\n+ setAttribute(\"name\", targetName)\n+ setAttribute(\"depends\", targetDependencies.joinToString(\", \"))\n+\n+ newChild(\"mkdir\") {\n+ setAttribute(\"dir\", outputDir.absolutePath)\n+ }\n+ newChild(\"javac\") {\n+ setAttribute(\"destdir\", outputDir.absolutePath)\n+ setAttribute(\"fork\", \"false\")\n+ setAttribute(\"encoding\", \"utf8\")\n+ setAttribute(\"includeantruntime\", \"false\")\n+ setAttribute(\"debug\", \"true\")\n+ setAttribute(\"source\", \"11\")\n+ setAttribute(\"target\", \"11\")\n+ newChild(\"compilerarg\") {\n+ setAttribute(\"value\", \"-Xlint:none\")\n+ }\n+ for (module in modules) {\n+ newChild(\"src\") {\n+ newChild(\"path\") {\n+ setAttribute(\"location\", getSourceGenDir(module).absolutePath)\n+ }\n+ }\n+ }\n+ newChild(\"classpath\") {\n+ for (jar in File(mpsHome, \"lib\").walk().filter { it.extension == \"jar\" }) {\n+ newChild(\"fileset\") {\n+ setAttribute(\"file\", jar.absolutePath)\n+ }\n+ }\n+\n+ for (cpItem in classPath.map { it.canonicalFile }.distinct()) {\n+ if (cpItem.isFile) {\n+ newChild(\"fileset\") {\n+ setAttribute(\"file\", cpItem.absolutePath)\n+ }\n+ } else {\n+ newChild(\"pathelement\") {\n+ setAttribute(\"path\", cpItem.absolutePath)\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+\nprivate fun getGeneratorIndex(module: FoundModule): Int {\nreturn module.owner.modules.values.filter { it.moduleType == ModuleType.Generator }.indexOf(module)\n}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/CompileDependencyGraph.kt",
"diff": "+/*\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.modelix.buildtools\n+\n+class CompileDependencyGraph(val resolver: ModuleResolver) : DependencyGraph<FoundModule, ModuleId>() {\n+ override fun getKey(element: FoundModule): ModuleId {\n+ return element.moduleId\n+ }\n+\n+ override fun getDependencies(element: FoundModule): Iterable<FoundModule> {\n+ return element.getClassPathDependencies(resolver)\n+ }\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/DependencyGraph.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/DependencyGraph.kt",
"diff": "@@ -24,6 +24,8 @@ abstract class DependencyGraph<ElementT, KeyT> {\nfun getNode(moduleId: KeyT) = module2node[moduleId]\n+ fun getNodes(): Set<DependencyNode> = module2node.values.map { it.getMergedNode() }.toSet()\n+\nfun load(modules: Iterable<ElementT>) {\nmodules.forEach { load(it) }\npostprocess()\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Compile dependency cycles are now handled |
426,496 | 07.03.2022 10:10:52 | -3,600 | 9b98fce8b21abeb543dcc179499075105a00871e | Compiling MPS-extensions was successful | [
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -17,7 +17,6 @@ import org.modelix.headlessmps.ProcessExecutor\nimport org.w3c.dom.Document\nimport org.w3c.dom.Element\nimport java.io.File\n-import java.nio.file.Path\nimport javax.xml.parsers.DocumentBuilderFactory\nimport kotlin.io.path.pathString\n@@ -55,6 +54,11 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n.toList()\nval (plan, dependencyGraph) = generatePlan(modulesToGenerate_ - ignoredModules.toSet())\nval resolver = ModuleResolver(modulesMiner.getModules(), ignoredModules)\n+ val mpsHome = modulesMiner.getModules().mpsHome ?: throw RuntimeException(\"mps.home not found\")\n+ val macros = mapOf(\n+ \"platform_lib\" to File(mpsHome, \"lib\"),\n+ \"mps_home\" to mpsHome\n+ )\nval dbf = DocumentBuilderFactory.newInstance()\nval db = dbf.newDocumentBuilder()\n@@ -64,7 +68,6 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\ndoc.appendChild(this)\nsetAttribute(\"default\", \"generate\")\n- val mpsHome = modulesMiner.getModules().mpsHome ?: throw RuntimeException(\"mps.home not found\")\nnewChild(\"property\") {\nsetAttribute(\"name\", \"mps.home\")\nsetAttribute(\"location\", mpsHome.canonicalPath)\n@@ -176,7 +179,8 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\ncycleOutputDir = File(getCompileOutputDir(), compileTargetNames[cycle]!!)\ncreateCompileTarget(\nmodules = sourceModules,\n- classPath = cycle.getTransitiveDependencies().flatMap { it.modules }.distinct().flatMap { getClassPath(it) },\n+ classPath = cycle.getTransitiveDependencies().flatMap { it.modules }.distinct()\n+ .flatMap { getClassPath(it, macros) } + sourceModules.flatMap { it.getOwnJars(macros) },\ntargetName = compileTargetNames[cycle]!!,\ntargetDependencies = cycle.getDependencies().mapNotNull { compileTargetNames[it] },\noutputDir = cycleOutputDir,\n@@ -185,14 +189,16 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n}\nfor (module in sourceModules) {\n- var cp = cycle.getTransitiveDependencies().flatMap { it.modules }.distinct().flatMap { getClassPath(it) }\n+ val targetName = getCompileTargetName(module)\n+ var cp = cycle.getTransitiveDependencies().flatMap { it.modules }.distinct()\n+ .flatMap { getClassPath(it, macros) } + module.getOwnJars(macros)\nif (cycleOutputDir != null) cp += cycleOutputDir\nvar targetDependencies = cycle.getDependencies().mapNotNull { compileTargetNames[it] }\nif (isCycle) targetDependencies += compileTargetNames[cycle]!!\ncreateCompileTarget(\nmodules = listOf(module),\nclassPath = cp,\n- targetName = getCompileTargetName(module),\n+ targetName = targetName,\ntargetDependencies = targetDependencies,\noutputDir = getCompileOutputDir(module),\nmpsHome = mpsHome\n@@ -360,6 +366,11 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nnewChild(\"mkdir\") {\nsetAttribute(\"dir\", outputDir.absolutePath)\n}\n+ for (module in modules) {\n+ newChild(\"mkdir\") {\n+ setAttribute(\"dir\", getSourceGenDir(module).absolutePath)\n+ }\n+ }\nnewChild(\"javac\") {\nsetAttribute(\"destdir\", outputDir.absolutePath)\nsetAttribute(\"fork\", \"false\")\n@@ -379,13 +390,10 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n}\n}\nnewChild(\"classpath\") {\n- for (jar in File(mpsHome, \"lib\").walk().filter { it.extension == \"jar\" }) {\n- newChild(\"fileset\") {\n- setAttribute(\"file\", jar.absolutePath)\n- }\n- }\n-\n- for (cpItem in classPath.map { it.canonicalFile }.distinct()) {\n+ val completeClassPath =\n+ (classPath + File(mpsHome, \"lib\").walk().filter { it.extension == \"jar\" })\n+ .map { it.absoluteFile.normalize() }.distinct()\n+ for (cpItem in completeClassPath) {\nif (cpItem.isFile) {\nnewChild(\"fileset\") {\nsetAttribute(\"file\", cpItem.absolutePath)\n@@ -502,7 +510,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nmodule.owner.path.getLocalAbsolutePath().parent.resolve(\"models\").toFile()\n}\n}\n- private fun getClassPath(module: FoundModule): List<File> {\n+ private fun getClassPath(module: FoundModule, macros: Map<String, File>): List<File> {\nreturn when(val owner = module.owner) {\nis SourceModuleOwner -> {\nlistOf(getCompileOutputDir(module))\n@@ -511,11 +519,11 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nlistOf(owner.path.getLocalAbsolutePath().toFile())\n}\nis PluginModuleOwner -> {\n- owner.path.getLocalAbsolutePath().resolve(\"lib\").toFile()\n+ owner.path.getLocalAbsolutePath().toFile()\n.walk().filter { it.extension == \"jar\" }.toList()\n}\nelse -> throw RuntimeException(\"Unknown owner: $owner\")\n- }\n+ } + module.getOwnJars(macros)\n}\nprivate fun generatePlan(modulesToGenerate: List<ModuleId>): Pair<GenerationPlan, GeneratorDependencyGraph> {\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/FoundModule.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/FoundModule.kt",
"diff": "package org.modelix.buildtools\nimport org.modelix.buildtools.modulepersistence.*\n+import java.io.File\nclass FoundModule(val moduleId: ModuleId,\nval owner: ModuleOwner,\n@@ -61,7 +62,9 @@ class FoundModule(val moduleId: ModuleId,\nfun getClassPathDependencies(resolver: ModuleResolver): Set<FoundModule> {\nval result: MutableSet<FoundModule> = HashSet()\n- val runtimes = getAllUsedLanguages(resolver)\n+ val allUsedLanguages = getAllUsedLanguages(resolver)\n+ result += allUsedLanguages\n+ val runtimes = allUsedLanguages\n.map { it to it.moduleDescriptor }\n.filter { it.second is LanguageDescriptor }\n.flatMap { lang -> (lang.second as LanguageDescriptor).runtime\n@@ -71,13 +74,28 @@ class FoundModule(val moduleId: ModuleId,\nval moduleDescriptor = moduleDescriptor\nif (moduleDescriptor != null) {\nval moduleDeps = moduleDescriptor.moduleDependencies\n- .mapNotNull { resolver.resolveModule(it.idAndName, this) }\n+ .mapNotNull { resolver.resolveModule(it.idAndName, this) } +\n+ moduleDescriptor.dependencyVersions\n+ .mapNotNull { resolver.resolveModule(it.idAndName, this, false) }\nresult += moduleDeps\nresult += moduleDeps.flatMap { it.getReexportedDeps(resolver) }\n}\nreturn result\n}\n+ fun getOwnJars(macros: Map<String, File>): Set<File> {\n+ val result = HashSet<File>()\n+ val moduleDescriptor = moduleDescriptor\n+ if (moduleDescriptor != null) {\n+ var modulePath = owner.getRootOwner().path.getLocalAbsolutePath().toFile()\n+ if (modulePath.isFile) modulePath = modulePath.parentFile\n+ val moduleMacro = \"module\" to modulePath\n+ result += moduleDescriptor.resolveJavaLibs(macros + moduleMacro)\n+ .map { it.toFile() }.filter { it.exists() }\n+ }\n+ return result\n+ }\n+\nfun getReexportedDeps(resolver: ModuleResolver): List<FoundModule> {\nval moduleDescriptor = moduleDescriptor ?: return listOf()\nreturn moduleDescriptor.moduleDependencies\n@@ -87,9 +105,8 @@ class FoundModule(val moduleId: ModuleId,\nfun getAllUsedLanguages(resolver: ModuleResolver): Set<FoundModule> {\nval result = HashSet<FoundModule>()\n- val usedDevkits = HashSet<FoundModule>()\n- val usedInModels = languageOrDevkitUsedInModels\n- .mapNotNull { resolver.resolveModule(it, this) }\n+ val usedInModels: MutableSet<FoundModule> = languageOrDevkitUsedInModels\n+ .mapNotNull { resolver.resolveModule(it, this) }.toMutableSet()\nobject : GraphWithCyclesVisitor<FoundModule>() {\noverride fun onVisit(element: FoundModule) {\n@@ -102,6 +119,10 @@ class FoundModule(val moduleId: ModuleId,\n}\n}.visit(usedInModels)\n+ moduleDescriptor?.also { descriptor ->\n+ result += descriptor.languageVersions.mapNotNull { resolver.resolveModule(it.idAndName, this, false) }\n+ }\n+\nreturn result\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/LibraryModuleOwner.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/LibraryModuleOwner.kt",
"diff": "@@ -18,5 +18,8 @@ import java.io.File\n/**\n* Modules packaged as .jar-Files but without an IDEA plugin such as the ones in the MPS.HOME/languages folder\n*/\n-class LibraryModuleOwner(path: ModulePath) : ModuleOwner(path) {\n+class LibraryModuleOwner(path: ModulePath, val parentPlugin: PluginModuleOwner? = null) : ModuleOwner(path) {\n+ override fun getRootOwner(): ModuleOwner {\n+ return parentPlugin?.getRootOwner() ?: this\n+ }\n}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModuleOwner.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModuleOwner.kt",
"diff": "@@ -19,6 +19,8 @@ import kotlin.io.path.pathString\nabstract class ModuleOwner(val path: ModulePath) {\nval modules: MutableMap<ModuleId, FoundModule> = LinkedHashMap()\n+ open fun getRootOwner(): ModuleOwner = this\n+\nfun getOrCreateModule(descriptor: ModuleDescriptor): FoundModule {\nval type: ModuleType = when (descriptor) {\nis SolutionDescriptor -> ModuleType.Solution\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModuleResolver.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModuleResolver.kt",
"diff": "package org.modelix.buildtools\nclass ModuleResolver(val availableModules: FoundModules, val ignoredModules: Set<ModuleId>) {\n- fun resolveModule(dep: ModuleDependency, usedBy: FoundModule): FoundModule? {\n- return resolveModule(ModuleIdAndName(dep.id, dep.moduleName), usedBy)\n+ fun resolveModule(dep: ModuleDependency, usedBy: FoundModule, required: Boolean = true): FoundModule? {\n+ return resolveModule(ModuleIdAndName(dep.id, dep.moduleName), usedBy, required)\n}\n- fun resolveModule(dep: ModuleIdAndName, usedBy: FoundModule): FoundModule? {\n+ fun resolveModule(dep: ModuleIdAndName, usedBy: FoundModule, required: Boolean = true): FoundModule? {\nval resolved = availableModules.getModules()[dep.id]\n- if (resolved == null && !ignoredModules.contains(dep.id)) {\n+ if (resolved == null && required && !ignoredModules.contains(dep.id)) {\nthrow RuntimeException(\"Dependency $dep not found (used by ${usedBy.moduleId}(${usedBy.name}) in ${usedBy.owner.path.getLocalAbsolutePath()} )\")\n}\nreturn resolved\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModulesMiner.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModulesMiner.kt",
"diff": "@@ -18,7 +18,6 @@ import org.modelix.buildtools.modulepersistence.GeneratorDescriptor\nimport org.modelix.buildtools.modulepersistence.LanguageDescriptor\nimport org.modelix.buildtools.modulepersistence.SolutionDescriptor\nimport org.w3c.dom.Element\n-import org.w3c.dom.Text\nimport org.zeroturnaround.zip.ZipUtil\nimport java.io.File\nimport java.io.FileInputStream\n@@ -74,10 +73,10 @@ class ModulesMiner() {\n// This MPS plugin seems to use some old way of packaging a plugin\n// The descriptor declares 'com.intellij' as the ID, but it's actually 'com.intellij.modules.mps'.\nmodules.addPlugin(PluginModuleOwner(origin.localModulePath(file), \"com.intellij.modules.mps\", \"MPS Workbench\", setOf()))\n- } else if (!file.nameWithoutExtension.endsWith(\"-src\")) {\n- val libraryModuleOwner = owner ?: LibraryModuleOwner(origin.localModulePath(file))\n+ } else if (!file.nameWithoutExtension.endsWith(\"-src\") && !file.nameWithoutExtension.endsWith(\"-generator\")) {\n+ val libraryModuleOwner = LibraryModuleOwner(origin.localModulePath(file), owner as? PluginModuleOwner)\nval modules: MutableMap<String, FoundModule> = HashMap()\n- ZipUtil.iterate(file) { stream: InputStream, entry: ZipEntry ->\n+ val jarContentVisitor = { stream: InputStream, entry: ZipEntry ->\nif (entry.name == \"META-INF/module.xml\") {\nloadModules(stream, libraryModuleOwner)\n}\n@@ -87,6 +86,21 @@ class ModulesMiner() {\n}\n}\n}\n+ val srcAndGeneratorNames: Set<String> = (\n+ setOf(file.nameWithoutExtension + \"-src.\" + file.extension) +\n+ (file.nameWithoutExtension + \"-generator.\" + file.extension) +\n+ (0..10).map { file.nameWithoutExtension + \"-$it-generator.\" + file.extension }\n+ )\n+ val srcAndGeneratorJars = srcAndGeneratorNames.map { file.parentFile.resolve(it) }\n+ .filter { it.exists() && it.isFile }\n+ ZipUtil.iterate(file, jarContentVisitor)\n+ for (srcOrGeneratorJar in srcAndGeneratorJars) {\n+ ZipUtil.iterate(srcOrGeneratorJar, jarContentVisitor)\n+ }\n+ if (owner is PluginModuleOwner && libraryModuleOwner.modules.isNotEmpty()) {\n+ owner.libraries += libraryModuleOwner\n+ }\n+\n// if (modules.isNotEmpty()) {\n// ZipUtil.iterate(file) { stream: InputStream, entry: ZipEntry ->\n// when (entry.name.substringAfterLast('.', \"\").lowercase()) {\n@@ -131,8 +145,13 @@ class ModulesMiner() {\nval isPluginDir = pluginXml.exists()\nval pluginOwner = if (isPluginDir) PluginModuleOwner.fromPluginFolder(origin.localModulePath(file)) else null\nif (pluginOwner != null) modules.addPlugin(pluginOwner)\n- file.listFiles()?.forEach { child ->\n- collectModules(child, owner ?: pluginOwner, origin, fileFilter)\n+ val subFolders = if (pluginOwner == null) {\n+ (file.listFiles() ?: arrayOf()).asList()\n+ } else {\n+ pluginOwner.getModuleJarFolders()\n+ }\n+ subFolders.forEach { child ->\n+ collectModules(child, pluginOwner ?: owner, origin, fileFilter)\n}\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/PluginModuleOwner.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/PluginModuleOwner.kt",
"diff": "@@ -23,6 +23,31 @@ import java.util.regex.Pattern\n* Modules packaged as an IDEA plugin containing a META-INF/plugin.xml file.\n*/\nclass PluginModuleOwner(path: ModulePath, val pluginId: String, val name: String?, val pluginDependencies: Set<String>) : ModuleOwner(path) {\n+ val libraries: MutableSet<LibraryModuleOwner> = HashSet()\n+\n+ fun getModuleJarFolders(): List<File> {\n+ try {\n+ val pluginFolder = path.getLocalAbsolutePath().normalize().toFile()\n+ val pluginXml = pluginFolder.resolve(\"META-INF\").resolve(\"plugin.xml\")\n+ val xml = readXmlFile(pluginXml)\n+ val folders = xml.documentElement.childElements(\"extensions\").flatMap { it.childElements() }\n+ .asSequence()\n+ .filter { it.tagName.endsWith(\"LanguageLibrary\") }\n+ .map { it.getAttribute(\"dir\") }\n+ .map { it.trimStart('/', '\\\\') }\n+ .map { pluginFolder.resolve(it).normalize() }\n+ .minus(pluginFolder)\n+ .distinct()\n+ .toList()\n+ return folders.ifEmpty { allSubFolders() }\n+ } catch (e: Exception) {\n+ println(e.message)\n+ return allSubFolders()\n+ }\n+ }\n+\n+ private fun allSubFolders() = (path.getLocalAbsolutePath().toFile().listFiles() ?: arrayOf()).toList()\n+\ncompanion object {\nfun fromPluginFolder(path: ModulePath): PluginModuleOwner {\nval pluginPath = path.getLocalAbsolutePath().toFile()\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/XmlUtils.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/XmlUtils.kt",
"diff": "@@ -16,9 +16,7 @@ package org.modelix.buildtools\nimport org.w3c.dom.Document\nimport org.w3c.dom.Element\nimport org.w3c.dom.Node\n-import java.io.File\n-import java.io.InputStream\n-import java.io.StringWriter\n+import java.io.*\nimport javax.xml.XMLConstants\nimport javax.xml.parsers.DocumentBuilderFactory\nimport javax.xml.transform.OutputKeys\n@@ -84,15 +82,19 @@ fun xmlToString(doc: Document): String {\n}\nfun readXmlFile(file: File): Document {\n+ try {\nval dbf = DocumentBuilderFactory.newInstance()\n//dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true)\nval db = dbf.newDocumentBuilder()\nreturn db.parse(file)\n+ } catch (e: Exception) {\n+ throw RuntimeException(\"Failed to read ${file.absoluteFile}\", e)\n+ }\n}\nfun readXmlFile(file: InputStream): Document {\nval dbf = DocumentBuilderFactory.newInstance()\n- dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true)\n+ //dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true)\nval db = dbf.newDocumentBuilder()\nreturn db.parse(file)\n}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/modulepersistence/ModuleDescriptor.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/modulepersistence/ModuleDescriptor.kt",
"diff": "@@ -15,6 +15,7 @@ package org.modelix.buildtools.modulepersistence\nimport org.modelix.buildtools.*\nimport org.w3c.dom.Element\n+import java.io.File\nimport java.nio.file.Path\nabstract class ModuleDescriptor(val xml: Element) {\n@@ -28,6 +29,7 @@ abstract class ModuleDescriptor(val xml: Element) {\nval runtime: List<ModuleDependency>\nprivate val modelRoots: List<Element>\nprivate val facets: List<Element>\n+ val javaLibPaths: List<String>\ninit {\n// see ModuleDescriptorPersistence in MPS\n@@ -43,12 +45,25 @@ abstract class ModuleDescriptor(val xml: Element) {\n.map { ModuleDependency(it) }\nruntime = xml.childElements(\"runtime\").flatMap { it.childElements(\"dependency\") }\n.map { ModuleDependency(it) }\n- languageVersions = xml.childElements(\"languageVersions\").flatMap { it.childElements(\"languageVersion\") }\n+ languageVersions = xml.childElements(\"languageVersions\").flatMap { it.childElements(\"language\") }\n.map { LanguageVersion(it) }\ndependencyVersions = xml.childElements(\"dependencyVersions\").flatMap { it.childElements(\"module\") }\n.map { DependencyVersion(it) }\nmodelRoots = xml.childElements(\"models\").flatMap { it.childElements(\"modelRoot\") }\nfacets = xml.childElements(\"facets\").flatMap { it.childElements(\"facet\") }\n+ javaLibPaths = xml.childElements(\"stubModelEntries\")\n+ .flatMap { it.childElements(\"stubModelEntry\") }\n+ .map { it.getAttribute(\"path\") }\n+ }\n+\n+ fun resolveJavaLibs(macros: Map<String, File>): List<Path> {\n+ return javaLibPaths.map {\n+ var path = it\n+ for (macro in macros) {\n+ path = path.replace(\"\\${\" + macro.key + \"}\", macro.value.absolutePath)\n+ }\n+ Path.of(path).normalize()\n+ }\n}\nprotected open fun getDefaultGeneratorOutputPath(): String = \"source_gen\"\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Compiling MPS-extensions was successful |
426,496 | 07.03.2022 11:18:43 | -3,600 | 4938c864a2cb78cc125ff34fe5c399846b22078e | Generators were not compiled and packaged | [
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -93,6 +93,17 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nsetAttribute(\"location\", \"\\${mps.home}/lib/jdom.jar\")\n}\n}\n+ newChild(\"path\") {\n+ setAttribute(\"id\", \"path.mps.libs\")\n+ val cp = File(mpsHome, \"lib\").walk()\n+ .filter { it.extension == \"jar\" }\n+ .map { it.absoluteFile.normalize() }\n+ for (cpItem in cp) {\n+ newChild(\"pathelement\") {\n+ setAttribute(\"location\", cpItem.absolutePath)\n+ }\n+ }\n+ }\n// target: generate\nnewChild(\"target\") {\n@@ -390,10 +401,9 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n}\n}\nnewChild(\"classpath\") {\n- val completeClassPath =\n- (classPath + File(mpsHome, \"lib\").walk().filter { it.extension == \"jar\" })\n- .map { it.absoluteFile.normalize() }.distinct()\n- for (cpItem in completeClassPath) {\n+ val normalizedClassPath =\n+ classPath.map { it.absoluteFile.normalize() }.distinct()\n+ for (cpItem in normalizedClassPath) {\nif (cpItem.isFile) {\nnewChild(\"fileset\") {\nsetAttribute(\"file\", cpItem.absolutePath)\n@@ -404,6 +414,9 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n}\n}\n}\n+ newChild(\"path\") {\n+ setAttribute(\"refid\", \"path.mps.libs\")\n+ }\n}\n}\n}\n@@ -516,7 +529,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nlistOf(getCompileOutputDir(module))\n}\nis LibraryModuleOwner -> {\n- listOf(owner.path.getLocalAbsolutePath().toFile())\n+ owner.getPrimaryAndGeneratorJars()\n}\nis PluginModuleOwner -> {\nowner.path.getLocalAbsolutePath().toFile()\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/LibraryModuleOwner.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/LibraryModuleOwner.kt",
"diff": "@@ -22,4 +22,31 @@ class LibraryModuleOwner(path: ModulePath, val parentPlugin: PluginModuleOwner?\noverride fun getRootOwner(): ModuleOwner {\nreturn parentPlugin?.getRootOwner() ?: this\n}\n+\n+ fun getPrimaryAndGeneratorJars(): List<File> = listOf(getPrimaryJar()) + getGeneratorJars()\n+\n+ fun getPrimaryJar(): File {\n+ return path.getLocalAbsolutePath().toFile()\n+ }\n+\n+ fun getSourceJar(): File? {\n+ val primaryJar = getPrimaryJar()\n+ return primaryJar.parentFile\n+ .resolve(primaryJar.nameWithoutExtension + \"-src.\" + primaryJar.extension)\n+ .takeIf { it.exists() }\n+ }\n+\n+ fun getGeneratorJars(): List<File> {\n+ val primaryJar = getPrimaryJar()\n+ val folder = primaryJar.parentFile\n+ val baseName = primaryJar.nameWithoutExtension\n+ val extension = primaryJar.extension\n+ return modules.values\n+ .filter { it.moduleType == ModuleType.Generator }\n+ .mapIndexed { index, generator ->\n+ val indexPart = if (index == 0) \"\" else \"-$index\"\n+ folder.resolve(baseName + \"$indexPart-generator.\" + extension)\n+ }\n+ .filter { it.exists() }\n+ }\n}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModulesMiner.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModulesMiner.kt",
"diff": "@@ -200,7 +200,7 @@ class ModulesMiner() {\nmodules.addModule(owner.getOrCreateModule(descriptor))\nif (descriptor is LanguageDescriptor) {\nfor (generator in descriptor.generators) {\n- modules.addModule(owner.getOrCreateModule(descriptor))\n+ modules.addModule(owner.getOrCreateModule(generator))\n}\n}\n}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Generators were not compiled and packaged |
426,496 | 07.03.2022 13:14:28 | -3,600 | d42b2c25ad0cf5a812cc2a26def087e40aa71bb5 | Move classpath of modules into reusable path elements to reduce file size | [
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -26,6 +26,8 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nval macros: Map<String, File> = HashMap(),\nval buildDir: File = File(\".\", \"build\")) {\n+ private var compileCycleIds: Map<DependencyGraph<FoundModule, ModuleId>.DependencyNode, Int> = HashMap()\n+\nfun buildModules(antScriptFile: File = File.createTempFile(\"mps-build-script\", \".xml\", File(\".\")), outputHandler: ((String)->Unit)? = null) {\nval xml = generateXML()\nantScriptFile.writeText(xml)\n@@ -104,6 +106,24 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n}\n}\n}\n+ for (module in modulesMiner.getModules().getModules().values) {\n+ newChild(\"path\") {\n+ setAttribute(\"id\", \"path.module.${module.name}\")\n+ getClassPath(module, macros)\n+ val cp = getClassPath(module, macros).map { it.absoluteFile.normalize() }\n+ for (cpItem in cp) {\n+ if (cpItem.isFile) {\n+ newChild(\"fileset\") {\n+ setAttribute(\"file\", cpItem.absolutePath)\n+ }\n+ } else {\n+ newChild(\"pathelement\") {\n+ setAttribute(\"path\", cpItem.absolutePath)\n+ }\n+ }\n+ }\n+ }\n+ }\n// target: generate\nnewChild(\"target\") {\n@@ -173,16 +193,33 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nval modulesToCompile = sourceModules + generatorModules\nval compileDependencyGraph = CompileDependencyGraph(resolver)\ncompileDependencyGraph.load(modulesToCompile)\n- var cycleIdSequence = 0\n- val cycles = compileDependencyGraph.getNodes().filter { it.modules.any { it.owner is SourceModuleOwner } }\n- val compileTargetNames = cycles.associateWith {\n- if (it.modules.size == 1) {\n- getCompileTargetName(it.modules.first())\n+ var compileCycleIdSequence = 0\n+ val compileCycles = compileDependencyGraph.getNodes().filter { it.modules.any { it.owner is SourceModuleOwner } }\n+ compileCycleIds = compileDependencyGraph.getNodes().filter { it.modules.size > 1 }.associateWith { ++compileCycleIdSequence }\n+ val compileTargetNames = compileCycles.associateWith { cycle ->\n+ if (cycle.modules.size == 1) {\n+ getCompileTargetName(cycle.modules.first())\n} else {\n- \"compile.cycle.${++cycleIdSequence}\"\n+ \"compile.cycle.${compileCycleIds[cycle]}\"\n}\n}\n- for (cycle in cycles) {\n+ for (cycle in compileCycleIds) {\n+ newChild(\"path\") {\n+ setAttribute(\"id\", \"path.cycle${cycle.value}\")\n+ for (module in cycle.key.modules) {\n+ newChild(\"path\") {\n+ setAttribute(\"refid\", \"path.module.${module.name}\")\n+ }\n+ }\n+ for (dep in cycle.key.getDependencies()) {\n+ val depId = compileCycleIds[dep] ?: continue\n+ newChild(\"path\") {\n+ setAttribute(\"refid\", \"path.cycle${depId}\")\n+ }\n+ }\n+ }\n+ }\n+ for (cycle in compileCycles) {\nval sourceModules = cycle.modules.filter { it.owner is SourceModuleOwner }\nvar cycleOutputDir: File? = null\nval isCycle = cycle.modules.size > 1\n@@ -190,8 +227,8 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\ncycleOutputDir = File(getCompileOutputDir(), compileTargetNames[cycle]!!)\ncreateCompileTarget(\nmodules = sourceModules,\n- classPath = cycle.getTransitiveDependencies().flatMap { it.modules }.distinct()\n- .flatMap { getClassPath(it, macros) } + sourceModules.flatMap { it.getOwnJars(macros) },\n+ classPath = sourceModules.flatMap { it.getOwnJars(macros) },\n+ classPathModules = cycle.getTransitiveDependencies(),\ntargetName = compileTargetNames[cycle]!!,\ntargetDependencies = cycle.getDependencies().mapNotNull { compileTargetNames[it] },\noutputDir = cycleOutputDir,\n@@ -201,14 +238,14 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nfor (module in sourceModules) {\nval targetName = getCompileTargetName(module)\n- var cp = cycle.getTransitiveDependencies().flatMap { it.modules }.distinct()\n- .flatMap { getClassPath(it, macros) } + module.getOwnJars(macros)\n+ var cp = module.getOwnJars(macros).toList()\nif (cycleOutputDir != null) cp += cycleOutputDir\nvar targetDependencies = cycle.getDependencies().mapNotNull { compileTargetNames[it] }\nif (isCycle) targetDependencies += compileTargetNames[cycle]!!\ncreateCompileTarget(\nmodules = listOf(module),\nclassPath = cp,\n+ classPathModules = cycle.getTransitiveDependencies(),\ntargetName = targetName,\ntargetDependencies = targetDependencies,\noutputDir = getCompileOutputDir(module),\n@@ -365,6 +402,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nprivate fun Element.createCompileTarget(\nmodules: List<FoundModule>,\nclassPath: List<File>,\n+ classPathModules: Set<DependencyGraph<FoundModule, ModuleId>.DependencyNode>,\ntargetName: String,\ntargetDependencies: List<String>,\noutputDir: File,\n@@ -414,6 +452,16 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n}\n}\n}\n+ for (classPathModule in classPathModules) {\n+ newChild(\"path\") {\n+ val pathName = if (classPathModule.modules.size > 1) {\n+ \"path.cycle${compileCycleIds[classPathModule]}\"\n+ } else {\n+ \"path.module.${classPathModule.modules.first().name}\"\n+ }\n+ setAttribute(\"refid\", pathName)\n+ }\n+ }\nnewChild(\"path\") {\nsetAttribute(\"refid\", \"path.mps.libs\")\n}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Move classpath of modules into reusable path elements to reduce file size |
426,496 | 07.03.2022 18:42:51 | -3,600 | d56df4b83b93e754a683f915f85268a64fd210a8 | In the gradle plugin allow to specify which modules to build | [
{
"change_type": "MODIFY",
"old_path": "generator-test-project/build.gradle",
"new_path": "generator-test-project/build.gradle",
"diff": "@@ -16,7 +16,7 @@ buildscript {\n}\ndependencies {\n- classpath group: 'org.modelix', name: 'gradle-mpsbuild-plugin', version: '0.0.92'\n+ classpath group: 'org.modelix', name: 'gradle-mpsbuild-plugin', version: '2020.3.5-202203031233-SNAPSHOT'\n}\n}\n@@ -30,6 +30,6 @@ apply plugin: 'modelix-gradle-mpsbuild-plugin'\nmpsBuild {\nmpsHome \"../artifacts/mps\"\n- modules \"languages\"\n- modules \"solutions\"\n+ search \"languages\"\n+ search \"solutions\"\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.java",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.java",
"diff": "@@ -15,13 +15,13 @@ package org.modelix.gradle.mpsbuild;\nimport org.apache.commons.io.FileUtils;\nimport org.gradle.api.Action;\n-import org.gradle.api.GradleException;\nimport org.gradle.api.Plugin;\nimport org.gradle.api.Project;\nimport org.gradle.api.Task;\nimport org.gradle.api.artifacts.Configuration;\nimport org.modelix.buildtools.BuildScriptGenerator;\nimport org.modelix.buildtools.FoundModule;\n+import org.modelix.buildtools.ModuleId;\nimport org.modelix.buildtools.ModulesMiner;\nimport java.io.File;\n@@ -29,8 +29,10 @@ import java.io.IOException;\nimport java.net.URL;\nimport java.nio.charset.StandardCharsets;\nimport java.nio.file.Path;\n+import java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.Enumeration;\n+import java.util.List;\nimport java.util.jar.Manifest;\npublic class MPSBuildPlugin implements Plugin<Project> {\n@@ -87,7 +89,21 @@ public class MPSBuildPlugin implements Plugin<Project> {\n}\nmodulesMiner.searchInFolder(mpsHome);\n}\n- BuildScriptGenerator generator = new BuildScriptGenerator(modulesMiner, null,\n+\n+ List<Path> includedModules = settings.resolveIncludedModules(project.getProjectDir().toPath());\n+ List<String> modulesToGenerate = null;\n+ if (includedModules != null) {\n+ modulesToGenerate = new ArrayList<>();\n+ for (FoundModule module : modulesMiner.getModules().getModules().values()) {\n+ Path modulePath = module.getOwner().getPath().getLocalAbsolutePath();\n+ if (includedModules.stream().anyMatch(include -> modulePath.startsWith(include))) {\n+ modulesToGenerate.add(module.getModuleIdString());\n+ }\n+ }\n+ }\n+\n+ BuildScriptGenerator generator = new BuildScriptGenerator(\n+ modulesMiner, ModuleId.Companion.fromString(modulesToGenerate),\nCollections.emptySet(), Collections.emptyMap(), buildDir);\nString xml = generator.generateXML();\ntry {\n"
},
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.java",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.java",
"diff": "@@ -24,6 +24,7 @@ import java.util.stream.Collectors;\npublic class MPSBuildSettings {\nprivate String mpsHome = null;\nprivate List<String> modules = new ArrayList<>();\n+ private List<String> includedModules = new ArrayList<>();\npublic boolean usingExistingMps() {\nreturn getMpsHome() != null;\n@@ -41,12 +42,21 @@ public class MPSBuildSettings {\nthis.mpsHome = mpsHome;\n}\n- public void modules(String path) {\n+ public void search(String path) {\nthis.modules.add(path);\n}\n+ public void include(String moduleToInclude) {\n+ includedModules.add(moduleToInclude);\n+ }\n+\npublic List<Path> resolveModulePaths(Path workdir) {\nif (modules.isEmpty()) return Collections.singletonList(workdir);\nreturn modules.stream().map(path -> workdir.resolve(path).normalize()).distinct().collect(Collectors.toList());\n}\n+\n+ public List<Path> resolveIncludedModules(Path workdir) {\n+ if (includedModules.isEmpty()) return null;\n+ return includedModules.stream().map(path -> workdir.resolve(path).toAbsolutePath().normalize()).distinct().collect(Collectors.toList());\n+ }\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -18,6 +18,7 @@ import org.w3c.dom.Document\nimport org.w3c.dom.Element\nimport java.io.File\nimport javax.xml.parsers.DocumentBuilderFactory\n+import kotlin.io.path.absolutePathString\nimport kotlin.io.path.pathString\nclass BuildScriptGenerator(val modulesMiner: ModulesMiner,\n@@ -57,10 +58,11 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nval (plan, dependencyGraph) = generatePlan(modulesToGenerate_ - ignoredModules.toSet())\nval resolver = ModuleResolver(modulesMiner.getModules(), ignoredModules)\nval mpsHome = modulesMiner.getModules().mpsHome ?: throw RuntimeException(\"mps.home not found\")\n- val macros = mapOf(\n- \"platform_lib\" to File(mpsHome, \"lib\"),\n- \"mps_home\" to mpsHome\n- )\n+ val macros = Macros(mapOf(\n+ \"platform_lib\" to File(mpsHome, \"lib\").toPath(),\n+ \"mps_home\" to mpsHome.toPath(),\n+ \"mps.home\" to mpsHome.toPath(),\n+ ))\nval dbf = DocumentBuilderFactory.newInstance()\nval db = dbf.newDocumentBuilder()\n@@ -169,10 +171,10 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nsetAttribute(\"value\", \"-Xmx2G\")\n}\n}\n- for (macro in macros) {\n+ for (macro in macros.macros) {\nnewChild(\"macro\") {\nsetAttribute(\"name\", macro.key)\n- setAttribute(\"path\", macro.value.absolutePath)\n+ setAttribute(\"path\", macro.value.absolutePathString())\n}\n}\n}\n@@ -571,7 +573,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nmodule.owner.path.getLocalAbsolutePath().parent.resolve(\"models\").toFile()\n}\n}\n- private fun getClassPath(module: FoundModule, macros: Map<String, File>): List<File> {\n+ private fun getClassPath(module: FoundModule, macros: Macros): List<File> {\nreturn when(val owner = module.owner) {\nis SourceModuleOwner -> {\nlistOf(getCompileOutputDir(module))\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/FoundModule.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/FoundModule.kt",
"diff": "@@ -29,30 +29,40 @@ class FoundModule(val moduleId: ModuleId,\n?: deploymentDescriptor?.name\n?: throw RuntimeException(\"module has no descriptor: $moduleId in ${owner.path.getLocalAbsolutePath()}\")\n+ fun getModuleIdString() = moduleId.id\n+\ninit {\nowner.modules[moduleId] = this\n}\n- fun getGenerationDependencies(availableModules: ModuleResolver): Set<ModuleIdAndName> {\n- val result = HashSet<ModuleIdAndName>()\n- result += languageOrDevkitUsedInModels\n+ fun getGenerationDependencies(resolver: ModuleResolver): Set<FoundModule> {\n+ val result = HashSet<FoundModule>()\n+ result += languageOrDevkitUsedInModels.mapNotNull { resolver.resolveModule(it, this) }\n+ result += getAllUsedLanguages(resolver).map { ModuleIdAndName(it.moduleId, it.name) }\n+ .mapNotNull { resolver.resolveModule(it, this) }\nval moduleDescriptor = moduleDescriptor\nif (moduleDescriptor != null) {\nresult += moduleDescriptor.moduleDependencies.map { it.idAndName }\n+ .mapNotNull { resolver.resolveModule(it, this) }\n+ result += moduleDescriptor.dependencyVersions.map { it.idAndName }\n+ .mapNotNull { resolver.resolveModule(it, this, false) }\nresult += moduleDescriptor.runtime.map { it.idAndName }\n+ .mapNotNull { resolver.resolveModule(it, this) }\nwhen (moduleDescriptor) {\nis LanguageDescriptor -> {\n- result += moduleDescriptor.extendedLanguages\n+ result += moduleDescriptor.extendedLanguages.mapNotNull { resolver.resolveModule(it, this) }\n+ result += moduleDescriptor.generators.map { ModuleIdAndName(it.id, it.name) }\n+ .mapNotNull { resolver.resolveModule(it, this) }\n}\nis GeneratorDescriptor -> {\n- moduleDescriptor.getLanguage()?.let { result += it }\n+ moduleDescriptor.getLanguage()?.let { resolver.resolveModule(it, this) }?.let { result += it }\n}\nis DevkitDescriptor -> {\n- result += moduleDescriptor.exportedLanguages\n- result += moduleDescriptor.exportedSolutions\n- result += moduleDescriptor.extendedDevkits\n+ result += moduleDescriptor.exportedLanguages.mapNotNull { resolver.resolveModule(it, this) }\n+ result += moduleDescriptor.exportedSolutions.mapNotNull { resolver.resolveModule(it, this) }\n+ result += moduleDescriptor.extendedDevkits.mapNotNull { resolver.resolveModule(it, this) }\n}\n}\n}\n@@ -83,14 +93,14 @@ class FoundModule(val moduleId: ModuleId,\nreturn result\n}\n- fun getOwnJars(macros: Map<String, File>): Set<File> {\n+ fun getOwnJars(macros: Macros): Set<File> {\nval result = HashSet<File>()\nval moduleDescriptor = moduleDescriptor\nif (moduleDescriptor != null) {\nvar modulePath = owner.getRootOwner().path.getLocalAbsolutePath().toFile()\nif (modulePath.isFile) modulePath = modulePath.parentFile\n- val moduleMacro = \"module\" to modulePath\n- result += moduleDescriptor.resolveJavaLibs(macros + moduleMacro)\n+ val moduleMacro = \"module\" to modulePath.toPath()\n+ result += moduleDescriptor.resolveJavaLibs(macros.with(moduleMacro))\n.map { it.toFile() }.filter { it.exists() }\n}\nreturn result\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/GenerationPlanBuilder.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/GenerationPlanBuilder.kt",
"diff": "@@ -51,7 +51,7 @@ class GenerationPlanBuilder(val availableModules: FoundModules, val ignoredModul\nval plugins: MutableMap<String, PluginModuleOwner> = LinkedHashMap()\nfor (module in node.modules) {\n- when (val moduleOwner = module.owner) {\n+ when (val moduleOwner = module.owner.getRootOwner()) {\nis SourceModuleOwner -> {\nvar moduleToGenerate = module\nif (module.moduleType == ModuleType.Generator) {\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/GeneratorDependencyGraph.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/GeneratorDependencyGraph.kt",
"diff": "@@ -20,7 +20,6 @@ class GeneratorDependencyGraph(val moduleResolver: ModuleResolver) : DependencyG\noverride fun getDependencies(element: FoundModule): Iterable<FoundModule> {\nreturn element.getGenerationDependencies(moduleResolver)\n- .mapNotNull { moduleResolver.resolveModule(it, element) }\n}\nfun mergeGeneratorsAndLanguages() {\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/Macros.kt",
"diff": "+/*\n+ * Copyright 2003-2022 JetBrains s.r.o.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.modelix.buildtools\n+\n+import java.nio.file.Path\n+import kotlin.io.path.absolutePathString\n+\n+class Macros(val macros: Map<String, Path> = mapOf()) {\n+ fun with(key: String, value: Path) = with(key to value)\n+ fun with(entry: Pair<String, Path>) = Macros(macros + entry)\n+ fun resolve(input: String): Path {\n+ var path = input\n+ for (macro in macros) {\n+ path = path.replace(\"\\${\" + macro.key + \"}\", macro.value.absolutePathString())\n+ }\n+ return Path.of(path).normalize()\n+ }\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModuleId.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModuleId.kt",
"diff": "@@ -15,6 +15,10 @@ package org.modelix.buildtools\n@JvmInline\nvalue class ModuleId(val id: String) {\n+ companion object {\n+ fun fromString(id: String) = ModuleId(id)\n+ fun fromString(ids: List<String>) = ids.map { fromString(it) }\n+ }\noverride fun toString(): String {\nreturn id\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModulesMiner.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModulesMiner.kt",
"diff": "@@ -59,13 +59,11 @@ class ModulesMiner() {\nloadModules(stream, sourceOwner)\n}\nfor (module in sourceOwner.modules.values) {\n- // TODO use model roots declared in the descriptor\n- val modelsFolder = if (module.moduleType == ModuleType.Generator) {\n- file.parentFile.resolve(\"generator\")\n- } else {\n- file.parentFile.resolve(\"models\")\n+ val descriptor = module.moduleDescriptor ?: continue\n+ val macros = Macros().with(\"module\", file.parentFile.absoluteFile.toPath())\n+ for (modelFolder in descriptor.resolveModelPaths(macros)) {\n+ dependenciesFromModels(module, modelFolder.toFile())\n}\n- dependenciesFromModels(module, modelsFolder)\n}\n}\n\"jar\" -> {\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/modulepersistence/ModuleDescriptor.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/modulepersistence/ModuleDescriptor.kt",
"diff": "@@ -28,6 +28,7 @@ abstract class ModuleDescriptor(val xml: Element) {\nval dependencyVersions: List<DependencyVersion>\nval runtime: List<ModuleDependency>\nprivate val modelRoots: List<Element>\n+ private val modelPaths: List<String>\nprivate val facets: List<Element>\nval javaLibPaths: List<String>\n@@ -50,19 +51,25 @@ abstract class ModuleDescriptor(val xml: Element) {\ndependencyVersions = xml.childElements(\"dependencyVersions\").flatMap { it.childElements(\"module\") }\n.map { DependencyVersion(it) }\nmodelRoots = xml.childElements(\"models\").flatMap { it.childElements(\"modelRoot\") }\n+ modelPaths = modelRoots.filter { it.getAttribute(\"type\") == \"default\" }.flatMap { root ->\n+ val contentPath = root.getAttribute(\"contentPath\")\n+ root.childElements(\"sourceRoot\").map { contentPath + \"/\" + it.getAttribute(\"location\") }\n+ }\nfacets = xml.childElements(\"facets\").flatMap { it.childElements(\"facet\") }\njavaLibPaths = xml.childElements(\"stubModelEntries\")\n.flatMap { it.childElements(\"stubModelEntry\") }\n.map { it.getAttribute(\"path\") }\n}\n- fun resolveJavaLibs(macros: Map<String, File>): List<Path> {\n- return javaLibPaths.map {\n- var path = it\n- for (macro in macros) {\n- path = path.replace(\"\\${\" + macro.key + \"}\", macro.value.absolutePath)\n+ fun resolveJavaLibs(macros: Macros): List<Path> {\n+ return javaLibPaths.map { macros.resolve(it) }\n}\n- Path.of(path).normalize()\n+\n+ fun resolveModelPaths(macros: Macros): List<Path> {\n+ return modelPaths.map { macros.resolve(it) }.filter {\n+ val exists = it.toFile().exists()\n+ if (!exists) println(\"Model folder doesn't exist: $it\")\n+ exists\n}\n}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | In the gradle plugin allow to specify which modules to build |
426,496 | 07.03.2022 22:52:09 | -3,600 | 884542d375c2f7b0d1493578475f311538d6769c | copy java libraries of a module to the output folder | [
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -295,15 +295,30 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nsetAttribute(\"type\", typeString)\nsetAttribute(\"uuid\", sourceModule.moduleId.id)\nnewChild(\"dependencies\") {\n-// newChild(\"module\") {\n-// setAttribute(\"ref\", \"\")\n-// setAttribute(\"kind\", \"rt\")\n-// }\n+ for (dep in sourceModule.getGenerationDependencies(resolver)) {\n+ newChild(\"module\") {\n+ setAttribute(\"ref\", dep.idAndName.toString())\n+ setAttribute(\"kind\", \"rt\")\n+ }\n+ }\n+ for (dep in sourceModule.getClassPathDependencies(resolver)) {\n+ newChild(\"module\") {\n+ setAttribute(\"ref\", dep.idAndName.toString())\n+ setAttribute(\"kind\", \"cl\")\n+ }\n+ }\n}\nnewChild(\"uses\") {\n-// newChild(\"language\") {\n-// setAttribute(\"id\", \"\")\n-// }\n+ for (lang in sourceModule.getAllUsedLanguages(resolver)) {\n+ newChild(\"language\") {\n+ setAttribute(\"id\", \"l:${lang.moduleId}:${lang.name}\")\n+ }\n+ }\n+ }\n+ for (jar in sourceModule.getOwnJars(macros)) {\n+ newChild(\"library\") {\n+ setAttribute(\"jar\", \"../${getLibsTargetFolderName(sourceModule)}/${jar.name}\")\n+ }\n}\nnewChild(\"classpath\") {\nnewChild(\"entry\") {\n@@ -335,6 +350,18 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nsetAttribute(\"includes\", \"icons/**, resources/**\")\n}\n}\n+\n+ val jars = sourceModule.getOwnJars(macros)\n+ if (jars.isNotEmpty()) {\n+ newChild(\"copy\") {\n+ setAttribute(\"todir\", getPackagedModulesDir().resolve(getLibsTargetFolderName(sourceModule)).absolutePath)\n+ for (jar in jars) {\n+ newChild(\"file\") {\n+ setAttribute(\"file\", jar.absolutePath)\n+ }\n+ }\n+ }\n+ }\n}\n}\nfor (sourceModule in sourceModules) {\n@@ -505,6 +532,9 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nFile(getPackagedModulesDir(), module.name + \".jar\")\n}\n}\n+ private fun getLibsTargetFolderName(module: FoundModule): String {\n+ return getJarFile(module).nameWithoutExtension + \"-lib\"\n+ }\nprivate fun getJarTempDir(module: FoundModule): File {\nreturn if (module.moduleType == ModuleType.Generator) {\nval indexPart = getGeneratorIndexPart(module)\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/FoundModule.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/FoundModule.kt",
"diff": "@@ -28,6 +28,8 @@ class FoundModule(val moduleId: ModuleId,\nget() = moduleDescriptor?.name\n?: deploymentDescriptor?.name\n?: throw RuntimeException(\"module has no descriptor: $moduleId in ${owner.path.getLocalAbsolutePath()}\")\n+ val idAndName: ModuleIdAndName\n+ get() = ModuleIdAndName(moduleId, name)\nfun getModuleIdString() = moduleId.id\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | copy java libraries of a module to the output folder |
426,496 | 07.03.2022 23:08:10 | -3,600 | 73daa27e1608193088d773ff02e4931255b92fb8 | A compile cycle between two merged cycles was possible | [
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/DependencyGraph.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/DependencyGraph.kt",
"diff": "@@ -60,8 +60,10 @@ abstract class DependencyGraph<ElementT, KeyT> {\ncycleBeforeMerge(cycle)\n}\n- for (cycle in cycleFinder.cycles) {\n- val nodesToMerge = cycle.map { it.getMergedNode() }.distinct()\n+ val cycles: List<List<ElementT>> = cycleFinder.cycles.map { it.flatMap { it.modules } }\n+\n+ for (cycle in cycles) {\n+ val nodesToMerge: List<DependencyNode> = cycle.mapNotNull { getNode(getKey(it)) }.distinct()\nif (nodesToMerge.size <= 1) continue\nfor (mergeSource in nodesToMerge.drop(1)) {\nmergeNodes(mergeSource, nodesToMerge.first())\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | A compile cycle between two merged cycles was possible |
426,496 | 07.03.2022 23:24:34 | -3,600 | 2b9ba7c52eb72a7a0519c6b93a74adf951266d1a | fixed compile errors in workspace-manager | [
{
"change_type": "MODIFY",
"old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManager.kt",
"new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManager.kt",
"diff": "@@ -344,7 +344,7 @@ class WorkspaceManager {\nif (cloudResourcesFile.exists()) cloudResourcesFile.delete()\n}\n- val json = buildEnvironmentSpec(modulesMiner.getModules(), mpsClassPath)\n+ val json = buildEnvironmentSpec(modulesMiner.getModules(), mpsClassPath, job.workspace.ignoredModules.map { ModuleId(it) }.toSet())\nval envFile = File(\"mps-environment.json\")\nenvFile.writeBytes(json.toByteArray(StandardCharsets.UTF_8))\n@@ -362,14 +362,17 @@ class WorkspaceManager {\n}\n}\n- private fun buildEnvironmentSpec(modules: FoundModules, classPath: List<String>): String {\n+ private fun buildEnvironmentSpec(modules: FoundModules, classPath: List<String>, ignoredModules: Set<ModuleId>): String {\nval mpsHome = modules.mpsHome ?: throw RuntimeException(\"mps.home not found\")\nval plugins: MutableMap<String, PluginModuleOwner> = LinkedHashMap()\nval libraries = ArrayList<LibrarySpec>()\n- val rootModuleIds = modules.getModules().values.filter { it.owner is SourceModuleOwner }.map { it.moduleId }.toMutableSet()\n+ val rootModules = modules.getModules().values.filter { it.owner is SourceModuleOwner }\n+ val rootModuleIds = rootModules.map { it.moduleId }.toMutableSet()\nrootModuleIds += org_modelix_model_mpsplugin\n- val modulesToLoad = modules.getWithDependencies(rootModuleIds).map { it.owner }.toSet()\n+ val graph = GeneratorDependencyGraph(ModuleResolver(modules, ignoredModules))\n+ graph.load(rootModules)\n+ val modulesToLoad = graph.getNodes().flatMap { it.modules }.map { it.owner.getRootOwner() }.toSet()\nfor (moduleOwner in modulesToLoad) {\nwhen (moduleOwner) {\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | fixed compile errors in workspace-manager |
426,496 | 08.03.2022 09:51:04 | -3,600 | 18ced2c0fc69b36e45009a9b35d39f2dd582426d | Path to stub model jars was wrong when packaged | [
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -317,7 +317,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n}\nfor (jar in sourceModule.getOwnJars(macros)) {\nnewChild(\"library\") {\n- setAttribute(\"jar\", \"../${getLibsTargetFolderName(sourceModule)}/${jar.name}\")\n+ setAttribute(\"jar\", \"./${getLibsTargetFolderName(sourceModule)}/${jar.name}\")\n}\n}\nnewChild(\"classpath\") {\n@@ -419,6 +419,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nsetAttribute(\"name\", \"clean\")\nnewChild(\"delete\") { setAttribute(\"dir\", getPackagedModulesDir().absolutePath) }\nnewChild(\"delete\") { setAttribute(\"dir\", getPackagedModulesTempDir().absolutePath) }\n+ newChild(\"delete\") { setAttribute(\"dir\", getModelsTempDir().absolutePath) }\nnewChild(\"delete\") { setAttribute(\"dir\", getCompileOutputDir().absolutePath) }\n}\n}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Path to stub model jars was wrong when packaged |
426,496 | 08.03.2022 10:20:38 | -3,600 | 5d69d59ebf502310af4b577277b3484058ad6756 | There were still cyclic dependencies between merged cycles | [
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/DependencyGraph.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/DependencyGraph.kt",
"diff": "@@ -20,9 +20,9 @@ abstract class DependencyGraph<ElementT, KeyT> {\nabstract fun getKey(element: ElementT): KeyT\nabstract fun getDependencies(element: ElementT): Iterable<ElementT>\n- fun getRoots() = module2node.values.filter { it.isRoot() }\n+ fun getRoots() = getNodes().filter { it.isRoot() }\n- fun getNode(moduleId: KeyT) = module2node[moduleId]\n+ fun getNode(moduleId: KeyT) = module2node[moduleId]?.getMergedNode()\nfun getNodes(): Set<DependencyNode> = module2node.values.map { it.getMergedNode() }.toSet()\n@@ -32,7 +32,7 @@ abstract class DependencyGraph<ElementT, KeyT> {\n}\nprivate fun load(module: ElementT): DependencyNode {\n- var node = module2node[getKey(module)]\n+ var node = getNode(getKey(module))\nif (node != null) return node\nnode = DependencyNode()\n@@ -54,7 +54,7 @@ abstract class DependencyGraph<ElementT, KeyT> {\nfun mergeCycles() {\nval cycleFinder = CycleFinder()\n- module2node.values.forEach { cycleFinder.process(it) }\n+ getNodes().forEach { cycleFinder.process(it) }\nfor (cycle in cycleFinder.cycles) {\ncycleBeforeMerge(cycle)\n@@ -82,12 +82,15 @@ abstract class DependencyGraph<ElementT, KeyT> {\ntarget.modules += source.modules\nsource.modules.clear()\n- for (dependency in source.getDependencies()) {\n+ val dependenciesToTransfer = source.getDependencies()\n+ val reverseDependenciesToTransfer = source.getReverseDependencies()\n+\n+ for (dependency in dependenciesToTransfer) {\nsource.removeDependency(dependency)\ntarget.addDependency(dependency)\n}\n- for (reverseDependency in source.getReverseDependencies()) {\n+ for (reverseDependency in reverseDependenciesToTransfer) {\nreverseDependency.removeDependency(source)\nreverseDependency.addDependency(target)\n}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | There were still cyclic dependencies between merged cycles |
426,496 | 08.03.2022 10:49:58 | -3,600 | 45510412f32955309a2f537f2c550b7d22b25a19 | Jars were missing on the classpath during compilation in some cases | [
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -111,7 +111,6 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nfor (module in modulesMiner.getModules().getModules().values) {\nnewChild(\"path\") {\nsetAttribute(\"id\", \"path.module.${module.name}\")\n- getClassPath(module, macros)\nval cp = getClassPath(module, macros).map { it.absoluteFile.normalize() }\nfor (cpItem in cp) {\nif (cpItem.isFile) {\n@@ -247,7 +246,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\ncreateCompileTarget(\nmodules = listOf(module),\nclassPath = cp,\n- classPathModules = cycle.getTransitiveDependencies(),\n+ classPathModules = cycle.getTransitiveDependencies() + cycle,\ntargetName = targetName,\ntargetDependencies = targetDependencies,\noutputDir = getCompileOutputDir(module),\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Jars were missing on the classpath during compilation in some cases |
426,496 | 08.03.2022 13:20:35 | -3,600 | 0118852e41788650fd2705925fa4fc4f88af2bf4 | Some jars failed to resolve | [
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -59,7 +59,8 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nval resolver = ModuleResolver(modulesMiner.getModules(), ignoredModules)\nval mpsHome = modulesMiner.getModules().mpsHome ?: throw RuntimeException(\"mps.home not found\")\nval macros = Macros(mapOf(\n- \"platform_lib\" to File(mpsHome, \"lib\").toPath(),\n+ \"platform_lib\" to mpsHome.toPath().resolve(\"lib\"),\n+ \"lib_ext\" to mpsHome.toPath().resolve(\"lib\").resolve(\"ext\"),\n\"mps_home\" to mpsHome.toPath(),\n\"mps.home\" to mpsHome.toPath(),\n))\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/FoundModule.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/FoundModule.kt",
"diff": "@@ -102,8 +102,29 @@ class FoundModule(val moduleId: ModuleId,\nvar modulePath = owner.getRootOwner().path.getLocalAbsolutePath().toFile()\nif (modulePath.isFile) modulePath = modulePath.parentFile\nval moduleMacro = \"module\" to modulePath.toPath()\n- result += moduleDescriptor.resolveJavaLibs(macros.with(moduleMacro))\n- .map { it.toFile() }.filter { it.exists() }\n+ val marcosWithModule = macros.with(moduleMacro)\n+ result += moduleDescriptor.resolveJavaLibs(marcosWithModule)\n+ .map { it.normalize().toFile() }.filter {\n+ val exists = it.exists()\n+ if (!exists && it.name != \"classes\" && deploymentDescriptor == null) {\n+ println(\"File not found: $it, usedBy: $name\")\n+ }\n+ exists\n+ }\n+ }\n+ val deploymentDescriptor = deploymentDescriptor\n+ if (deploymentDescriptor != null) {\n+ var moduleHome = owner.path.getLocalAbsolutePath().toFile()\n+ if (moduleHome.isFile) moduleHome = moduleHome.parentFile\n+ val mpsHome = macros.macros[\"mps.home\"] ?: throw RuntimeException(\"mps.home not specified\")\n+ result += deploymentDescriptor.resolveJavaLibs(mpsHome, moduleHome.toPath())\n+ .map { it.normalize().toFile() }.filter {\n+ val exists = it.exists()\n+ if (!exists) {\n+ println(\"File not found: $it, usedBy: $name\")\n+ }\n+ exists\n+ }\n}\nreturn result\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModulesMiner.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModulesMiner.kt",
"diff": "*/\npackage org.modelix.buildtools\n-import org.modelix.buildtools.modulepersistence.DevkitDescriptor\n-import org.modelix.buildtools.modulepersistence.GeneratorDescriptor\n-import org.modelix.buildtools.modulepersistence.LanguageDescriptor\n-import org.modelix.buildtools.modulepersistence.SolutionDescriptor\n+import org.modelix.buildtools.modulepersistence.*\nimport org.w3c.dom.Element\nimport org.zeroturnaround.zip.ZipUtil\nimport java.io.File\n@@ -187,8 +184,11 @@ class ModulesMiner() {\nprivate val typeMap = mapOf(\"language\" to ModuleType.Language, \"solution\" to ModuleType.Solution, \"dev-kit\" to ModuleType.Devkit, \"devkit\" to ModuleType.Devkit, \"generator\" to ModuleType.Generator)\nprivate fun loadModules(xml: Element, owner: ModuleOwner) {\n- val typeString = if (xml.tagName == \"module\") xml.getAttribute(\"type\") else xml.tagName\n- val type = typeMap[typeString] ?: throw RuntimeException(\"Unknown module type: $typeString\")\n+ if (xml.tagName == \"module\") {\n+ val descriptor = DeploymentDescriptor(xml)\n+ modules.addModule(owner.getOrCreateModule(descriptor))\n+ } else {\n+ val type = typeMap[xml.tagName] ?: throw RuntimeException(\"Unknown module type: ${xml.tagName}\")\nval descriptor = when (type) {\nModuleType.Solution -> SolutionDescriptor(xml)\nModuleType.Language -> LanguageDescriptor(xml)\n@@ -202,6 +202,7 @@ class ModulesMiner() {\n}\n}\n}\n+ }\nprivate fun dependenciesFromModels(module: FoundModule, file: File) {\nif (file.isFile) {\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/modulepersistence/DeploymentDescriptor.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/modulepersistence/DeploymentDescriptor.kt",
"diff": "@@ -26,6 +26,7 @@ class DeploymentDescriptor(val xml: Element) {\nval classpath: List<String>\nval sourcesJarName: String\nval descriptorFileName: String\n+ val libraries: List<String>\ninit {\nval idString = xml.getAttribute(\"uuid\")\n@@ -47,16 +48,23 @@ class DeploymentDescriptor(val xml: Element) {\n.map { ModuleIdAndName.fromLanguageRef(it.getAttribute(\"id\")) }\nclasspath = xml.childElements(\"classpath\").flatMap { it.childElements(\"entry\") }\n.map { it.getAttribute(\"path\") }\n+ libraries = xml.childElements(\"library\").mapNotNull { it.getAttributeOrNull(\"jar\") }\nval sources = xml.childElements(\"sources\").first()\nsourcesJarName = sources.getAttribute(\"jar\")\ndescriptorFileName = sources.getAttribute(\"descriptor\")\n}\n+ private fun resolvePath(modulePath: Path, relativePath: String): Path {\n+ return modulePath.resolve(relativePath)\n+ }\n+\nfun resolveSourcesJar(modulePath: Path): Path {\n- return if (sourcesJarName == \".\") {\n- modulePath\n- } else {\n- modulePath.parent.resolve(sourcesJarName)\n+ return resolvePath(modulePath, sourcesJarName)\n+ }\n+\n+ fun resolveJavaLibs(mpsHome: Path, modulePath: Path): List<Path> {\n+ return libraries.map {\n+ if (it.startsWith(\"/\")) mpsHome.resolve(it.drop(1)) else modulePath.resolve(it)\n}\n}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Some jars failed to resolve |
426,496 | 08.03.2022 14:12:57 | -3,600 | 8808429e5fe755c68f62f8e62092d2e8bd7df55f | Cycle output dir was missing when compiling the modules of the cycle individually | [
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -198,13 +198,6 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nvar compileCycleIdSequence = 0\nval compileCycles = compileDependencyGraph.getNodes().filter { it.modules.any { it.owner is SourceModuleOwner } }\ncompileCycleIds = compileDependencyGraph.getNodes().filter { it.modules.size > 1 }.associateWith { ++compileCycleIdSequence }\n- val compileTargetNames = compileCycles.associateWith { cycle ->\n- if (cycle.modules.size == 1) {\n- getCompileTargetName(cycle.modules.first())\n- } else {\n- \"compile.cycle.${compileCycleIds[cycle]}\"\n- }\n- }\nfor (cycle in compileCycleIds) {\nnewChild(\"path\") {\nsetAttribute(\"id\", \"path.cycle${cycle.value}\")\n@@ -223,17 +216,15 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n}\nfor (cycle in compileCycles) {\nval sourceModules = cycle.modules.filter { it.owner is SourceModuleOwner }\n- var cycleOutputDir: File? = null\nval isCycle = cycle.modules.size > 1\nif (isCycle) {\n- cycleOutputDir = File(getCompileOutputDir(), compileTargetNames[cycle]!!)\ncreateCompileTarget(\nmodules = sourceModules,\nclassPath = sourceModules.flatMap { it.getOwnJars(macros) },\nclassPathModules = cycle.getTransitiveDependencies(),\n- targetName = compileTargetNames[cycle]!!,\n- targetDependencies = cycle.getDependencies().mapNotNull { compileTargetNames[it] },\n- outputDir = cycleOutputDir,\n+ targetName = getCompileTargetName(cycle)!!,\n+ targetDependencies = cycle.getDependencies().mapNotNull { getCompileTargetName(it) },\n+ outputDir = getCompileOutputDir(cycle)!!,\nmpsHome = mpsHome\n)\n}\n@@ -241,9 +232,9 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nfor (module in sourceModules) {\nval targetName = getCompileTargetName(module)\nvar cp = module.getOwnJars(macros).toList()\n- if (cycleOutputDir != null) cp += cycleOutputDir\n- var targetDependencies = cycle.getDependencies().mapNotNull { compileTargetNames[it] }\n- if (isCycle) targetDependencies += compileTargetNames[cycle]!!\n+ if (isCycle) cp += getCompileOutputDir(cycle)!!\n+ var targetDependencies = cycle.getDependencies().mapNotNull { getCompileTargetName(it) }\n+ if (isCycle) targetDependencies += getCompileTargetName(cycle)!!\ncreateCompileTarget(\nmodules = listOf(module),\nclassPath = cp,\n@@ -483,6 +474,11 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n}\n}\nfor (classPathModule in classPathModules) {\n+ getCompileOutputDir(classPathModule)?.let {\n+ newChild(\"pathelement\") {\n+ setAttribute(\"path\", it.absolutePath)\n+ }\n+ }\nnewChild(\"path\") {\nval pathName = if (classPathModule.modules.size > 1) {\n\"path.cycle${compileCycleIds[classPathModule]}\"\n@@ -514,6 +510,13 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n\"compile.${module.name}\"\n}\n}\n+ private fun getCompileTargetName(cycle: DependencyGraph<FoundModule, ModuleId>.DependencyNode): String? {\n+ if (!requiresCompile(cycle)) return null\n+ return if (cycle.modules.size == 1)\n+ getCompileTargetName(cycle.modules.first())\n+ else\n+ \"compile.cycle.${compileCycleIds[cycle]}\"\n+ }\nprivate fun getAssembleTargetName(module: FoundModule): String {\nreturn if (module.moduleType == ModuleType.Generator) {\n\"assemble.generator${getGeneratorIndex(module)}.${module.name}\"\n@@ -590,6 +593,16 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nFile(getCompileOutputDir(), module.name)\n}\n}\n+ private fun getCompileOutputDir(cycle: DependencyGraph<FoundModule, ModuleId>.DependencyNode): File? {\n+ if (!requiresCompile(cycle)) return null\n+ return if (cycle.modules.size == 1)\n+ getCompileOutputDir(cycle.modules.first())\n+ else\n+ File(getCompileOutputDir(), \"cycle.${compileCycleIds[cycle]}\")\n+ }\n+ private fun requiresCompile(cycle: DependencyGraph<FoundModule, ModuleId>.DependencyNode): Boolean {\n+ return cycle.modules.any { it.owner is SourceModuleOwner }\n+ }\nprivate fun getSourceGenDir(module: FoundModule): File {\nreturn if (module.moduleType == ModuleType.Generator) {\nmodule.owner.path.getLocalAbsolutePath().parent.resolve(\"generator\").resolve(\"source_gen\").toFile()\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/DependencyGraph.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/DependencyGraph.kt",
"diff": "@@ -60,10 +60,10 @@ abstract class DependencyGraph<ElementT, KeyT> {\ncycleBeforeMerge(cycle)\n}\n- val cycles: List<List<ElementT>> = cycleFinder.cycles.map { it.flatMap { it.modules } }\n+ val cycles: Set<Set<DependencyNode>> = cycleFinder.cycles\nfor (cycle in cycles) {\n- val nodesToMerge: List<DependencyNode> = cycle.mapNotNull { getNode(getKey(it)) }.distinct()\n+ val nodesToMerge: List<DependencyNode> = cycle.map { it.getMergedNode() }.distinct()\nif (nodesToMerge.size <= 1) continue\nfor (mergeSource in nodesToMerge.drop(1)) {\nmergeNodes(mergeSource, nodesToMerge.first())\n@@ -75,6 +75,8 @@ abstract class DependencyGraph<ElementT, KeyT> {\nif (source == target) {\nthrow RuntimeException(\"Attempt to merge a node into itself\")\n}\n+ if (!source.isValid()) throw RuntimeException(\"source is already merged\")\n+ if (!target.isValid()) throw RuntimeException(\"target is already merged\")\nsource.mergedInto = target\nfor (sourceModule in source.modules) {\nmodule2node[getKey(sourceModule)] = target\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModuleOwner.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModuleOwner.kt",
"diff": "package org.modelix.buildtools\nimport org.modelix.buildtools.modulepersistence.*\n+import java.io.File\nimport kotlin.io.path.pathString\nabstract class ModuleOwner(val path: ModulePath) {\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Cycle output dir was missing when compiling the modules of the cycle individually |
426,496 | 08.03.2022 18:52:03 | -3,600 | eace4dc93836820fa643b7d66435b92edd46a148 | Allow specifying modules to build by name and not just by path
Makes it a bit more readable and easier to maintain. | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.java",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.java",
"diff": "@@ -32,8 +32,11 @@ import java.nio.file.Path;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.Enumeration;\n+import java.util.HashSet;\nimport java.util.List;\n+import java.util.Set;\nimport java.util.jar.Manifest;\n+import java.util.stream.Collectors;\npublic class MPSBuildPlugin implements Plugin<Project> {\n@@ -90,21 +93,32 @@ public class MPSBuildPlugin implements Plugin<Project> {\nmodulesMiner.searchInFolder(mpsHome);\n}\n- List<Path> includedModules = settings.resolveIncludedModules(project.getProjectDir().toPath());\n+ List<Path> includedPaths = settings.resolveIncludedModules(project.getProjectDir().toPath());\n+ Set<String> includedModuleNames = settings.getIncludedModuleNames();\n+ Set<String> foundModuleNames = new HashSet<>();\nList<String> modulesToGenerate = null;\n- if (includedModules != null) {\n+ if (includedPaths != null || includedModuleNames != null) {\nmodulesToGenerate = new ArrayList<>();\nfor (FoundModule module : modulesMiner.getModules().getModules().values()) {\n+ if (includedModuleNames != null && includedModuleNames.contains(module.getName())) {\n+ modulesToGenerate.add(module.getModuleIdString());\n+ foundModuleNames.add(module.getName());\n+ } else if (includedPaths != null) {\nPath modulePath = module.getOwner().getPath().getLocalAbsolutePath();\n- if (includedModules.stream().anyMatch(include -> modulePath.startsWith(include))) {\n+ if (includedPaths.stream().anyMatch(include -> modulePath.startsWith(include))) {\nmodulesToGenerate.add(module.getModuleIdString());\n}\n}\n}\n+ }\n+ List<String> missingModuleNames = includedModuleNames.stream().filter(n -> !foundModuleNames.contains(n)).sorted().collect(Collectors.toList());\n+ if (!missingModuleNames.isEmpty()) {\n+ throw new RuntimeException(\"Modules not found: \" + missingModuleNames);\n+ }\nBuildScriptGenerator generator = new BuildScriptGenerator(\nmodulesMiner, ModuleId.Companion.fromString(modulesToGenerate),\n- Collections.emptySet(), Collections.emptyMap(), buildDir);\n+ Collections.emptySet(), settings.getMacros(project.getProjectDir().toPath()), buildDir);\nString xml = generator.generateXML();\ntry {\nFileUtils.writeStringToFile(antScriptFile, xml, StandardCharsets.UTF_8);\n"
},
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.java",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.java",
"diff": "*/\npackage org.modelix.gradle.mpsbuild;\n+import org.modelix.buildtools.Macros;\n+\nimport java.io.File;\nimport java.nio.file.Path;\nimport java.util.ArrayList;\nimport java.util.Collections;\n+import java.util.HashMap;\n+import java.util.HashSet;\nimport java.util.List;\n+import java.util.Map;\nimport java.util.Set;\nimport java.util.stream.Collectors;\npublic class MPSBuildSettings {\nprivate String mpsHome = null;\nprivate List<String> modules = new ArrayList<>();\n- private List<String> includedModules = new ArrayList<>();\n+ private List<String> includedPaths = new ArrayList<>();\n+ private Set<String> includedModuleNames = new HashSet<>();\n+ private Map<String, String> macros = new HashMap<>();\npublic boolean usingExistingMps() {\nreturn getMpsHome() != null;\n@@ -46,8 +53,22 @@ public class MPSBuildSettings {\nthis.modules.add(path);\n}\n- public void include(String moduleToInclude) {\n- includedModules.add(moduleToInclude);\n+ public void include(String pathToInclude) {\n+ includePath(pathToInclude);\n+ }\n+ public void includePath(String pathToInclude) {\n+ includedPaths.add(pathToInclude);\n+ }\n+ public void includeModule(String moduleName) {\n+ includedModuleNames.add(moduleName);\n+ }\n+ public Set<String> getIncludedModuleNames() {\n+ if (includedModuleNames.isEmpty()) return null;\n+ return includedModuleNames;\n+ }\n+\n+ public void macro(String name, String value) {\n+ macros.put(name, value);\n}\npublic List<Path> resolveModulePaths(Path workdir) {\n@@ -56,7 +77,15 @@ public class MPSBuildSettings {\n}\npublic List<Path> resolveIncludedModules(Path workdir) {\n- if (includedModules.isEmpty()) return null;\n- return includedModules.stream().map(path -> workdir.resolve(path).toAbsolutePath().normalize()).distinct().collect(Collectors.toList());\n+ if (includedPaths.isEmpty()) return null;\n+ return includedPaths.stream().map(path -> workdir.resolve(path).toAbsolutePath().normalize()).distinct().collect(Collectors.toList());\n+ }\n+\n+ public Macros getMacros(Path workdir) {\n+ Map<String, Path> resolvedMacros = new HashMap<>();\n+ for (Map.Entry<String, String> macro : macros.entrySet()) {\n+ resolvedMacros.put(macro.getKey(), workdir.resolve(macro.getValue()).toAbsolutePath().normalize());\n+ }\n+ return new Macros(resolvedMacros);\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -24,7 +24,7 @@ import kotlin.io.path.pathString\nclass BuildScriptGenerator(val modulesMiner: ModulesMiner,\nval modulesToGenerate: List<ModuleId>? = null,\nval ignoredModules: Set<ModuleId> = HashSet(),\n- val macros: Map<String, File> = HashMap(),\n+ val initialMacros: Macros = Macros(),\nval buildDir: File = File(\".\", \"build\")) {\nprivate var compileCycleIds: Map<DependencyGraph<FoundModule, ModuleId>.DependencyNode, Int> = HashMap()\n@@ -58,12 +58,12 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nval (plan, dependencyGraph) = generatePlan(modulesToGenerate_ - ignoredModules.toSet())\nval resolver = ModuleResolver(modulesMiner.getModules(), ignoredModules)\nval mpsHome = modulesMiner.getModules().mpsHome ?: throw RuntimeException(\"mps.home not found\")\n- val macros = Macros(mapOf(\n+ val macros = initialMacros.with(\n\"platform_lib\" to mpsHome.toPath().resolve(\"lib\"),\n\"lib_ext\" to mpsHome.toPath().resolve(\"lib\").resolve(\"ext\"),\n\"mps_home\" to mpsHome.toPath(),\n\"mps.home\" to mpsHome.toPath(),\n- ))\n+ )\nval dbf = DocumentBuilderFactory.newInstance()\nval db = dbf.newDocumentBuilder()\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/Macros.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/Macros.kt",
"diff": "@@ -20,7 +20,7 @@ import kotlin.io.path.absolutePathString\nclass Macros(val macros: Map<String, Path> = mapOf()) {\nfun with(key: String, value: Path) = with(key to value)\n- fun with(entry: Pair<String, Path>) = Macros(macros + entry)\n+ fun with(vararg entry: Pair<String, Path>) = Macros(macros + entry)\nfun resolve(input: String): Path {\nvar path = input\nfor (macro in macros) {\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Allow specifying modules to build by name and not just by path
Makes it a bit more readable and easier to maintain. |
426,496 | 09.03.2022 11:19:50 | -3,600 | 032eabfc2dcd32b896ef2d7f9dea72477ce6ea97 | Converted gradle-mpsbuild-plugin to kotlin | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/build.gradle",
"new_path": "gradle-mpsbuild-plugin/build.gradle",
"diff": "@@ -2,6 +2,7 @@ plugins {\nid 'java'\nid 'maven'\nid 'maven-publish'\n+ id \"org.jetbrains.kotlin.jvm\"\n}\ncompileJava {\n"
},
{
"change_type": "DELETE",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.java",
"new_path": null,
"diff": "-/*\n- * Licensed under the Apache License, Version 2.0 (the \"License\");\n- * you may not use this file except in compliance with the License.\n- * You may obtain a copy of the License at\n- *\n- * http://www.apache.org/licenses/LICENSE-2.0\n- *\n- * Unless required by applicable law or agreed to in writing, software\n- * distributed under the License is distributed on an \"AS IS\" BASIS,\n- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n- * See the License for the specific language governing permissions and\n- * limitations under the License.\n- */\n-package org.modelix.gradle.mpsbuild;\n-\n-import org.apache.commons.io.FileUtils;\n-import org.gradle.api.Action;\n-import org.gradle.api.Plugin;\n-import org.gradle.api.Project;\n-import org.gradle.api.Task;\n-import org.gradle.api.artifacts.Configuration;\n-import org.modelix.buildtools.BuildScriptGenerator;\n-import org.modelix.buildtools.FoundModule;\n-import org.modelix.buildtools.ModuleId;\n-import org.modelix.buildtools.ModulesMiner;\n-\n-import java.io.File;\n-import java.io.IOException;\n-import java.net.URL;\n-import java.nio.charset.StandardCharsets;\n-import java.nio.file.Path;\n-import java.util.ArrayList;\n-import java.util.Collections;\n-import java.util.Enumeration;\n-import java.util.HashSet;\n-import java.util.List;\n-import java.util.Set;\n-import java.util.jar.Manifest;\n-import java.util.stream.Collectors;\n-\n-public class MPSBuildPlugin implements Plugin<Project> {\n-\n- @Override\n- public void apply(Project project_) {\n- MPSBuildSettings settings = project_.getExtensions().create(\"mpsBuild\", MPSBuildSettings.class);\n- project_.afterEvaluate((Project project) -> {\n- settings.validate();\n-\n- Manifest manifest = readManifest();\n- String modelixVersion = manifest.getMainAttributes().getValue(\"modelix-Version\");\n- Configuration genConfig = project.getConfigurations().detachedConfiguration(\n- project.getDependencies().create(\"org.modelix:mps-build-tools:\" + modelixVersion)\n- );\n-\n- final Configuration mpsConfig;\n- final Configuration pluginsConfig;\n- if (settings.usingExistingMps()) {\n- mpsConfig = null;\n- pluginsConfig = null;\n- // We are using an existing MPS. We also expect the user to add the version of MPS Extensions and\n- // Modelix that they intend to use\n- } else {\n- // We are not using an existing MPS, therefore we will add one and we will add dependencies\n- // to MPS Extensions and Modelix as well\n- String mpsVersion = manifest.getMainAttributes().getValue(\"MPS-Version\");\n- mpsConfig = project.getConfigurations().detachedConfiguration(\n- project.getDependencies().create(\"com.jetbrains:mps:\" + mpsVersion )\n- );\n- pluginsConfig = project.getConfigurations().detachedConfiguration(\n- project.getDependencies().create(\"org.modelix:mps-model-plugin:\" + modelixVersion));\n- }\n-\n- File buildDir = new File(new File(project.getProjectDir(), \"build\"), \"mpsbuild\");\n- File antScriptFile = new File(buildDir, \"build-modules.xml\");\n- Task generatorAntScript = project.getTasks().create(\"generatorAntScript\");\n- Action<Task> action = task -> {\n- ModulesMiner modulesMiner = new ModulesMiner();\n- for (Path modulePath : settings.resolveModulePaths(project.getProjectDir().toPath())) {\n- System.out.println(\"Searching for modules in \" + modulePath);\n- modulesMiner.searchInFolder(modulePath.toFile());\n- }\n- System.out.println(\"Found modules:\");\n- for (FoundModule module : modulesMiner.getModules().getModules().values()) {\n- System.out.println(\" \" + module.getOwner().getPath().getLocalAbsolutePath());\n- }\n- String mpsPath = settings.getMpsHome();\n- if (mpsPath != null) {\n- File mpsHome = project.getProjectDir().toPath().resolve(Path.of(mpsPath)).normalize().toFile();\n- System.out.println(\"mps.home = \" + mpsHome);\n- if (!mpsHome.exists()) {\n- throw new RuntimeException(mpsHome + \" doesn't exist\");\n- }\n- modulesMiner.searchInFolder(mpsHome);\n- }\n-\n- List<Path> includedPaths = settings.resolveIncludedModules(project.getProjectDir().toPath());\n- Set<String> includedModuleNames = settings.getIncludedModuleNames();\n- Set<String> foundModuleNames = new HashSet<>();\n- List<String> modulesToGenerate = null;\n- if (includedPaths != null || includedModuleNames != null) {\n- modulesToGenerate = new ArrayList<>();\n- for (FoundModule module : modulesMiner.getModules().getModules().values()) {\n- if (includedModuleNames != null && includedModuleNames.contains(module.getName())) {\n- modulesToGenerate.add(module.getModuleIdString());\n- foundModuleNames.add(module.getName());\n- } else if (includedPaths != null) {\n- Path modulePath = module.getOwner().getPath().getLocalAbsolutePath();\n- if (includedPaths.stream().anyMatch(include -> modulePath.startsWith(include))) {\n- modulesToGenerate.add(module.getModuleIdString());\n- }\n- }\n- }\n- }\n- List<String> missingModuleNames = includedModuleNames.stream().filter(n -> !foundModuleNames.contains(n)).sorted().collect(Collectors.toList());\n- if (!missingModuleNames.isEmpty()) {\n- throw new RuntimeException(\"Modules not found: \" + missingModuleNames);\n- }\n-\n- BuildScriptGenerator generator = new BuildScriptGenerator(\n- modulesMiner, ModuleId.Companion.fromString(modulesToGenerate),\n- Collections.emptySet(), settings.getMacros(project.getProjectDir().toPath()), buildDir);\n- String xml = generator.generateXML();\n- try {\n- FileUtils.writeStringToFile(antScriptFile, xml, StandardCharsets.UTF_8);\n- System.out.println(\"Build script written to \" + antScriptFile.getAbsolutePath());\n- } catch (IOException e) {\n- throw new RuntimeException(e);\n- }\n- };\n- generatorAntScript.setActions(Collections.singletonList(action));\n- });\n- }\n-\n- private Manifest readManifest() {\n- Enumeration<URL> resources = null;\n- try {\n- resources = getClass().getClassLoader().getResources(\"META-INF/MANIFEST.MF\");\n- while (resources.hasMoreElements()) {\n- try {\n- Manifest manifest = new Manifest(resources.nextElement().openStream());\n- if (manifest.getMainAttributes().getValue(\"modelix-Version\") != null) {\n- return manifest;\n- }\n- } catch (IOException ex) {\n- throw new RuntimeException(\"Failed to read MANIFEST.MF\", ex);\n- }\n- }\n- } catch (IOException ex) {\n- throw new RuntimeException(\"Failed to read MANIFEST.MF\", ex);\n- }\n- throw new RuntimeException(\"No MANIFEST.MF found containing 'modelix-Version'\");\n- }\n-}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "+/*\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.modelix.gradle.mpsbuild\n+\n+import org.apache.commons.io.FileUtils\n+import org.gradle.api.Action\n+import org.gradle.api.Plugin\n+import org.gradle.api.Project\n+import org.gradle.api.Task\n+import org.gradle.api.artifacts.Configuration\n+import org.gradle.api.publish.PublicationContainer\n+import org.gradle.api.publish.PublishingExtension\n+import org.modelix.buildtools.ModuleId.Companion.fromString\n+import org.modelix.gradle.mpsbuild.MPSBuildSettings\n+import org.modelix.buildtools.FoundModule\n+import java.lang.RuntimeException\n+import org.modelix.buildtools.BuildScriptGenerator\n+import org.modelix.buildtools.ModuleId\n+import org.modelix.buildtools.ModulesMiner\n+import java.io.File\n+import java.io.IOException\n+import java.net.URL\n+import java.nio.charset.StandardCharsets\n+import java.nio.file.Path\n+import java.util.ArrayList\n+import java.util.Enumeration\n+import java.util.HashSet\n+import java.util.jar.Manifest\n+import java.util.stream.Collectors\n+\n+class MPSBuildPlugin : Plugin<Project> {\n+ override fun apply(project_: Project) {\n+ val settings = project_.extensions.create(\"mpsBuild\", MPSBuildSettings::class.java)\n+ project_.afterEvaluate { project: Project ->\n+ settings.validate()\n+ val manifest = readManifest()\n+ val modelixVersion = manifest.mainAttributes.getValue(\"modelix-Version\")\n+ val genConfig = project.configurations.detachedConfiguration(\n+ project.dependencies.create(\"org.modelix:mps-build-tools:$modelixVersion\")\n+ )\n+ val mpsConfig: Configuration?\n+ val pluginsConfig: Configuration?\n+ if (settings.usingExistingMps()) {\n+ mpsConfig = null\n+ pluginsConfig = null\n+ // We are using an existing MPS. We also expect the user to add the version of MPS Extensions and\n+ // Modelix that they intend to use\n+ } else {\n+ // We are not using an existing MPS, therefore we will add one and we will add dependencies\n+ // to MPS Extensions and Modelix as well\n+ val mpsVersion = manifest.mainAttributes.getValue(\"MPS-Version\")\n+ mpsConfig = project.configurations.detachedConfiguration(\n+ project.dependencies.create(\"com.jetbrains:mps:$mpsVersion\")\n+ )\n+ pluginsConfig = project.configurations.detachedConfiguration(\n+ project.dependencies.create(\"org.modelix:mps-model-plugin:$modelixVersion\"))\n+ }\n+ val buildDir = File(File(project.projectDir, \"build\"), \"mpsbuild\")\n+ val antScriptFile = File(buildDir, \"build-modules.xml\")\n+ val generatorAntScript = project.tasks.create(\"generatorAntScript\")\n+ val action = Action { task: Task? ->\n+ val modulesMiner = ModulesMiner()\n+ for (modulePath in settings.resolveModulePaths(project.projectDir.toPath())) {\n+ println(\"Searching for modules in $modulePath\")\n+ modulesMiner.searchInFolder(modulePath.toFile())\n+ }\n+ println(\"Found modules:\")\n+ for (module in modulesMiner.getModules().getModules().values) {\n+ println(\" \" + module.owner.path.getLocalAbsolutePath())\n+ }\n+ val mpsPath = settings.mpsHome\n+ if (mpsPath != null) {\n+ val mpsHome = project.projectDir.toPath().resolve(Path.of(mpsPath)).normalize().toFile()\n+ println(\"mps.home = $mpsHome\")\n+ if (!mpsHome.exists()) {\n+ throw RuntimeException(\"$mpsHome doesn't exist\")\n+ }\n+ modulesMiner.searchInFolder(mpsHome)\n+ }\n+ val includedPaths = settings.resolveIncludedModules(project.projectDir.toPath())\n+ val includedModuleNames = settings.getIncludedModuleNames()\n+ val foundModuleNames: MutableSet<String> = HashSet()\n+ var modulesToGenerate: MutableList<ModuleId>? = null\n+ if (includedPaths != null || includedModuleNames != null) {\n+ modulesToGenerate = ArrayList()\n+ for (module in modulesMiner.getModules().getModules().values) {\n+ if (includedModuleNames != null && includedModuleNames.contains(module.name)) {\n+ modulesToGenerate.add(module.moduleId)\n+ foundModuleNames.add(module.name)\n+ } else if (includedPaths != null) {\n+ val modulePath = module.owner.path.getLocalAbsolutePath()\n+ if (includedPaths.stream().anyMatch { include: Path? -> modulePath.startsWith(include) }) {\n+ modulesToGenerate.add(module.moduleId)\n+ }\n+ }\n+ }\n+ }\n+ val missingModuleNames = includedModuleNames!!.stream().filter { n: String -> !foundModuleNames.contains(n) }.sorted().collect(Collectors.toList())\n+ if (!missingModuleNames.isEmpty()) {\n+ throw RuntimeException(\"Modules not found: $missingModuleNames\")\n+ }\n+ val generator = BuildScriptGenerator(\n+ modulesMiner, modulesToGenerate, emptySet(), settings.getMacros(project.projectDir.toPath()), buildDir)\n+ val xml = generator.generateXML()\n+ try {\n+ FileUtils.writeStringToFile(antScriptFile, xml, StandardCharsets.UTF_8)\n+ println(\"Build script written to \" + antScriptFile.absolutePath)\n+ } catch (e: IOException) {\n+ throw RuntimeException(e)\n+ }\n+ }\n+ generatorAntScript.actions = listOf<Action<in Task>>(action)\n+ }\n+// project_.extensions.findByType(PublishingExtension::class.java)!!.publications { container: PublicationContainer? -> }\n+ }\n+\n+ private fun readManifest(): Manifest {\n+ var resources: Enumeration<URL>? = null\n+ try {\n+ resources = javaClass.classLoader.getResources(\"META-INF/MANIFEST.MF\")\n+ while (resources.hasMoreElements()) {\n+ try {\n+ val manifest = Manifest(resources.nextElement().openStream())\n+ if (manifest.mainAttributes.getValue(\"modelix-Version\") != null) {\n+ return manifest\n+ }\n+ } catch (ex: IOException) {\n+ throw RuntimeException(\"Failed to read MANIFEST.MF\", ex)\n+ }\n+ }\n+ } catch (ex: IOException) {\n+ throw RuntimeException(\"Failed to read MANIFEST.MF\", ex)\n+ }\n+ throw RuntimeException(\"No MANIFEST.MF found containing 'modelix-Version'\")\n+ }\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "DELETE",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.java",
"new_path": null,
"diff": "-/*\n- * Licensed under the Apache License, Version 2.0 (the \"License\");\n- * you may not use this file except in compliance with the License.\n- * You may obtain a copy of the License at\n- *\n- * http://www.apache.org/licenses/LICENSE-2.0\n- *\n- * Unless required by applicable law or agreed to in writing, software\n- * distributed under the License is distributed on an \"AS IS\" BASIS,\n- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n- * See the License for the specific language governing permissions and\n- * limitations under the License.\n- */\n-package org.modelix.gradle.mpsbuild;\n-\n-import org.modelix.buildtools.Macros;\n-\n-import java.io.File;\n-import java.nio.file.Path;\n-import java.util.ArrayList;\n-import java.util.Collections;\n-import java.util.HashMap;\n-import java.util.HashSet;\n-import java.util.List;\n-import java.util.Map;\n-import java.util.Set;\n-import java.util.stream.Collectors;\n-\n-public class MPSBuildSettings {\n- private String mpsHome = null;\n- private List<String> modules = new ArrayList<>();\n- private List<String> includedPaths = new ArrayList<>();\n- private Set<String> includedModuleNames = new HashSet<>();\n- private Map<String, String> macros = new HashMap<>();\n-\n- public boolean usingExistingMps() {\n- return getMpsHome() != null;\n- }\n-\n- public void validate() {\n- // nothing to check at the moment\n- }\n-\n- public String getMpsHome() {\n- return this.mpsHome;\n- }\n-\n- public void setMpsHome(String mpsHome) {\n- this.mpsHome = mpsHome;\n- }\n-\n- public void search(String path) {\n- this.modules.add(path);\n- }\n-\n- public void include(String pathToInclude) {\n- includePath(pathToInclude);\n- }\n- public void includePath(String pathToInclude) {\n- includedPaths.add(pathToInclude);\n- }\n- public void includeModule(String moduleName) {\n- includedModuleNames.add(moduleName);\n- }\n- public Set<String> getIncludedModuleNames() {\n- if (includedModuleNames.isEmpty()) return null;\n- return includedModuleNames;\n- }\n-\n- public void macro(String name, String value) {\n- macros.put(name, value);\n- }\n-\n- public List<Path> resolveModulePaths(Path workdir) {\n- if (modules.isEmpty()) return Collections.singletonList(workdir);\n- return modules.stream().map(path -> workdir.resolve(path).normalize()).distinct().collect(Collectors.toList());\n- }\n-\n- public List<Path> resolveIncludedModules(Path workdir) {\n- if (includedPaths.isEmpty()) return null;\n- return includedPaths.stream().map(path -> workdir.resolve(path).toAbsolutePath().normalize()).distinct().collect(Collectors.toList());\n- }\n-\n- public Macros getMacros(Path workdir) {\n- Map<String, Path> resolvedMacros = new HashMap<>();\n- for (Map.Entry<String, String> macro : macros.entrySet()) {\n- resolvedMacros.put(macro.getKey(), workdir.resolve(macro.getValue()).toAbsolutePath().normalize());\n- }\n- return new Macros(resolvedMacros);\n- }\n-}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.kt",
"diff": "+/*\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.modelix.gradle.mpsbuild\n+\n+import org.modelix.buildtools.Macros\n+import java.nio.file.Path\n+import java.util.ArrayList\n+import java.util.HashMap\n+import java.util.HashSet\n+import java.util.stream.Collectors\n+\n+open class MPSBuildSettings {\n+ var mpsHome: String? = null\n+ private val modules: MutableList<String> = ArrayList()\n+ private val includedPaths: MutableList<String> = ArrayList()\n+ private val includedModuleNames: MutableSet<String> = HashSet()\n+ private val macros: MutableMap<String, String> = HashMap()\n+ fun usingExistingMps(): Boolean {\n+ return mpsHome != null\n+ }\n+\n+ fun validate() {\n+ // nothing to check at the moment\n+ }\n+\n+ fun search(path: String) {\n+ modules.add(path)\n+ }\n+\n+ fun include(pathToInclude: String) {\n+ includePath(pathToInclude)\n+ }\n+\n+ fun includePath(pathToInclude: String) {\n+ includedPaths.add(pathToInclude)\n+ }\n+\n+ fun includeModule(moduleName: String) {\n+ includedModuleNames.add(moduleName)\n+ }\n+\n+ fun getIncludedModuleNames(): Set<String>? {\n+ return if (includedModuleNames.isEmpty()) null else includedModuleNames\n+ }\n+\n+ fun macro(name: String, value: String) {\n+ macros[name] = value\n+ }\n+\n+ fun resolveModulePaths(workdir: Path): List<Path> {\n+ return if (modules.isEmpty()) listOf(workdir) else modules.stream().map { path: String? -> workdir.resolve(path).normalize() }.distinct().collect(Collectors.toList())\n+ }\n+\n+ fun resolveIncludedModules(workdir: Path): List<Path>? {\n+ return if (includedPaths.isEmpty()) null else includedPaths.stream().map { path: String? -> workdir.resolve(path).toAbsolutePath().normalize() }.distinct().collect(Collectors.toList())\n+ }\n+\n+ fun getMacros(workdir: Path): Macros {\n+ val resolvedMacros: MutableMap<String, Path> = HashMap()\n+ for ((key, value) in macros) {\n+ resolvedMacros[key] = workdir.resolve(value).toAbsolutePath().normalize()\n+ }\n+ return Macros(resolvedMacros)\n+ }\n+}\n\\ No newline at end of file\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Converted gradle-mpsbuild-plugin to kotlin |
426,496 | 09.03.2022 18:38:43 | -3,600 | 4b85ec2fa9d297d652cf495ca125b43241822b4e | generate maven publications for all modules | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "package org.modelix.gradle.mpsbuild\nimport org.apache.commons.io.FileUtils\n-import org.gradle.api.Action\n-import org.gradle.api.Plugin\n-import org.gradle.api.Project\n-import org.gradle.api.Task\n+import org.gradle.api.*\nimport org.gradle.api.artifacts.Configuration\n-import org.gradle.api.publish.PublicationContainer\n+import org.gradle.api.internal.project.DefaultAntBuilder\n+import org.gradle.api.internal.project.ant.AntLoggingAdapter\nimport org.gradle.api.publish.PublishingExtension\n-import org.modelix.buildtools.ModuleId.Companion.fromString\n-import org.modelix.gradle.mpsbuild.MPSBuildSettings\n-import org.modelix.buildtools.FoundModule\n+import org.gradle.api.publish.maven.MavenPublication\nimport java.lang.RuntimeException\nimport org.modelix.buildtools.BuildScriptGenerator\nimport org.modelix.buildtools.ModuleId\nimport org.modelix.buildtools.ModulesMiner\n+import org.modelix.buildtools.newChild\nimport java.io.File\nimport java.io.IOException\nimport java.net.URL\n@@ -68,21 +65,86 @@ class MPSBuildPlugin : Plugin<Project> {\n}\nval buildDir = File(File(project.projectDir, \"build\"), \"mpsbuild\")\nval antScriptFile = File(buildDir, \"build-modules.xml\")\n- val generatorAntScript = project.tasks.create(\"generatorAntScript\")\n+ val antScriptTask = project.tasks.create(\"generatorAntScript\")\nval action = Action { task: Task? ->\n+ generateAntScript(settings, project, buildDir, antScriptFile)\n+ }\n+ antScriptTask.actions = listOf(action)\n+\n+ val generator = generateAntScript(settings, project, buildDir, antScriptFile)\n+ val ant = DefaultAntBuilder(project, AntLoggingAdapter())\n+ ant.importBuild(antScriptFile) { \"mpsbuild-$it\" }\n+\n+ project.configurations.create(\"mpsmodules\")\n+\n+ val publishing = project.extensions.findByType(PublishingExtension::class.java)\n+ publishing?.apply {\n+ publications {\n+ for (publicationData in generator.publications) {\n+ it.create(\"mpsmodule-${publicationData.name}-all\", MavenPublication::class.java) {\n+ it.apply {\n+ groupId = \"org.modelix\"\n+ artifactId = publicationData.name + \"-all\"\n+ version = (\"\"+project.version).ifEmpty { \"0.1\" }\n+ pom {\n+ it.withXml {\n+ it.asElement().newChild(\"dependencies\") {\n+ for (jar in publicationData.jars) {\n+ newChild(\"dependency\") {\n+ newChild(\"groupId\", groupId)\n+ newChild(\"artifactId\", publicationData.name)\n+ newChild(\"version\", version)\n+ newChild(\"classifier\", jar.classifier)\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+\n+ it.create(\"mpsmodule-${publicationData.name}\", MavenPublication::class.java) {\n+ it.apply {\n+ groupId = \"org.modelix\"\n+ artifactId = publicationData.name\n+ version = (\"\"+project.version).ifEmpty { \"0.1\" }\n+ for (jar in publicationData.jars) {\n+ val artifact = project.artifacts.add(\"mpsmodules\", jar.file) {\n+ it.type = \"jar\"\n+ it.classifier = jar.classifier\n+ it.builtBy(\"mpsbuild-assemble\")\n+ }\n+ artifact(artifact)\n+ }\n+// pom {\n+// it.withXml {\n+// it.asElement().newChild(\"dependencies\") {\n+// newChild(\"dependency\") {\n+// newChild(\"groupId\", groupId)\n+// newChild(\"artifactId\", \"abcd\")\n+// newChild(\"version\", version)\n+// newChild(\"classifier\", \"\")\n+// }\n+// }\n+// }\n+// }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+\n+ }\n+\n+ private fun generateAntScript(settings: MPSBuildSettings, project: Project, buildDir: File, antScriptFile: File): BuildScriptGenerator {\nval modulesMiner = ModulesMiner()\nfor (modulePath in settings.resolveModulePaths(project.projectDir.toPath())) {\n- println(\"Searching for modules in $modulePath\")\nmodulesMiner.searchInFolder(modulePath.toFile())\n}\n- println(\"Found modules:\")\n- for (module in modulesMiner.getModules().getModules().values) {\n- println(\" \" + module.owner.path.getLocalAbsolutePath())\n- }\nval mpsPath = settings.mpsHome\nif (mpsPath != null) {\nval mpsHome = project.projectDir.toPath().resolve(Path.of(mpsPath)).normalize().toFile()\n- println(\"mps.home = $mpsHome\")\nif (!mpsHome.exists()) {\nthrow RuntimeException(\"$mpsHome doesn't exist\")\n}\n@@ -115,14 +177,10 @@ class MPSBuildPlugin : Plugin<Project> {\nval xml = generator.generateXML()\ntry {\nFileUtils.writeStringToFile(antScriptFile, xml, StandardCharsets.UTF_8)\n- println(\"Build script written to \" + antScriptFile.absolutePath)\n} catch (e: IOException) {\nthrow RuntimeException(e)\n}\n- }\n- generatorAntScript.actions = listOf<Action<in Task>>(action)\n- }\n-// project_.extensions.findByType(PublishingExtension::class.java)!!.publications { container: PublicationContainer? -> }\n+ return generator\n}\nprivate fun readManifest(): Manifest {\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -28,6 +28,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nval buildDir: File = File(\".\", \"build\")) {\nprivate var compileCycleIds: Map<DependencyGraph<FoundModule, ModuleId>.DependencyNode, Int> = HashMap()\n+ val publications: MutableList<Publication> = ArrayList();\nfun buildModules(antScriptFile: File = File.createTempFile(\"mps-build-script\", \".xml\", File(\".\")), outputHandler: ((String)->Unit)? = null) {\nval xml = generateXML()\n@@ -215,12 +216,12 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n}\n}\nfor (cycle in compileCycles) {\n- val sourceModules = cycle.modules.filter { it.owner is SourceModuleOwner }\n+ val cycleSourceModules = cycle.modules.filter { it.owner is SourceModuleOwner }\nval isCycle = cycle.modules.size > 1\nif (isCycle) {\ncreateCompileTarget(\n- modules = sourceModules,\n- classPath = sourceModules.flatMap { it.getOwnJars(macros) },\n+ modules = cycleSourceModules,\n+ classPath = cycleSourceModules.flatMap { it.getOwnJars(macros) },\nclassPathModules = cycle.getTransitiveDependencies(),\ntargetName = getCompileTargetName(cycle)!!,\ntargetDependencies = cycle.getDependencies().mapNotNull { getCompileTargetName(it) },\n@@ -229,7 +230,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n)\n}\n- for (module in sourceModules) {\n+ for (module in cycleSourceModules) {\nval targetName = getCompileTargetName(module)\nvar cp = module.getOwnJars(macros).toList()\nif (isCycle) cp += getCompileOutputDir(cycle)!!\n@@ -245,6 +246,16 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nmpsHome = mpsHome\n)\n}\n+\n+ }\n+ publications += modulesToCompile.map { it.owner }.distinct().filterIsInstance<SourceModuleOwner>().map { owner ->\n+ val nonGen = owner.modules.values.first { it.moduleType != ModuleType.Generator }\n+ val gen = owner.modules.values.filter { it.moduleType == ModuleType.Generator }\n+ Publication(\n+ nonGen.name,\n+ listOf(PublicationJar(getJarFile(nonGen), \"\"), PublicationJar(getSrcJarFile(nonGen), \"src\")) +\n+ gen.mapIndexed { i, m -> PublicationJar(getJarFile(m), if (i == 0) \"generator\" else \"$i-generator\") }\n+ )\n}\n// target: compile\n@@ -431,7 +442,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n) {\nnewChild(\"target\") {\nsetAttribute(\"name\", targetName)\n- setAttribute(\"depends\", targetDependencies.joinToString(\", \"))\n+ setAttribute(\"depends\", (listOf(\"generate\") + targetDependencies).joinToString(\", \"))\nnewChild(\"mkdir\") {\nsetAttribute(\"dir\", outputDir.absolutePath)\n@@ -638,4 +649,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nval dependencyGraph = planBuilder.build(modulesToGenerate.mapNotNull { modulesMiner.getModules().getModules()[it] })\nreturn planBuilder.plan to dependencyGraph\n}\n+\n+ class Publication(val name: String, val jars: List<PublicationJar>)\n+ class PublicationJar(val file: File, val classifier: String)\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/DependencyGraph.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/DependencyGraph.kt",
"diff": "@@ -53,9 +53,12 @@ abstract class DependencyGraph<ElementT, KeyT> {\nprotected open fun cycleBeforeMerge(cycle: Set<DependencyNode>) {}\nfun mergeCycles() {\n+ for (i in 0..5) {\nval cycleFinder = CycleFinder()\ngetNodes().forEach { cycleFinder.process(it) }\n+ if (cycleFinder.cycles.isEmpty()) break\n+\nfor (cycle in cycleFinder.cycles) {\ncycleBeforeMerge(cycle)\n}\n@@ -71,6 +74,21 @@ abstract class DependencyGraph<ElementT, KeyT> {\n}\n}\n+ // check post conditions\n+ module2node.forEach { require(it.value.isValid()) { \"${it.key} is still pointing to a merged node\" } }\n+ module2node.values.forEach { node ->\n+ node.getDependencies().forEach { dep ->\n+ require(dep.isValid()) { \"$node is pointing to merged dependency $dep\" }\n+ }\n+ }\n+ val cycleFinder2 = CycleFinder()\n+ getNodes().forEach { cycleFinder2.process(it) }\n+ cycleFinder2.cycles.forEach { require(false) { \"Still contains cycles: $it\" } }\n+ getNodes().flatMap { n -> n.modules.map { it to n } }.groupBy { it.first }.forEach {\n+ require(it.value.size == 1) { \"${it.key} found in multiple nodes\" }\n+ }\n+ }\n+\nprotected fun mergeNodes(source: DependencyNode, target: DependencyNode) {\nif (source == target) {\nthrow RuntimeException(\"Attempt to merge a node into itself\")\n@@ -106,7 +124,8 @@ abstract class DependencyGraph<ElementT, KeyT> {\nvar mergedInto: DependencyNode? = null\noverride fun toString(): String {\n- return modules.joinToString(\", \") { it.toString() }\n+ if (modules.size == 1) return modules.first().toString()\n+ return \"[\" + modules.joinToString(\", \") { it.toString() } + \"]\"\n}\nfun isValid() = mergedInto == null\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/GeneratorDependencyGraph.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/GeneratorDependencyGraph.kt",
"diff": "@@ -38,13 +38,4 @@ class GeneratorDependencyGraph(val moduleResolver: ModuleResolver) : DependencyG\nmergeGeneratorsAndLanguages()\nsuper.postprocess()\n}\n-\n- override fun cycleBeforeMerge(cycle: Set<DependencyNode>) {\n- val modules = cycle.flatMap { it.modules }\n- .filter { it.moduleType == ModuleType.Language || it.moduleType == ModuleType.Solution }\n- if (!modules.any { it.owner is SourceModuleOwner }) return\n- if (modules.size > 1) {\n- println(\"Dependency cycle: \" + modules.joinToString(\" -> \") { it.name })\n- }\n- }\n}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/XmlUtils.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/XmlUtils.kt",
"diff": "@@ -61,6 +61,14 @@ fun Element.newChild(tag: String, body: Element.()->Unit): Element {\nreturn child\n}\n+fun Element.newChild(tag: String, text: String, body: (Element.()->Unit)? = null): Element {\n+ val child = ownerDocument.createElement(tag)\n+ appendChild(child)\n+ child.appendChild(ownerDocument.createTextNode(text))\n+ if (body != null) child.apply(body)\n+ return child\n+}\n+\nfun Element.getAttribute(name: String, default: String): String {\nreturn getAttributeOrNull(name) ?: default\n}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | generate maven publications for all modules |
426,496 | 09.03.2022 20:13:06 | -3,600 | 2ca127d77bb9ad1efbd0759b567c1bbdf547aaea | dependencies between modules added to the pom.xml | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -83,7 +83,7 @@ class MPSBuildPlugin : Plugin<Project> {\nfor (publicationData in generator.publications) {\nit.create(\"mpsmodule-${publicationData.name}-all\", MavenPublication::class.java) {\nit.apply {\n- groupId = \"org.modelix\"\n+ groupId = project.group.toString()\nartifactId = publicationData.name + \"-all\"\nversion = (\"\"+project.version).ifEmpty { \"0.1\" }\npom {\n@@ -105,7 +105,7 @@ class MPSBuildPlugin : Plugin<Project> {\nit.create(\"mpsmodule-${publicationData.name}\", MavenPublication::class.java) {\nit.apply {\n- groupId = \"org.modelix\"\n+ groupId = project.group.toString()\nartifactId = publicationData.name\nversion = (\"\"+project.version).ifEmpty { \"0.1\" }\nfor (jar in publicationData.jars) {\n@@ -116,18 +116,19 @@ class MPSBuildPlugin : Plugin<Project> {\n}\nartifact(artifact)\n}\n-// pom {\n-// it.withXml {\n-// it.asElement().newChild(\"dependencies\") {\n-// newChild(\"dependency\") {\n-// newChild(\"groupId\", groupId)\n-// newChild(\"artifactId\", \"abcd\")\n-// newChild(\"version\", version)\n-// newChild(\"classifier\", \"\")\n-// }\n-// }\n-// }\n-// }\n+ pom {\n+ it.withXml {\n+ it.asElement().newChild(\"dependencies\") {\n+ for (dependency in publicationData.dependencies) {\n+ newChild(\"dependency\") {\n+ newChild(\"groupId\", project.group.toString())\n+ newChild(\"artifactId\", \"$dependency-all\")\n+ newChild(\"version\", version)\n+ }\n+ }\n+ }\n+ }\n+ }\n}\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -254,7 +254,13 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nPublication(\nnonGen.name,\nlistOf(PublicationJar(getJarFile(nonGen), \"\"), PublicationJar(getSrcJarFile(nonGen), \"src\")) +\n- gen.mapIndexed { i, m -> PublicationJar(getJarFile(m), if (i == 0) \"generator\" else \"$i-generator\") }\n+ gen.mapIndexed { i, m -> PublicationJar(getJarFile(m), if (i == 0) \"generator\" else \"$i-generator\") },\n+ owner.modules.values\n+ .flatMap { it.getClassPathDependencies(resolver) }\n+ .map { it.owner }\n+ .filterIsInstance<SourceModuleOwner>()\n+ .distinct()\n+ .map { it.modules.values.first().name }\n)\n}\n@@ -650,6 +656,6 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nreturn planBuilder.plan to dependencyGraph\n}\n- class Publication(val name: String, val jars: List<PublicationJar>)\n+ class Publication(val name: String, val jars: List<PublicationJar>, val dependencies: List<String>)\nclass PublicationJar(val file: File, val classifier: String)\n}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | dependencies between modules added to the pom.xml |
426,496 | 09.03.2022 22:20:38 | -3,600 | cdf45b0a605bab2ac905d8124217e6ec29fc62c4 | publications names changed to allow depending on a module without the "-all" suffix | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -81,10 +81,10 @@ class MPSBuildPlugin : Plugin<Project> {\npublishing?.apply {\npublications {\nfor (publicationData in generator.publications) {\n- it.create(\"mpsmodule-${publicationData.name}-all\", MavenPublication::class.java) {\n+ it.create(\"mpsmodule-${publicationData.name}\", MavenPublication::class.java) {\nit.apply {\ngroupId = project.group.toString()\n- artifactId = publicationData.name + \"-all\"\n+ artifactId = publicationData.name\nversion = (\"\"+project.version).ifEmpty { \"0.1\" }\npom {\nit.withXml {\n@@ -92,7 +92,7 @@ class MPSBuildPlugin : Plugin<Project> {\nfor (jar in publicationData.jars) {\nnewChild(\"dependency\") {\nnewChild(\"groupId\", groupId)\n- newChild(\"artifactId\", publicationData.name)\n+ newChild(\"artifactId\", \"mpsmodule-\" + publicationData.name)\nnewChild(\"version\", version)\nnewChild(\"classifier\", jar.classifier)\n}\n@@ -103,10 +103,10 @@ class MPSBuildPlugin : Plugin<Project> {\n}\n}\n- it.create(\"mpsmodule-${publicationData.name}\", MavenPublication::class.java) {\n+ it.create(\"mpsmodule-jars-${publicationData.name}\", MavenPublication::class.java) {\nit.apply {\ngroupId = project.group.toString()\n- artifactId = publicationData.name\n+ artifactId = \"mpsmodule-\" + publicationData.name\nversion = (\"\"+project.version).ifEmpty { \"0.1\" }\nfor (jar in publicationData.jars) {\nval artifact = project.artifacts.add(\"mpsmodules\", jar.file) {\n@@ -122,7 +122,7 @@ class MPSBuildPlugin : Plugin<Project> {\nfor (dependency in publicationData.dependencies) {\nnewChild(\"dependency\") {\nnewChild(\"groupId\", project.group.toString())\n- newChild(\"artifactId\", \"$dependency-all\")\n+ newChild(\"artifactId\", \"$dependency\")\nnewChild(\"version\", version)\n}\n}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | publications names changed to allow depending on a module without the "-all" suffix |
426,496 | 10.03.2022 07:38:07 | -3,600 | 8ad78f55b87a72d0c7dfbf4237c211e810544cdf | Also publish library jars of a module | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -97,6 +97,14 @@ class MPSBuildPlugin : Plugin<Project> {\nnewChild(\"classifier\", jar.classifier)\n}\n}\n+ for (jar in publicationData.libs) {\n+ newChild(\"dependency\") {\n+ newChild(\"groupId\", groupId)\n+ newChild(\"artifactId\", \"mpsmodule-lib-\" + publicationData.name)\n+ newChild(\"version\", version)\n+ newChild(\"classifier\", jar.nameWithoutExtension)\n+ }\n+ }\n}\n}\n}\n@@ -131,6 +139,23 @@ class MPSBuildPlugin : Plugin<Project> {\n}\n}\n}\n+ if (publicationData.libs.isNotEmpty()) {\n+ it.create(\"mpsmodule-libs-${publicationData.name}\", MavenPublication::class.java) {\n+ it.apply {\n+ groupId = project.group.toString()\n+ artifactId = \"mpsmodule-lib-\" + publicationData.name\n+ version = (\"\"+project.version).ifEmpty { \"0.1\" }\n+ for (jar in publicationData.libs) {\n+ val artifact = project.artifacts.add(\"mpsmodules\", jar) {\n+ it.type = \"jar\"\n+ it.classifier = jar.nameWithoutExtension\n+ it.builtBy(\"mpsbuild-assemble\")\n+ }\n+ artifact(artifact)\n+ }\n+ }\n+ }\n+ }\n}\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -260,7 +260,8 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n.map { it.owner }\n.filterIsInstance<SourceModuleOwner>()\n.distinct()\n- .map { it.modules.values.first().name }\n+ .map { it.modules.values.first().name },\n+ owner.modules.values.flatMap { it.getOwnJars(macros) }\n)\n}\n@@ -656,6 +657,6 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nreturn planBuilder.plan to dependencyGraph\n}\n- class Publication(val name: String, val jars: List<PublicationJar>, val dependencies: List<String>)\n+ class Publication(val name: String, val jars: List<PublicationJar>, val dependencies: List<String>, val libs: List<File>)\nclass PublicationJar(val file: File, val classifier: String)\n}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Also publish library jars of a module |
426,496 | 10.03.2022 13:11:57 | -3,600 | 99cf036280fb439beb6cbcbb99d6b8006ee083c2 | support building against published modules | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -39,8 +39,14 @@ import java.util.stream.Collectors\nclass MPSBuildPlugin : Plugin<Project> {\noverride fun apply(project_: Project) {\nval settings = project_.extensions.create(\"mpsBuild\", MPSBuildSettings::class.java)\n+ val dependenciesConfiguration = project_.configurations.create(\"mpsBuildDependencies\")\nproject_.afterEvaluate { project: Project ->\nsettings.validate()\n+ val buildDir = project.buildDir.resolve(\"mpsbuild\")\n+\n+ val dependenciesDir = buildDir.resolve(\"dependencies\")\n+ copyDependencies(dependenciesConfiguration, dependenciesDir)\n+\nval manifest = readManifest()\nval modelixVersion = manifest.mainAttributes.getValue(\"modelix-Version\")\nval genConfig = project.configurations.detachedConfiguration(\n@@ -63,21 +69,22 @@ class MPSBuildPlugin : Plugin<Project> {\npluginsConfig = project.configurations.detachedConfiguration(\nproject.dependencies.create(\"org.modelix:mps-model-plugin:$modelixVersion\"))\n}\n- val buildDir = File(File(project.projectDir, \"build\"), \"mpsbuild\")\n+\nval antScriptFile = File(buildDir, \"build-modules.xml\")\nval antScriptTask = project.tasks.create(\"generatorAntScript\")\nval action = Action { task: Task? ->\n- generateAntScript(settings, project, buildDir, antScriptFile)\n+ generateAntScript(settings, project, buildDir, antScriptFile, setOf(dependenciesDir))\n}\nantScriptTask.actions = listOf(action)\n- val generator = generateAntScript(settings, project, buildDir, antScriptFile)\n+ val generator = generateAntScript(settings, project, buildDir, antScriptFile, setOf(dependenciesDir))\nval ant = DefaultAntBuilder(project, AntLoggingAdapter())\nant.importBuild(antScriptFile) { \"mpsbuild-$it\" }\nproject.configurations.create(\"mpsmodules\")\nval publishing = project.extensions.findByType(PublishingExtension::class.java)\n+ val publicationsVersion = (\"\" + project.version).ifEmpty { \"0.1\" }\npublishing?.apply {\npublications {\nfor (publicationData in generator.publications) {\n@@ -85,14 +92,14 @@ class MPSBuildPlugin : Plugin<Project> {\nit.apply {\ngroupId = project.group.toString()\nartifactId = publicationData.name\n- version = (\"\"+project.version).ifEmpty { \"0.1\" }\n+ version = publicationsVersion\npom {\nit.withXml {\nit.asElement().newChild(\"dependencies\") {\nfor (jar in publicationData.jars) {\nnewChild(\"dependency\") {\nnewChild(\"groupId\", groupId)\n- newChild(\"artifactId\", \"mpsmodule-\" + publicationData.name)\n+ newChild(\"artifactId\", \"mpsmodule-${publicationData.name}-mpsmodule\")\nnewChild(\"version\", version)\nnewChild(\"classifier\", jar.classifier)\n}\n@@ -100,9 +107,9 @@ class MPSBuildPlugin : Plugin<Project> {\nfor (jar in publicationData.libs) {\nnewChild(\"dependency\") {\nnewChild(\"groupId\", groupId)\n- newChild(\"artifactId\", \"mpsmodule-lib-\" + publicationData.name)\n+ newChild(\"artifactId\", \"mpsmodule-${publicationData.name}-lib\")\nnewChild(\"version\", version)\n- newChild(\"classifier\", jar.nameWithoutExtension)\n+ newChild(\"classifier\", \"lib-\" + jar.nameWithoutExtension)\n}\n}\n}\n@@ -114,8 +121,8 @@ class MPSBuildPlugin : Plugin<Project> {\nit.create(\"mpsmodule-jars-${publicationData.name}\", MavenPublication::class.java) {\nit.apply {\ngroupId = project.group.toString()\n- artifactId = \"mpsmodule-\" + publicationData.name\n- version = (\"\"+project.version).ifEmpty { \"0.1\" }\n+ artifactId = \"mpsmodule-${publicationData.name}-mpsmodule\"\n+ version = publicationsVersion\nfor (jar in publicationData.jars) {\nval artifact = project.artifacts.add(\"mpsmodules\", jar.file) {\nit.type = \"jar\"\n@@ -143,12 +150,12 @@ class MPSBuildPlugin : Plugin<Project> {\nit.create(\"mpsmodule-libs-${publicationData.name}\", MavenPublication::class.java) {\nit.apply {\ngroupId = project.group.toString()\n- artifactId = \"mpsmodule-lib-\" + publicationData.name\n- version = (\"\"+project.version).ifEmpty { \"0.1\" }\n+ artifactId = \"mpsmodule-${publicationData.name}-lib\"\n+ version = publicationsVersion\nfor (jar in publicationData.libs) {\nval artifact = project.artifacts.add(\"mpsmodules\", jar) {\nit.type = \"jar\"\n- it.classifier = jar.nameWithoutExtension\n+ it.classifier = \"lib-${jar.nameWithoutExtension}\"\nit.builtBy(\"mpsbuild-assemble\")\n}\nartifact(artifact)\n@@ -157,17 +164,40 @@ class MPSBuildPlugin : Plugin<Project> {\n}\n}\n}\n+ it.create(\"allmpsmodules\", MavenPublication::class.java) {\n+ it.apply {\n+ groupId = project.group.toString()\n+ artifactId = \"allmpsmodules\"\n+ version = publicationsVersion\n+ pom {\n+ it.withXml {\n+ it.asElement().newChild(\"dependencies\") {\n+ for (publicationData in generator.publications) {\n+ newChild(\"dependency\") {\n+ newChild(\"groupId\", groupId)\n+ newChild(\"artifactId\", publicationData.name)\n+ newChild(\"version\", version)\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n}\n}\n}\n}\n- private fun generateAntScript(settings: MPSBuildSettings, project: Project, buildDir: File, antScriptFile: File): BuildScriptGenerator {\n+ private fun generateAntScript(settings: MPSBuildSettings, project: Project, buildDir: File, antScriptFile: File, dependencyFiles: Set<File>): BuildScriptGenerator {\nval modulesMiner = ModulesMiner()\nfor (modulePath in settings.resolveModulePaths(project.projectDir.toPath())) {\nmodulesMiner.searchInFolder(modulePath.toFile())\n}\n+ for (dependencyFile in dependencyFiles) {\n+ modulesMiner.searchInFolder(dependencyFile)\n+ }\nval mpsPath = settings.mpsHome\nif (mpsPath != null) {\nval mpsHome = project.projectDir.toPath().resolve(Path.of(mpsPath)).normalize().toFile()\n@@ -209,6 +239,32 @@ class MPSBuildPlugin : Plugin<Project> {\nreturn generator\n}\n+ private fun copyDependencies(dependenciesConfiguration: Configuration, targetFolder: File): Set<File> {\n+ val files = dependenciesConfiguration.resolve()\n+ //val existingFiles = targetFolder.walk().filter { it.isFile }.map { it.normalize() }.toSet()\n+ val outputFiles = files.map { copyDependency(it, targetFolder).normalize() }.toSet()\n+ //(existingFiles - outputFiles).forEach { it.delete() }\n+ return outputFiles\n+ }\n+\n+ private val libJarPattern = Regex(\"\"\"mpsmodule-(.+)-lib-.+-lib-(.+)\"\"\")\n+ private val moduleJarPattern = Regex(\"\"\"mpsmodule-(.+)-mpsmodule-.+?(-(src|(\\d-)?generator))?\"\"\")\n+ private fun copyDependency(file: File, targetFolder: File): File {\n+ val name = file.nameWithoutExtension\n+ val targetFile = libJarPattern.matchEntire(name)?.let { match ->\n+ val moduleName = match.groupValues[1]\n+ val libName = match.groupValues[2]\n+ targetFolder.resolve(\"$moduleName-lib\").resolve(\"$libName.${file.extension}\")\n+ } ?: moduleJarPattern.matchEntire(file.nameWithoutExtension)?.let { match ->\n+ val moduleName = match.groupValues[1]\n+ val classifierSuffix = match.groupValues.getOrElse(2) { \"\" }\n+ targetFolder.resolve(\"$moduleName$classifierSuffix.${file.extension}\")\n+ } ?: targetFolder.resolve(file.name)\n+\n+ file.copyTo(targetFile, true)\n+ return file\n+ }\n+\nprivate fun readManifest(): Manifest {\nvar resources: Enumeration<URL>? = null\ntry {\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | support building against published modules |
426,496 | 10.03.2022 14:38:12 | -3,600 | 714174e69629903e4283cdbd70854eb3501cdbe0 | Write module name to the pom to be able to reconstruct the correct path when copying jars | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -20,11 +20,9 @@ import org.gradle.api.internal.project.DefaultAntBuilder\nimport org.gradle.api.internal.project.ant.AntLoggingAdapter\nimport org.gradle.api.publish.PublishingExtension\nimport org.gradle.api.publish.maven.MavenPublication\n+import org.modelix.buildtools.*\nimport java.lang.RuntimeException\n-import org.modelix.buildtools.BuildScriptGenerator\n-import org.modelix.buildtools.ModuleId\n-import org.modelix.buildtools.ModulesMiner\n-import org.modelix.buildtools.newChild\n+import org.w3c.dom.Element\nimport java.io.File\nimport java.io.IOException\nimport java.net.URL\n@@ -36,6 +34,9 @@ import java.util.HashSet\nimport java.util.jar.Manifest\nimport java.util.stream.Collectors\n+const val MODULE_NAME_PROPERTY = \"mps.module.name\"\n+const val IS_LIBS_PROPERTY = \"mps.module.libs\"\n+\nclass MPSBuildPlugin : Plugin<Project> {\noverride fun apply(project_: Project) {\nval settings = project_.extensions.create(\"mpsBuild\", MPSBuildSettings::class.java)\n@@ -99,7 +100,7 @@ class MPSBuildPlugin : Plugin<Project> {\nfor (jar in publicationData.jars) {\nnewChild(\"dependency\") {\nnewChild(\"groupId\", groupId)\n- newChild(\"artifactId\", \"mpsmodule-${publicationData.name}-mpsmodule\")\n+ newChild(\"artifactId\", \"mpsmodule-${publicationData.name}\")\nnewChild(\"version\", version)\nnewChild(\"classifier\", jar.classifier)\n}\n@@ -109,7 +110,7 @@ class MPSBuildPlugin : Plugin<Project> {\nnewChild(\"groupId\", groupId)\nnewChild(\"artifactId\", \"mpsmodule-${publicationData.name}-lib\")\nnewChild(\"version\", version)\n- newChild(\"classifier\", \"lib-\" + jar.nameWithoutExtension)\n+ newChild(\"classifier\", jar.nameWithoutExtension)\n}\n}\n}\n@@ -121,7 +122,7 @@ class MPSBuildPlugin : Plugin<Project> {\nit.create(\"mpsmodule-jars-${publicationData.name}\", MavenPublication::class.java) {\nit.apply {\ngroupId = project.group.toString()\n- artifactId = \"mpsmodule-${publicationData.name}-mpsmodule\"\n+ artifactId = \"mpsmodule-${publicationData.name}\"\nversion = publicationsVersion\nfor (jar in publicationData.jars) {\nval artifact = project.artifacts.add(\"mpsmodules\", jar.file) {\n@@ -132,6 +133,7 @@ class MPSBuildPlugin : Plugin<Project> {\nartifact(artifact)\n}\npom {\n+ it.properties.put(MODULE_NAME_PROPERTY, publicationData.name)\nit.withXml {\nit.asElement().newChild(\"dependencies\") {\nfor (dependency in publicationData.dependencies) {\n@@ -152,10 +154,14 @@ class MPSBuildPlugin : Plugin<Project> {\ngroupId = project.group.toString()\nartifactId = \"mpsmodule-${publicationData.name}-lib\"\nversion = publicationsVersion\n+ pom {\n+ it.properties.put(MODULE_NAME_PROPERTY, publicationData.name)\n+ it.properties.put(IS_LIBS_PROPERTY, \"true\")\n+ }\nfor (jar in publicationData.libs) {\nval artifact = project.artifacts.add(\"mpsmodules\", jar) {\nit.type = \"jar\"\n- it.classifier = \"lib-${jar.nameWithoutExtension}\"\n+ it.classifier = jar.nameWithoutExtension\nit.builtBy(\"mpsbuild-assemble\")\n}\nartifact(artifact)\n@@ -250,12 +256,22 @@ class MPSBuildPlugin : Plugin<Project> {\nprivate val libJarPattern = Regex(\"\"\"mpsmodule-(.+)-lib-.+-lib-(.+)\"\"\")\nprivate val moduleJarPattern = Regex(\"\"\"mpsmodule-(.+)-mpsmodule-.+?(-(src|(\\d-)?generator))?\"\"\")\nprivate fun copyDependency(file: File, targetFolder: File): File {\n- val name = file.nameWithoutExtension\n- val targetFile = libJarPattern.matchEntire(name)?.let { match ->\n+ val nameWithoutExtension = file.nameWithoutExtension\n+ val targetFile = readPOM(file)?.let { pom ->\n+ val moduleName = pom.getProperty(MODULE_NAME_PROPERTY) ?: return@let null\n+ val isLibs = pom.getProperty(IS_LIBS_PROPERTY).toBoolean()\n+ val classifier = pom.getClassifier(file)\n+ if (isLibs) {\n+ targetFolder.resolve(pom.group).resolve(\"$moduleName-lib\").resolve(\"$classifier.${file.extension}\")\n+ } else {\n+ val classifierSuffix = if (classifier.isEmpty()) \"\" else \"-$classifier\"\n+ targetFolder.resolve(pom.group).resolve(\"$moduleName$classifierSuffix.${file.extension}\")\n+ }\n+ } ?: libJarPattern.matchEntire(nameWithoutExtension)?.let { match ->\nval moduleName = match.groupValues[1]\nval libName = match.groupValues[2]\ntargetFolder.resolve(\"$moduleName-lib\").resolve(\"$libName.${file.extension}\")\n- } ?: moduleJarPattern.matchEntire(file.nameWithoutExtension)?.let { match ->\n+ } ?: moduleJarPattern.matchEntire(nameWithoutExtension)?.let { match ->\nval moduleName = match.groupValues[1]\nval classifierSuffix = match.groupValues.getOrElse(2) { \"\" }\ntargetFolder.resolve(\"$moduleName$classifierSuffix.${file.extension}\")\n@@ -265,6 +281,19 @@ class MPSBuildPlugin : Plugin<Project> {\nreturn file\n}\n+ private val cachedPomContent: MutableMap<File, Pom?> = HashMap()\n+ private fun readPOM(jar: File): Pom? {\n+ val pomFile = (jar.parentFile.listFiles() ?: arrayOf()).find { it.extension == \"pom\" } ?: return null\n+ return cachedPomContent.computeIfAbsent(pomFile) {\n+ try {\n+ Pom(readXmlFile(it).documentElement, it)\n+ } catch (e : Exception) {\n+ println(\"Failed to read $pomFile\")\n+ null\n+ }\n+ }\n+ }\n+\nprivate fun readManifest(): Manifest {\nvar resources: Enumeration<URL>? = null\ntry {\n@@ -284,4 +313,21 @@ class MPSBuildPlugin : Plugin<Project> {\n}\nthrow RuntimeException(\"No MANIFEST.MF found containing 'modelix-Version'\")\n}\n+\n+ class Pom(val content: Element, val file: File) {\n+ val group: String = content.findTag(\"groupId\")?.textContent ?: \"\"\n+ val version: String = content.findTag(\"version\")?.textContent ?: \"\"\n+ val artifactId: String = content.findTag(\"artifactId\")?.textContent ?: \"\"\n+ val baseNameWithVersion: String = \"$artifactId-$version\"\n+ fun artifactName(classifier: String) = if (classifier.isEmpty()) baseNameWithVersion else \"$baseNameWithVersion-$classifier\"\n+ fun getClassifier(file: File): String {\n+ val prefix = \"$baseNameWithVersion-\"\n+ return if (file.nameWithoutExtension == baseNameWithVersion || !file.nameWithoutExtension.startsWith(prefix)) {\n+ \"\"\n+ } else {\n+ file.nameWithoutExtension.drop(prefix.length)\n+ }\n+ }\n+ fun getProperty(name: String) = content.findTag(\"properties\")?.findTag(name)?.textContent\n+ }\n}\n\\ No newline at end of file\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Write module name to the pom to be able to reconstruct the correct path when copying jars |
426,496 | 10.03.2022 14:39:12 | -3,600 | c7ae1be55e03a61f22c9107d875132efadbee7c1 | Write module name to the pom to be able to reconstruct the correct path when copying jars (2) | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -253,10 +253,7 @@ class MPSBuildPlugin : Plugin<Project> {\nreturn outputFiles\n}\n- private val libJarPattern = Regex(\"\"\"mpsmodule-(.+)-lib-.+-lib-(.+)\"\"\")\n- private val moduleJarPattern = Regex(\"\"\"mpsmodule-(.+)-mpsmodule-.+?(-(src|(\\d-)?generator))?\"\"\")\nprivate fun copyDependency(file: File, targetFolder: File): File {\n- val nameWithoutExtension = file.nameWithoutExtension\nval targetFile = readPOM(file)?.let { pom ->\nval moduleName = pom.getProperty(MODULE_NAME_PROPERTY) ?: return@let null\nval isLibs = pom.getProperty(IS_LIBS_PROPERTY).toBoolean()\n@@ -267,14 +264,6 @@ class MPSBuildPlugin : Plugin<Project> {\nval classifierSuffix = if (classifier.isEmpty()) \"\" else \"-$classifier\"\ntargetFolder.resolve(pom.group).resolve(\"$moduleName$classifierSuffix.${file.extension}\")\n}\n- } ?: libJarPattern.matchEntire(nameWithoutExtension)?.let { match ->\n- val moduleName = match.groupValues[1]\n- val libName = match.groupValues[2]\n- targetFolder.resolve(\"$moduleName-lib\").resolve(\"$libName.${file.extension}\")\n- } ?: moduleJarPattern.matchEntire(nameWithoutExtension)?.let { match ->\n- val moduleName = match.groupValues[1]\n- val classifierSuffix = match.groupValues.getOrElse(2) { \"\" }\n- targetFolder.resolve(\"$moduleName$classifierSuffix.${file.extension}\")\n} ?: targetFolder.resolve(file.name)\nfile.copyTo(targetFile, true)\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Write module name to the pom to be able to reconstruct the correct path when copying jars (2) |
426,496 | 10.03.2022 18:00:00 | -3,600 | 2b6af97d2834cdac3f5025e593e00667d99651cf | Dependencies from other projects were missing
Publications in mbeddr.core didn't declare a dependency on publications
from MPS-extensions. | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -46,7 +46,8 @@ class MPSBuildPlugin : Plugin<Project> {\nval buildDir = project.buildDir.resolve(\"mpsbuild\")\nval dependenciesDir = buildDir.resolve(\"dependencies\")\n- copyDependencies(dependenciesConfiguration, dependenciesDir)\n+ val copiedDependencies = copyDependencies(dependenciesConfiguration, dependenciesDir.normalize())\n+ val moduleName2pom: Map<String?, Pom> = copiedDependencies.values.filterNotNull().associateBy { it.getProperty(MODULE_NAME_PROPERTY) }\nval manifest = readManifest()\nval modelixVersion = manifest.mainAttributes.getValue(\"modelix-Version\")\n@@ -88,6 +89,7 @@ class MPSBuildPlugin : Plugin<Project> {\nval publicationsVersion = (\"\" + project.version).ifEmpty { \"0.1\" }\npublishing?.apply {\npublications {\n+ val ownPublications = generator.publications.map { it.name }.toSet()\nfor (publicationData in generator.publications) {\nit.create(\"mpsmodule-${publicationData.name}\", MavenPublication::class.java) {\nit.apply {\n@@ -137,9 +139,17 @@ class MPSBuildPlugin : Plugin<Project> {\nit.withXml {\nit.asElement().newChild(\"dependencies\") {\nfor (dependency in publicationData.dependencies) {\n+ val pom = moduleName2pom[dependency.name]\n+ if (pom != null) {\nnewChild(\"dependency\") {\n+ newChild(\"artifactId\", pom.artifactId)\n+ newChild(\"groupId\", pom.group)\n+ newChild(\"version\", pom.version)\n+ }\n+ } else if (ownPublications.contains(dependency.name)) {\n+ newChild(\"dependency\") {\n+ newChild(\"artifactId\", dependency.name)\nnewChild(\"groupId\", project.group.toString())\n- newChild(\"artifactId\", \"$dependency\")\nnewChild(\"version\", version)\n}\n}\n@@ -148,6 +158,7 @@ class MPSBuildPlugin : Plugin<Project> {\n}\n}\n}\n+ }\nif (publicationData.libs.isNotEmpty()) {\nit.create(\"mpsmodule-libs-${publicationData.name}\", MavenPublication::class.java) {\nit.apply {\n@@ -245,16 +256,13 @@ class MPSBuildPlugin : Plugin<Project> {\nreturn generator\n}\n- private fun copyDependencies(dependenciesConfiguration: Configuration, targetFolder: File): Set<File> {\n+ private fun copyDependencies(dependenciesConfiguration: Configuration, targetFolder: File): Map<File, Pom?> {\nval files = dependenciesConfiguration.resolve()\n- //val existingFiles = targetFolder.walk().filter { it.isFile }.map { it.normalize() }.toSet()\n- val outputFiles = files.map { copyDependency(it, targetFolder).normalize() }.toSet()\n- //(existingFiles - outputFiles).forEach { it.delete() }\n- return outputFiles\n+ return files.map { copyDependency(it, targetFolder) }.associate { it }\n}\n- private fun copyDependency(file: File, targetFolder: File): File {\n- val targetFile = readPOM(file)?.let { pom ->\n+ private fun copyDependency(file: File, targetFolder: File): Pair<File, Pom?> {\n+ val targetFileAndPom = readPOM(file)?.let { pom ->\nval moduleName = pom.getProperty(MODULE_NAME_PROPERTY) ?: return@let null\nval isLibs = pom.getProperty(IS_LIBS_PROPERTY).toBoolean()\nval classifier = pom.getClassifier(file)\n@@ -263,11 +271,11 @@ class MPSBuildPlugin : Plugin<Project> {\n} else {\nval classifierSuffix = if (classifier.isEmpty()) \"\" else \"-$classifier\"\ntargetFolder.resolve(pom.group).resolve(\"$moduleName$classifierSuffix.${file.extension}\")\n- }\n- } ?: targetFolder.resolve(file.name)\n+ } to pom\n+ } ?: (targetFolder.resolve(file.name) to null)\n- file.copyTo(targetFile, true)\n- return file\n+ file.copyTo(targetFileAndPom.first, true)\n+ return targetFileAndPom\n}\nprivate val cachedPomContent: MutableMap<File, Pom?> = HashMap()\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -17,6 +17,7 @@ import org.modelix.headlessmps.ProcessExecutor\nimport org.w3c.dom.Document\nimport org.w3c.dom.Element\nimport java.io.File\n+import java.nio.file.Path\nimport javax.xml.parsers.DocumentBuilderFactory\nimport kotlin.io.path.absolutePathString\nimport kotlin.io.path.pathString\n@@ -258,9 +259,8 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nowner.modules.values\n.flatMap { it.getClassPathDependencies(resolver) }\n.map { it.owner }\n- .filterIsInstance<SourceModuleOwner>()\n.distinct()\n- .map { it.modules.values.first().name },\n+ .map { PublicationDependency(it.modules.values.first().name, it.path.getLocalAbsolutePath()) },\nowner.modules.values.flatMap { it.getOwnJars(macros) }\n)\n}\n@@ -657,6 +657,10 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nreturn planBuilder.plan to dependencyGraph\n}\n- class Publication(val name: String, val jars: List<PublicationJar>, val dependencies: List<String>, val libs: List<File>)\n+ class Publication(val name: String,\n+ val jars: List<PublicationJar>,\n+ val dependencies: List<PublicationDependency>,\n+ val libs: List<File>)\nclass PublicationJar(val file: File, val classifier: String)\n+ class PublicationDependency(val name: String, val path: Path)\n}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Dependencies from other projects were missing
Publications in mbeddr.core didn't declare a dependency on publications
from MPS-extensions. |
426,496 | 10.03.2022 18:00:35 | -3,600 | 4aa8d1d5e4a8d1d54d4e7d09621fbed98d1d27a0 | Generator heap size can be configured | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -247,6 +247,7 @@ class MPSBuildPlugin : Plugin<Project> {\n}\nval generator = BuildScriptGenerator(\nmodulesMiner, modulesToGenerate, emptySet(), settings.getMacros(project.projectDir.toPath()), buildDir)\n+ generator.generatorHeapSize = settings.generatorHeapSize\nval xml = generator.generateXML()\ntry {\nFileUtils.writeStringToFile(antScriptFile, xml, StandardCharsets.UTF_8)\n"
},
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.kt",
"diff": "@@ -26,6 +26,8 @@ open class MPSBuildSettings {\nprivate val includedPaths: MutableList<String> = ArrayList()\nprivate val includedModuleNames: MutableSet<String> = HashSet()\nprivate val macros: MutableMap<String, String> = HashMap()\n+ var generatorHeapSize: String = \"2G\"\n+\nfun usingExistingMps(): Boolean {\nreturn mpsHome != null\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -30,6 +30,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nprivate var compileCycleIds: Map<DependencyGraph<FoundModule, ModuleId>.DependencyNode, Int> = HashMap()\nval publications: MutableList<Publication> = ArrayList();\n+ var generatorHeapSize: String = \"2G\"\nfun buildModules(antScriptFile: File = File.createTempFile(\"mps-build-script\", \".xml\", File(\".\")), outputHandler: ((String)->Unit)? = null) {\nval xml = generateXML()\n@@ -170,7 +171,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nsetAttribute(\"value\", \"-ea\")\n}\nnewChild(\"arg\") {\n- setAttribute(\"value\", \"-Xmx2G\")\n+ setAttribute(\"value\", \"-Xmx$generatorHeapSize\")\n}\n}\nfor (macro in macros.macros) {\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Generator heap size can be configured |
426,496 | 11.03.2022 13:03:54 | -3,600 | 22f7d902df291b47694f084cbc02b969ec73a2c6 | Support for building idea plugins | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -21,7 +21,6 @@ import org.gradle.api.internal.project.ant.AntLoggingAdapter\nimport org.gradle.api.publish.PublishingExtension\nimport org.gradle.api.publish.maven.MavenPublication\nimport org.modelix.buildtools.*\n-import java.lang.RuntimeException\nimport org.w3c.dom.Element\nimport java.io.File\nimport java.io.IOException\n@@ -33,6 +32,7 @@ import java.util.Enumeration\nimport java.util.HashSet\nimport java.util.jar.Manifest\nimport java.util.stream.Collectors\n+import kotlin.RuntimeException\nconst val MODULE_NAME_PROPERTY = \"mps.module.name\"\nconst val IS_LIBS_PROPERTY = \"mps.module.libs\"\n@@ -248,6 +248,12 @@ class MPSBuildPlugin : Plugin<Project> {\nval generator = BuildScriptGenerator(\nmodulesMiner, modulesToGenerate, emptySet(), settings.getMacros(project.projectDir.toPath()), buildDir)\ngenerator.generatorHeapSize = settings.generatorHeapSize\n+ generator.ideaPlugins += settings.ideaPlugins.map { pluginSettings ->\n+ val moduleName = pluginSettings.getImplementationModuleName()\n+ val module = (modulesMiner.getModules().getModules().values.find { it.name == moduleName }\n+ ?: throw RuntimeException(\"module $moduleName not found\"))\n+ BuildScriptGenerator.IdeaPlugin(module, \"\" + project.version, pluginSettings.pluginXml)\n+ }\nval xml = generator.generateXML()\ntry {\nFileUtils.writeStringToFile(antScriptFile, xml, StandardCharsets.UTF_8)\n"
},
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.kt",
"diff": "*/\npackage org.modelix.gradle.mpsbuild\n+import org.gradle.api.Action\nimport org.modelix.buildtools.Macros\n+import org.modelix.buildtools.readXmlFile\n+import org.w3c.dom.Document\n+import java.io.ByteArrayInputStream\nimport java.nio.file.Path\n-import java.util.ArrayList\nimport java.util.HashMap\n-import java.util.HashSet\nimport java.util.stream.Collectors\n+import kotlin.collections.ArrayList\n+import kotlin.collections.HashSet\nopen class MPSBuildSettings {\nvar mpsHome: String? = null\n@@ -27,6 +31,7 @@ open class MPSBuildSettings {\nprivate val includedModuleNames: MutableSet<String> = HashSet()\nprivate val macros: MutableMap<String, String> = HashMap()\nvar generatorHeapSize: String = \"2G\"\n+ val ideaPlugins: MutableList<IdeaPluginSettings> = ArrayList()\nfun usingExistingMps(): Boolean {\nreturn mpsHome != null\n@@ -75,4 +80,30 @@ open class MPSBuildSettings {\n}\nreturn Macros(resolvedMacros)\n}\n+\n+ fun ideaPlugin(action: Action<IdeaPluginSettings>) {\n+ val plugin = IdeaPluginSettings()\n+ ideaPlugins += plugin\n+ action.execute(plugin)\n+ }\n+\n+ inner class IdeaPluginSettings {\n+ private var implementationModule: String? = null\n+ var description: String? = null\n+ var pluginXml: Document? = null\n+ fun getImplementationModuleName() = implementationModule\n+ ?: throw RuntimeException(\"No implementation module specified for the IDEA plugin\")\n+ fun implementationModule(name: String) {\n+ require(implementationModule == null) {\n+ \"Only one implementation module is supported. It's already set to $implementationModule\"\n+ }\n+ implementationModule = name\n+ }\n+ fun description(value: String) {\n+ description = value\n+ }\n+ fun pluginXml(content: String) {\n+ pluginXml = readXmlFile(content.byteInputStream())\n+ }\n+ }\n}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -31,6 +31,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nprivate var compileCycleIds: Map<DependencyGraph<FoundModule, ModuleId>.DependencyNode, Int> = HashMap()\nval publications: MutableList<Publication> = ArrayList();\nvar generatorHeapSize: String = \"2G\"\n+ val ideaPlugins: MutableList<IdeaPlugin> = ArrayList()\nfun buildModules(antScriptFile: File = File.createTempFile(\"mps-build-script\", \".xml\", File(\".\")), outputHandler: ((String)->Unit)? = null) {\nval xml = generateXML()\n@@ -417,11 +418,63 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n}\n}\n+ // target: assemble.idea.plugin.___.___\n+ for (ideaPlugin in ideaPlugins) {\n+ newChild(\"target\") {\n+ setAttribute(\"name\", ideaPlugin.getAssembleTargetName())\n+ setAttribute(\"depends\", getAssembleTargetName(ideaPlugin.module))\n+ newChild(\"copy\") {\n+ setAttribute(\"todir\", ideaPlugin.getLanguagesDir(buildDir).absolutePath)\n+ // Here the language jar is only used to load the module, but not the classes\n+ for (jar in getAllModuleJarFiles(ideaPlugin.module)) {\n+ newChild(\"file\") {\n+ setAttribute(\"file\", jar.absolutePath)\n+ }\n+ }\n+ }\n+ newChild(\"copy\") {\n+ setAttribute(\"todir\", ideaPlugin.getLibDir(buildDir).absolutePath)\n+ // Here the language jar is used by the class loader of the IDEA plugin\n+ // Separating classes and model files into two different jar would be possible,\n+ // but it's easier like this for now.\n+ newChild(\"file\") {\n+ setAttribute(\"file\", getJarFile(ideaPlugin.module).absolutePath)\n+ }\n+ for (jar in ideaPlugin.module.getOwnJars(macros)) {\n+ newChild(\"file\") {\n+ setAttribute(\"file\", jar.absolutePath)\n+ }\n+ }\n+ }\n+ val metaInfFolder = ideaPlugin.getPluginDir(buildDir).resolve(\"META-INF\")\n+ newChild(\"mkdir\") {\n+ setAttribute(\"dir\", metaInfFolder.absolutePath)\n+ }\n+ newChild(\"echoxml\") {\n+ setAttribute(\"file\", metaInfFolder.resolve(\"plugin.xml\").absolutePath)\n+ ideaPlugin.applyXml(this).apply {\n+ val pluginDependencies = ideaPlugin.module.getClassPathDependencies(resolver)\n+ .map { it.owner }.filterIsInstance<PluginModuleOwner>()\n+ for (pluginDependency in pluginDependencies) {\n+ newChild(\"depends\", pluginDependency.pluginId)\n+ }\n+ newChild(\"extensions\") {\n+ setAttribute(\"defaultExtensionNs\", \"com.intellij\")\n+ newChild(\"mps.LanguageLibrary\") {\n+ setAttribute(\"dir\", \"/languages\")\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+\n// target: assemble\nnewChild(\"target\") {\nsetAttribute(\"name\", \"assemble\")\n- setAttribute(\"depends\", sourceModules.map { it.owner as SourceModuleOwner }\n- .joinToString(\", \") { getAssembleTargetName(it) })\n+ val targetDeps = sourceModules.map { it.owner as SourceModuleOwner }.map { getAssembleTargetName(it) } +\n+ ideaPlugins.map { it.getAssembleTargetName() }\n+ setAttribute(\"depends\", targetDeps.joinToString(\", \"))\n}\n// target: clean\n@@ -431,6 +484,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nnewChild(\"delete\") { setAttribute(\"dir\", getPackagedModulesTempDir().absolutePath) }\nnewChild(\"delete\") { setAttribute(\"dir\", getModelsTempDir().absolutePath) }\nnewChild(\"delete\") { setAttribute(\"dir\", getCompileOutputDir().absolutePath) }\n+ newChild(\"delete\") { setAttribute(\"dir\", getIdeaPluginsBuildDir(buildDir).absolutePath) }\n}\n}\n@@ -569,6 +623,9 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nprivate fun getSrcJarFile(module: FoundModule): File {\nreturn File(getPackagedModulesDir(), getNonGeneratorModule(module).name + \"-src.jar\")\n}\n+ private fun getAllModuleJarFiles(module: FoundModule): List<File> {\n+ return module.owner.modules.values.map { getJarFile(it) } + getSrcJarFile(module)\n+ }\nprivate fun getNonGeneratorModule(module: FoundModule): FoundModule {\nreturn if (module.moduleType != ModuleType.Generator) {\nmodule\n@@ -664,4 +721,32 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nval libs: List<File>)\nclass PublicationJar(val file: File, val classifier: String)\nclass PublicationDependency(val name: String, val path: Path)\n+ class IdeaPlugin(val module: FoundModule, val version: String, val pluginXml: Document?) {\n+ init {\n+ require(module.moduleType == ModuleType.Solution) {\n+ \"Only solutions are allowed for IDEA plugins. ${module.name} is of type ${module.moduleType}.\"\n+ }\n+ }\n+ fun getPluginId() = module.moduleDescriptor?.ideaPluginId\n+ ?: throw RuntimeException(\"No idea plugin ID specified in module ${module.name}\")\n+ fun getAssembleTargetName() = \"assemble.idea.plugin.${getPluginId()}\"\n+ fun getPluginDir(buildDir: File) = getIdeaPluginsBuildDir(buildDir).resolve(getPluginId())\n+ fun getLanguagesDir(buildDir: File) = getPluginDir(buildDir).resolve(\"languages\")\n+ fun getLibDir(buildDir: File) = getPluginDir(buildDir).resolve(\"lib\")\n+ fun applyXml(targetParent: Element): Element {\n+ val rootElement: Element = if (pluginXml != null) {\n+ targetParent.appendChild(targetParent.ownerDocument.importNode(pluginXml.documentElement, true)) as Element\n+ } else {\n+ targetParent.newChild(\"idea-plugin\") {}\n+ }\n+ rootElement.apply {\n+ newChild(\"id\", getPluginId())\n+ newChild(\"name\", getPluginId())\n+ newChild(\"version\", version)\n}\n+ return rootElement\n+ }\n+ }\n+}\n+\n+private fun getIdeaPluginsBuildDir(buildDir: File) = buildDir.resolve(\"idea-plugins\")\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/modulepersistence/ModuleDescriptor.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/modulepersistence/ModuleDescriptor.kt",
"diff": "@@ -15,7 +15,6 @@ package org.modelix.buildtools.modulepersistence\nimport org.modelix.buildtools.*\nimport org.w3c.dom.Element\n-import java.io.File\nimport java.nio.file.Path\nabstract class ModuleDescriptor(val xml: Element) {\n@@ -31,6 +30,7 @@ abstract class ModuleDescriptor(val xml: Element) {\nprivate val modelPaths: List<String>\nprivate val facets: List<Element>\nval javaLibPaths: List<String>\n+ val ideaPluginId: String?\ninit {\n// see ModuleDescriptorPersistence in MPS\n@@ -59,6 +59,8 @@ abstract class ModuleDescriptor(val xml: Element) {\njavaLibPaths = xml.childElements(\"stubModelEntries\")\n.flatMap { it.childElements(\"stubModelEntry\") }\n.map { it.getAttribute(\"path\") }\n+ ideaPluginId = xml.childElements(\"facets\").flatMap { it.childElements(\"facet\") }\n+ .find { it.getAttribute(\"type\") == \"ideaPlugin\" }?.getAttributeOrNull(\"pluginId\")\n}\nfun resolveJavaLibs(macros: Macros): List<Path> {\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Support for building idea plugins |
426,496 | 11.03.2022 15:39:33 | -3,600 | 08402f082f9df5bd05db76adad67ffac440ba440 | publish idea plugins | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/build.gradle",
"new_path": "gradle-mpsbuild-plugin/build.gradle",
"diff": "@@ -18,6 +18,7 @@ repositories {\ndependencies {\nimplementation project(\":mps-build-tools\")\nimplementation group: 'commons-io', name: 'commons-io', version: '2.11.0'\n+ implementation \"org.zeroturnaround:zt-zip:1.14\"\ncompile gradleApi()\ntestCompile group: 'junit', name: 'junit', version: '4.12'\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -22,6 +22,7 @@ import org.gradle.api.publish.PublishingExtension\nimport org.gradle.api.publish.maven.MavenPublication\nimport org.modelix.buildtools.*\nimport org.w3c.dom.Element\n+import org.zeroturnaround.zip.ZipUtil\nimport java.io.File\nimport java.io.IOException\nimport java.net.URL\n@@ -35,6 +36,7 @@ import java.util.stream.Collectors\nimport kotlin.RuntimeException\nconst val MODULE_NAME_PROPERTY = \"mps.module.name\"\n+const val IDEA_PLUGIN_ID_PROPERTY = \"idea.plugin.id\"\nconst val IS_LIBS_PROPERTY = \"mps.module.libs\"\nclass MPSBuildPlugin : Plugin<Project> {\n@@ -47,7 +49,11 @@ class MPSBuildPlugin : Plugin<Project> {\nval dependenciesDir = buildDir.resolve(\"dependencies\")\nval copiedDependencies = copyDependencies(dependenciesConfiguration, dependenciesDir.normalize())\n- val moduleName2pom: Map<String?, Pom> = copiedDependencies.values.filterNotNull().associateBy { it.getProperty(MODULE_NAME_PROPERTY) }\n+ val moduleName2pom: Map<String, Pom> = copiedDependencies.map { it.getProperty(MODULE_NAME_PROPERTY) to it }\n+ .filter { it.first != null }.associate { it.first!! to it.second }\n+ val pluginId2pom: Map<String, Pom> = copiedDependencies.map { it.getProperty(IDEA_PLUGIN_ID_PROPERTY) to it }\n+ .filter { it.first != null }.associate { it.first!! to it.second }\n+ val artifactId2pom: Map<String, Pom> = copiedDependencies.associateBy { it.artifactId }\nval manifest = readManifest()\nval modelixVersion = manifest.mainAttributes.getValue(\"modelix-Version\")\n@@ -91,6 +97,8 @@ class MPSBuildPlugin : Plugin<Project> {\npublications {\nval ownPublications = generator.publications.map { it.name }.toSet()\nfor (publicationData in generator.publications) {\n+ when (publicationData) {\n+ is BuildScriptGenerator.ModulePublication -> {\nit.create(\"mpsmodule-${publicationData.name}\", MavenPublication::class.java) {\nit.apply {\ngroupId = project.group.toString()\n@@ -99,7 +107,7 @@ class MPSBuildPlugin : Plugin<Project> {\npom {\nit.withXml {\nit.asElement().newChild(\"dependencies\") {\n- for (jar in publicationData.jars) {\n+ for (jar in publicationData.files) {\nnewChild(\"dependency\") {\nnewChild(\"groupId\", groupId)\nnewChild(\"artifactId\", \"mpsmodule-${publicationData.name}\")\n@@ -126,7 +134,7 @@ class MPSBuildPlugin : Plugin<Project> {\ngroupId = project.group.toString()\nartifactId = \"mpsmodule-${publicationData.name}\"\nversion = publicationsVersion\n- for (jar in publicationData.jars) {\n+ for (jar in publicationData.files) {\nval artifact = project.artifacts.add(\"mpsmodules\", jar.file) {\nit.type = \"jar\"\nit.classifier = jar.classifier\n@@ -181,10 +189,52 @@ class MPSBuildPlugin : Plugin<Project> {\n}\n}\n}\n- it.create(\"allmpsmodules\", MavenPublication::class.java) {\n+ is BuildScriptGenerator.IdeaPluginPublication -> {\n+ it.create(publicationData.name, MavenPublication::class.java) {\nit.apply {\ngroupId = project.group.toString()\n- artifactId = \"allmpsmodules\"\n+ artifactId = publicationData.name\n+ version = publicationsVersion\n+ for (file in publicationData.files) {\n+ val artifact = project.artifacts.add(\"mpsmodules\", file.file) {\n+ it.type = \"zip\"\n+ it.classifier = file.classifier\n+ it.builtBy(\"mpsbuild-assemble\")\n+ }\n+ artifact(artifact)\n+ }\n+ pom {\n+ it.properties.put(IDEA_PLUGIN_ID_PROPERTY, publicationData.pluginId)\n+ it.withXml {\n+ it.asElement().newChild(\"dependencies\") {\n+ for (dependency in publicationData.dependencies) {\n+ val pom = artifactId2pom[dependency.name]\n+ if (pom != null) {\n+ newChild(\"dependency\") {\n+ newChild(\"artifactId\", pom.artifactId)\n+ newChild(\"groupId\", pom.group)\n+ newChild(\"version\", pom.version)\n+ }\n+ } else if (ownPublications.contains(dependency.name)) {\n+ newChild(\"dependency\") {\n+ newChild(\"artifactId\", dependency.name)\n+ newChild(\"groupId\", project.group.toString())\n+ newChild(\"version\", version)\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ it.create(\"all\", MavenPublication::class.java) {\n+ it.apply {\n+ groupId = project.group.toString()\n+ artifactId = \"all\"\nversion = publicationsVersion\npom {\nit.withXml {\n@@ -263,14 +313,16 @@ class MPSBuildPlugin : Plugin<Project> {\nreturn generator\n}\n- private fun copyDependencies(dependenciesConfiguration: Configuration, targetFolder: File): Map<File, Pom?> {\n+ private fun copyDependencies(dependenciesConfiguration: Configuration, targetFolder: File): List<Pom> {\nval files = dependenciesConfiguration.resolve()\n- return files.map { copyDependency(it, targetFolder) }.associate { it }\n+ return files.mapNotNull { copyDependency(it, targetFolder) }\n}\n- private fun copyDependency(file: File, targetFolder: File): Pair<File, Pom?> {\n+ private fun copyDependency(file: File, targetFolder: File): Pom? {\nval targetFileAndPom = readPOM(file)?.let { pom ->\n- val moduleName = pom.getProperty(MODULE_NAME_PROPERTY) ?: return@let null\n+ val moduleName = pom.getProperty(MODULE_NAME_PROPERTY)\n+ val ideaPluginId = pom.getProperty(IDEA_PLUGIN_ID_PROPERTY)\n+ if (moduleName != null) {\nval isLibs = pom.getProperty(IS_LIBS_PROPERTY).toBoolean()\nval classifier = pom.getClassifier(file)\nif (isLibs) {\n@@ -279,10 +331,18 @@ class MPSBuildPlugin : Plugin<Project> {\nval classifierSuffix = if (classifier.isEmpty()) \"\" else \"-$classifier\"\ntargetFolder.resolve(pom.group).resolve(\"$moduleName$classifierSuffix.${file.extension}\")\n} to pom\n+ } else if (ideaPluginId != null) {\n+ targetFolder.resolve(pom.group).resolve(\"plugins\").resolve(ideaPluginId) to pom\n+ } else null\n} ?: (targetFolder.resolve(file.name) to null)\n+ if (file.extension == \"zip\") {\n+ if (targetFileAndPom.first.exists()) targetFileAndPom.first.deleteRecursively()\n+ ZipUtil.unpack(file, targetFileAndPom.first)\n+ } else {\nfile.copyTo(targetFileAndPom.first, true)\n- return targetFileAndPom\n+ }\n+ return targetFileAndPom.second\n}\nprivate val cachedPomContent: MutableMap<File, Pom?> = HashMap()\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -68,6 +68,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n\"mps_home\" to mpsHome.toPath(),\n\"mps.home\" to mpsHome.toPath(),\n)\n+ val module2ideaPlugin = ideaPlugins.associateBy { it.module }\nval dbf = DocumentBuilderFactory.newInstance()\nval db = dbf.newDocumentBuilder()\n@@ -251,13 +252,14 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n}\n}\n- publications += modulesToCompile.map { it.owner }.distinct().filterIsInstance<SourceModuleOwner>().map { owner ->\n+ publications += (modulesToCompile - module2ideaPlugin.keys).map { it.owner }.distinct()\n+ .filterIsInstance<SourceModuleOwner>().map { owner ->\nval nonGen = owner.modules.values.first { it.moduleType != ModuleType.Generator }\nval gen = owner.modules.values.filter { it.moduleType == ModuleType.Generator }\n- Publication(\n+ ModulePublication(\nnonGen.name,\n- listOf(PublicationJar(getJarFile(nonGen), \"\"), PublicationJar(getSrcJarFile(nonGen), \"src\")) +\n- gen.mapIndexed { i, m -> PublicationJar(getJarFile(m), if (i == 0) \"generator\" else \"$i-generator\") },\n+ listOf(PublicationFile(getJarFile(nonGen), \"\"), PublicationFile(getSrcJarFile(nonGen), \"src\")) +\n+ gen.mapIndexed { i, m -> PublicationFile(getJarFile(m), if (i == 0) \"generator\" else \"$i-generator\") },\nowner.modules.values\n.flatMap { it.getClassPathDependencies(resolver) }\n.map { it.owner }\n@@ -266,6 +268,14 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nowner.modules.values.flatMap { it.getOwnJars(macros) }\n)\n}\n+ publications += ideaPlugins.map { plugin ->\n+ IdeaPluginPublication(\n+ \"idea.plugin.\" + plugin.getPluginId(),\n+ plugin.getPluginId(),\n+ listOf(PublicationFile(plugin.getPackagedPlugin(buildDir), \"\")),\n+ plugin.pluginDependencies(resolver).map { PublicationDependency(it.pluginId, it.path.getLocalAbsolutePath()) }\n+ )\n+ }\n// target: compile\nnewChild(\"target\") {\n@@ -453,8 +463,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nnewChild(\"echoxml\") {\nsetAttribute(\"file\", metaInfFolder.resolve(\"plugin.xml\").absolutePath)\nideaPlugin.applyXml(this).apply {\n- val pluginDependencies = ideaPlugin.module.getClassPathDependencies(resolver)\n- .map { it.owner }.filterIsInstance<PluginModuleOwner>()\n+ val pluginDependencies = ideaPlugin.pluginDependencies(resolver)\nfor (pluginDependency in pluginDependencies) {\nnewChild(\"depends\", pluginDependency.pluginId)\n}\n@@ -466,6 +475,10 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n}\n}\n}\n+ newChild(\"zip\") {\n+ setAttribute(\"destfile\", ideaPlugin.getPackagedPlugin(buildDir).absolutePath)\n+ setAttribute(\"baseDir\", ideaPlugin.getPluginDir(buildDir).absolutePath)\n+ }\n}\n}\n@@ -715,11 +728,18 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nreturn planBuilder.plan to dependencyGraph\n}\n- class Publication(val name: String,\n- val jars: List<PublicationJar>,\n- val dependencies: List<PublicationDependency>,\n- val libs: List<File>)\n- class PublicationJar(val file: File, val classifier: String)\n+ open class Publication(val name: String,\n+ val files: List<PublicationFile>,\n+ val dependencies: List<PublicationDependency>)\n+ class ModulePublication(name: String,\n+ jars: List<PublicationFile>,\n+ dependencies: List<PublicationDependency>,\n+ val libs: List<File>): Publication(name, jars, dependencies)\n+ class IdeaPluginPublication(name: String,\n+ val pluginId: String,\n+ files: List<PublicationFile>,\n+ dependencies: List<PublicationDependency>): Publication(name, files, dependencies)\n+ class PublicationFile(val file: File, val classifier: String)\nclass PublicationDependency(val name: String, val path: Path)\nclass IdeaPlugin(val module: FoundModule, val version: String, val pluginXml: Document?) {\ninit {\n@@ -731,6 +751,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n?: throw RuntimeException(\"No idea plugin ID specified in module ${module.name}\")\nfun getAssembleTargetName() = \"assemble.idea.plugin.${getPluginId()}\"\nfun getPluginDir(buildDir: File) = getIdeaPluginsBuildDir(buildDir).resolve(getPluginId())\n+ fun getPackagedPlugin(buildDir: File): File = getIdeaPluginsBuildDir(buildDir).resolve(getPluginId() + \".zip\")\nfun getLanguagesDir(buildDir: File) = getPluginDir(buildDir).resolve(\"languages\")\nfun getLibDir(buildDir: File) = getPluginDir(buildDir).resolve(\"lib\")\nfun applyXml(targetParent: Element): Element {\n@@ -746,6 +767,8 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n}\nreturn rootElement\n}\n+ fun pluginDependencies(resolver: ModuleResolver) = module.getClassPathDependencies(resolver)\n+ .map { it.owner }.filterIsInstance<PluginModuleOwner>()\n}\n}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | publish idea plugins |
426,496 | 11.03.2022 23:08:46 | -3,600 | 336be80c8a7172c1d57cb99175cea1ede06969b7 | generator for stub model solution
In the gradle script you can just write
stubs("org.apache.commons:commons-text:1.9")
and execute the generateStubs task.
This generates everything you need to write code against that library. | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -42,13 +42,14 @@ const val IS_LIBS_PROPERTY = \"mps.module.libs\"\nclass MPSBuildPlugin : Plugin<Project> {\noverride fun apply(project_: Project) {\nval settings = project_.extensions.create(\"mpsBuild\", MPSBuildSettings::class.java)\n- val dependenciesConfiguration = project_.configurations.create(\"mpsBuildDependencies\")\n+ settings.setProject(project_)\n+\nproject_.afterEvaluate { project: Project ->\nsettings.validate()\nval buildDir = project.buildDir.resolve(\"mpsbuild\")\nval dependenciesDir = buildDir.resolve(\"dependencies\")\n- val copiedDependencies = copyDependencies(dependenciesConfiguration, dependenciesDir.normalize())\n+ val copiedDependencies = copyDependencies(settings.moduleDependenciesConfig, dependenciesDir.normalize())\nval moduleName2pom: Map<String, Pom> = copiedDependencies.map { it.getProperty(MODULE_NAME_PROPERTY) to it }\n.filter { it.first != null }.associate { it.first!! to it.second }\nval pluginId2pom: Map<String, Pom> = copiedDependencies.map { it.getProperty(IDEA_PLUGIN_ID_PROPERTY) to it }\n@@ -78,12 +79,59 @@ class MPSBuildPlugin : Plugin<Project> {\nproject.dependencies.create(\"org.modelix:mps-model-plugin:$modelixVersion\"))\n}\n+ val generateStubsTask = project.task(\"generateStubs\") { task ->\n+ val action = Action { task: Task? ->\n+ val artifacts = settings.stubsDependenciesConfig.resolvedConfiguration.resolvedArtifacts\n+ .filter { it.file.extension == \"jar\" }\n+ for (artifact in artifacts) {\n+ val jar = artifact.file\n+ val solutionName = \"stubs#\" + artifact.moduleVersion.id.toString().replace(\":\", \"#\")\n+ val xml = newXmlDocument {\n+ newChild(\"solution\") {\n+ setAttribute(\"name\", solutionName)\n+ setAttribute(\"pluginKind\", \"PLUGIN_OTHER\")\n+ setAttribute(\"moduleVersion\", \"0\")\n+ setAttribute(\"uuid\", \"~$solutionName\")\n+ newChild(\"facets\") {\n+ newChild(\"facet\") {\n+ setAttribute(\"type\", \"java\")\n+ }\n+ }\n+ newChild(\"models\") {\n+ newChild(\"modelRoot\") {\n+ setAttribute(\"type\", \"java_classes\")\n+ setAttribute(\"contentPath\", jar.parentFile.absolutePath)\n+ newChild(\"sourceRoot\") {\n+ setAttribute(\"location\", jar.name)\n+ }\n+ }\n+ }\n+ newChild(\"dependencies\") {\n+ newChild(\"dependency\", \"6354ebe7-c22a-4a0f-ac54-50b52ab9b065(JDK)\")\n+ }\n+ newChild(\"stubModelEntries\") {\n+ newChild(\"stubModelEntry\") {\n+ setAttribute(\"path\", jar.absolutePath)\n+ }\n+ }\n+ }\n+ }\n+ val solutionFile = buildDir.resolve(\"stubs\").resolve(solutionName).resolve(\"$solutionName.msd\")\n+ solutionFile.parentFile.mkdirs()\n+ solutionFile.writeText(xmlToString(xml))\n+ }\n+ }\n+ task.actions = listOf(action)\n+ }\n+\nval antScriptFile = File(buildDir, \"build-modules.xml\")\n- val antScriptTask = project.tasks.create(\"generatorAntScript\")\n+ val antScriptTask = project.task(\"generatorAntScript\") { task ->\nval action = Action { task: Task? ->\ngenerateAntScript(settings, project, buildDir, antScriptFile, setOf(dependenciesDir))\n}\n- antScriptTask.actions = listOf(action)\n+ task.actions = listOf(action)\n+ task.dependsOn(generateStubsTask)\n+ }\nval generator = generateAntScript(settings, project, buildDir, antScriptFile, setOf(dependenciesDir))\nval ant = DefaultAntBuilder(project, AntLoggingAdapter())\n"
},
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.kt",
"diff": "package org.modelix.gradle.mpsbuild\nimport org.gradle.api.Action\n+import org.gradle.api.Project\n+import org.gradle.api.artifacts.Configuration\nimport org.modelix.buildtools.Macros\nimport org.modelix.buildtools.readXmlFile\nimport org.w3c.dom.Document\n@@ -25,6 +27,10 @@ import kotlin.collections.ArrayList\nimport kotlin.collections.HashSet\nopen class MPSBuildSettings {\n+ private lateinit var project: Project\n+ lateinit var moduleDependenciesConfig: Configuration\n+ lateinit var stubsDependenciesConfig: Configuration\n+\nvar mpsHome: String? = null\nprivate val modules: MutableList<String> = ArrayList()\nprivate val includedPaths: MutableList<String> = ArrayList()\n@@ -33,6 +39,24 @@ open class MPSBuildSettings {\nvar generatorHeapSize: String = \"2G\"\nval ideaPlugins: MutableList<IdeaPluginSettings> = ArrayList()\n+ fun setProject(p: Project) {\n+ project = p\n+ moduleDependenciesConfig = project.configurations.create(\"mpsBuildModules\")\n+ stubsDependenciesConfig = project.configurations.create(\"mpsBuildStubs\")\n+ }\n+\n+ fun externalModules(coordinates: String) {\n+ project.dependencies.add(moduleDependenciesConfig.name, coordinates)\n+ }\n+\n+ fun stubs(coordinates: String) {\n+ project.dependencies.add(stubsDependenciesConfig.name, coordinates)\n+ }\n+\n+ fun mpsHome(value: String) {\n+ mpsHome = value\n+ }\n+\nfun usingExistingMps(): Boolean {\nreturn mpsHome != null\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/XmlUtils.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/XmlUtils.kt",
"diff": "@@ -54,17 +54,19 @@ fun Node.children(): List<Node> {\nfun Node.childElements(): List<Element> = children().filterIsInstance<Element>()\nfun Node.childElements(tag: String): List<Element> = children().filterIsInstance<Element>().filter { it.tagName == tag }\n-fun Element.newChild(tag: String, body: Element.()->Unit): Element {\n- val child = ownerDocument.createElement(tag)\n+fun Node.document(): Document = if (this is Document) this else ownerDocument\n+\n+fun Node.newChild(tag: String, body: Element.()->Unit): Element {\n+ val child = document().createElement(tag)\nappendChild(child)\nchild.apply(body)\nreturn child\n}\n-fun Element.newChild(tag: String, text: String, body: (Element.()->Unit)? = null): Element {\n- val child = ownerDocument.createElement(tag)\n+fun Node.newChild(tag: String, text: String, body: (Element.()->Unit)? = null): Element {\n+ val child = document().createElement(tag)\nappendChild(child)\n- child.appendChild(ownerDocument.createTextNode(text))\n+ child.appendChild(document().createTextNode(text))\nif (body != null) child.apply(body)\nreturn child\n}\n@@ -106,3 +108,14 @@ fun readXmlFile(file: InputStream): Document {\nval db = dbf.newDocumentBuilder()\nreturn db.parse(file)\n}\n+\n+fun newXmlDocument(body: (Document.()->Unit)? = null): Document {\n+ val dbf = DocumentBuilderFactory.newInstance()\n+ //dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true)\n+ val db = dbf.newDocumentBuilder()\n+ val doc = db.newDocument()\n+ if (body != null) {\n+ doc.apply(body)\n+ }\n+ return doc\n+}\n\\ No newline at end of file\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | generator for stub model solution
In the gradle script you can just write
stubs("org.apache.commons:commons-text:1.9")
and execute the generateStubs task.
This generates everything you need to write code against that library. |
426,496 | 12.03.2022 10:01:01 | -3,600 | 3ebe0487eaffe671ebaa729099186e067d476fcd | Set dependencies between stub solutions (derived from maven dependencies) | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -16,6 +16,7 @@ package org.modelix.gradle.mpsbuild\nimport org.apache.commons.io.FileUtils\nimport org.gradle.api.*\nimport org.gradle.api.artifacts.Configuration\n+import org.gradle.api.artifacts.ResolvedDependency\nimport org.gradle.api.internal.project.DefaultAntBuilder\nimport org.gradle.api.internal.project.ant.AntLoggingAdapter\nimport org.gradle.api.publish.PublishingExtension\n@@ -30,10 +31,10 @@ import java.nio.charset.StandardCharsets\nimport java.nio.file.Path\nimport java.util.ArrayList\nimport java.util.Enumeration\n-import java.util.HashSet\nimport java.util.jar.Manifest\nimport java.util.stream.Collectors\nimport kotlin.RuntimeException\n+import kotlin.collections.HashSet\nconst val MODULE_NAME_PROPERTY = \"mps.module.name\"\nconst val IDEA_PLUGIN_ID_PROPERTY = \"idea.plugin.id\"\n@@ -81,11 +82,25 @@ class MPSBuildPlugin : Plugin<Project> {\nval generateStubsTask = project.task(\"generateStubs\") { task ->\nval action = Action { task: Task? ->\n- val artifacts = settings.stubsDependenciesConfig.resolvedConfiguration.resolvedArtifacts\n- .filter { it.file.extension == \"jar\" }\n- for (artifact in artifacts) {\n- val jar = artifact.file\n- val solutionName = \"stubs#\" + artifact.moduleVersion.id.toString().replace(\":\", \"#\")\n+ val resolvedConfiguration = settings.stubsDependenciesConfig.resolvedConfiguration\n+ val allDependencies: MutableSet<ResolvedDependency> = HashSet()\n+ object : GraphWithCyclesVisitor<ResolvedDependency>() {\n+ override fun onVisit(element: ResolvedDependency) {\n+ allDependencies.add(element)\n+ visit(element.children)\n+ }\n+ }.visit(resolvedConfiguration.firstLevelModuleDependencies)\n+ val getSolutionName: (ResolvedDependency)->String = {\n+// val clean: (String)->String = { it.replace(Regex(\"[^a-zA-Z0-9]\"), \"_\") }\n+// val group = clean(it.moduleGroup)\n+// val artifactId = clean(it.moduleName)\n+// val version = clean(it.moduleVersion)\n+// \"stubs.$group.$artifactId.$version\"\n+ \"stubs#\" + it.module.id.toString().replace(\":\", \"#\")\n+ }\n+ for (dependency in allDependencies) {\n+ val solutionName = getSolutionName(dependency)\n+ val jars = dependency.moduleArtifacts.map { it.file }.filter { it.extension == \"jar\" }\nval xml = newXmlDocument {\nnewChild(\"solution\") {\nsetAttribute(\"name\", solutionName)\n@@ -98,6 +113,7 @@ class MPSBuildPlugin : Plugin<Project> {\n}\n}\nnewChild(\"models\") {\n+ for (jar in jars) {\nnewChild(\"modelRoot\") {\nsetAttribute(\"type\", \"java_classes\")\nsetAttribute(\"contentPath\", jar.parentFile.absolutePath)\n@@ -106,20 +122,32 @@ class MPSBuildPlugin : Plugin<Project> {\n}\n}\n}\n+ }\nnewChild(\"dependencies\") {\n- newChild(\"dependency\", \"6354ebe7-c22a-4a0f-ac54-50b52ab9b065(JDK)\")\n+ newChild(\"dependency\", \"6354ebe7-c22a-4a0f-ac54-50b52ab9b065(JDK)\") {\n+ setAttribute(\"reexport\", \"true\")\n+ }\n+ for (transitiveDep in dependency.children) {\n+ val n = getSolutionName(transitiveDep)\n+ newChild(\"dependency\", \"~$n($n)\") {\n+ setAttribute(\"reexport\", \"true\")\n+ }\n+ }\n}\nnewChild(\"stubModelEntries\") {\n+ for (jar in jars) {\nnewChild(\"stubModelEntry\") {\nsetAttribute(\"path\", jar.absolutePath)\n}\n}\n}\n}\n+ }\nval solutionFile = buildDir.resolve(\"stubs\").resolve(solutionName).resolve(\"$solutionName.msd\")\nsolutionFile.parentFile.mkdirs()\nsolutionFile.writeText(xmlToString(xml))\n}\n+\n}\ntask.actions = listOf(action)\n}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Set dependencies between stub solutions (derived from maven dependencies) |
426,496 | 12.03.2022 12:04:44 | -3,600 | a5ac4fc1fa87464fd097fd9112f39aaeef10d1ad | mps("com.jetbrains:mps:2020.3.6") instead of externalModules("...") | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -47,9 +47,18 @@ class MPSBuildPlugin : Plugin<Project> {\nproject_.afterEvaluate { project: Project ->\nsettings.validate()\n- val buildDir = project.buildDir.resolve(\"mpsbuild\")\n+ val buildDir = project.buildDir.resolve(\"mpsbuild\").normalize()\n+ var mpsDir: File? = null\n+\n+ settings.mpsDependenciesConfig?.let {\n+ mpsDir = buildDir.resolve(\"mps\")\n+ for (file in it.resolve()) {\n+ copyAndUnzip(file, mpsDir!!.resolve(file.name))\n+ }\n+ }\nval dependenciesDir = buildDir.resolve(\"dependencies\")\n+ val dirsToMine = setOfNotNull(dependenciesDir, mpsDir)\nval copiedDependencies = copyDependencies(settings.moduleDependenciesConfig, dependenciesDir.normalize())\nval moduleName2pom: Map<String, Pom> = copiedDependencies.map { it.getProperty(MODULE_NAME_PROPERTY) to it }\n.filter { it.first != null }.associate { it.first!! to it.second }\n@@ -155,13 +164,13 @@ class MPSBuildPlugin : Plugin<Project> {\nval antScriptFile = File(buildDir, \"build-modules.xml\")\nval antScriptTask = project.task(\"generatorAntScript\") { task ->\nval action = Action { task: Task? ->\n- generateAntScript(settings, project, buildDir, antScriptFile, setOf(dependenciesDir))\n+ generateAntScript(settings, project, buildDir, antScriptFile, dirsToMine)\n}\ntask.actions = listOf(action)\ntask.dependsOn(generateStubsTask)\n}\n- val generator = generateAntScript(settings, project, buildDir, antScriptFile, setOf(dependenciesDir))\n+ val generator = generateAntScript(settings, project, buildDir, antScriptFile, dirsToMine)\nval ant = DefaultAntBuilder(project, AntLoggingAdapter())\nant.importBuild(antScriptFile) { \"mpsbuild-$it\" }\n@@ -412,13 +421,17 @@ class MPSBuildPlugin : Plugin<Project> {\n} else null\n} ?: (targetFolder.resolve(file.name) to null)\n- if (file.extension == \"zip\") {\n- if (targetFileAndPom.first.exists()) targetFileAndPom.first.deleteRecursively()\n- ZipUtil.unpack(file, targetFileAndPom.first)\n+ copyAndUnzip(file, targetFileAndPom.first)\n+ return targetFileAndPom.second\n+ }\n+\n+ private fun copyAndUnzip(sourceFile: File, targetFile: File) {\n+ if (sourceFile.extension == \"zip\") {\n+ if (targetFile.exists()) targetFile.deleteRecursively()\n+ ZipUtil.unpack(sourceFile, targetFile)\n} else {\n- file.copyTo(targetFileAndPom.first, true)\n+ sourceFile.copyTo(targetFile, true)\n}\n- return targetFileAndPom.second\n}\nprivate val cachedPomContent: MutableMap<File, Pom?> = HashMap()\n"
},
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.kt",
"diff": "@@ -30,6 +30,7 @@ open class MPSBuildSettings {\nprivate lateinit var project: Project\nlateinit var moduleDependenciesConfig: Configuration\nlateinit var stubsDependenciesConfig: Configuration\n+ var mpsDependenciesConfig: Configuration? = null\nvar mpsHome: String? = null\nprivate val modules: MutableList<String> = ArrayList()\n@@ -41,18 +42,25 @@ open class MPSBuildSettings {\nfun setProject(p: Project) {\nproject = p\n- moduleDependenciesConfig = project.configurations.create(\"mpsBuildModules\")\n- stubsDependenciesConfig = project.configurations.create(\"mpsBuildStubs\")\n+ moduleDependenciesConfig = project.configurations.create(\"mpsBuild-modules\")\n+ stubsDependenciesConfig = project.configurations.create(\"mpsBuild-stubs\")\n}\n- fun externalModules(coordinates: String) {\n+ fun externalModules(coordinates: Any) {\nproject.dependencies.add(moduleDependenciesConfig.name, coordinates)\n}\n- fun stubs(coordinates: String) {\n+ fun stubs(coordinates: Any) {\nproject.dependencies.add(stubsDependenciesConfig.name, coordinates)\n}\n+ fun mps(coordinates: Any) {\n+ if (mpsDependenciesConfig == null) {\n+ mpsDependenciesConfig = project.configurations.create(\"mpsBuild-mps\")\n+ }\n+ project.dependencies.add(mpsDependenciesConfig!!.name, coordinates)\n+ }\n+\nfun mpsHome(value: String) {\nmpsHome = value\n}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | mps("com.jetbrains:mps:2020.3.6") instead of externalModules("...") |
426,496 | 12.03.2022 12:11:12 | -3,600 | 33066cc111bb7d6008fe976295e4946a5bd40940 | publishModule("...") instead of includeModule("...") | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.kt",
"diff": "@@ -86,6 +86,10 @@ open class MPSBuildSettings {\n}\nfun includeModule(moduleName: String) {\n+ publishModule(moduleName)\n+ }\n+\n+ fun publishModule(moduleName: String) {\nincludedModuleNames.add(moduleName)\n}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | publishModule("...") instead of includeModule("...") |
426,496 | 12.03.2022 13:37:01 | -3,600 | a0bc9dd7d504fc0c144432faff74e9c2241a7350 | Dependency on generated stub models couldn't be resolved | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -48,6 +48,7 @@ class MPSBuildPlugin : Plugin<Project> {\nproject_.afterEvaluate { project: Project ->\nsettings.validate()\nval buildDir = project.buildDir.resolve(\"mpsbuild\").normalize()\n+ val stubsDir = buildDir.resolve(\"stubs\")\nvar mpsDir: File? = null\nsettings.mpsDependenciesConfig?.let {\n@@ -58,7 +59,7 @@ class MPSBuildPlugin : Plugin<Project> {\n}\nval dependenciesDir = buildDir.resolve(\"dependencies\")\n- val dirsToMine = setOfNotNull(dependenciesDir, mpsDir)\n+ val dirsToMine = setOfNotNull(dependenciesDir, stubsDir, mpsDir)\nval copiedDependencies = copyDependencies(settings.moduleDependenciesConfig, dependenciesDir.normalize())\nval moduleName2pom: Map<String, Pom> = copiedDependencies.map { it.getProperty(MODULE_NAME_PROPERTY) to it }\n.filter { it.first != null }.associate { it.first!! to it.second }\n@@ -71,23 +72,6 @@ class MPSBuildPlugin : Plugin<Project> {\nval genConfig = project.configurations.detachedConfiguration(\nproject.dependencies.create(\"org.modelix:mps-build-tools:$modelixVersion\")\n)\n- val mpsConfig: Configuration?\n- val pluginsConfig: Configuration?\n- if (settings.usingExistingMps()) {\n- mpsConfig = null\n- pluginsConfig = null\n- // We are using an existing MPS. We also expect the user to add the version of MPS Extensions and\n- // Modelix that they intend to use\n- } else {\n- // We are not using an existing MPS, therefore we will add one and we will add dependencies\n- // to MPS Extensions and Modelix as well\n- val mpsVersion = manifest.mainAttributes.getValue(\"MPS-Version\")\n- mpsConfig = project.configurations.detachedConfiguration(\n- project.dependencies.create(\"com.jetbrains:mps:$mpsVersion\")\n- )\n- pluginsConfig = project.configurations.detachedConfiguration(\n- project.dependencies.create(\"org.modelix:mps-model-plugin:$modelixVersion\"))\n- }\nval generateStubsTask = project.task(\"generateStubs\") { task ->\nval action = Action { task: Task? ->\n@@ -152,7 +136,7 @@ class MPSBuildPlugin : Plugin<Project> {\n}\n}\n}\n- val solutionFile = buildDir.resolve(\"stubs\").resolve(solutionName).resolve(\"$solutionName.msd\")\n+ val solutionFile = stubsDir.resolve(solutionName).resolve(\"$solutionName.msd\")\nsolutionFile.parentFile.mkdirs()\nsolutionFile.writeText(xmlToString(xml))\n}\n@@ -173,6 +157,7 @@ class MPSBuildPlugin : Plugin<Project> {\nval generator = generateAntScript(settings, project, buildDir, antScriptFile, dirsToMine)\nval ant = DefaultAntBuilder(project, AntLoggingAdapter())\nant.importBuild(antScriptFile) { \"mpsbuild-$it\" }\n+ project.tasks.getByPath(\"mpsbuild-generate\").dependsOn(antScriptTask)\nproject.configurations.create(\"mpsmodules\")\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModuleIdAndName.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModuleIdAndName.kt",
"diff": "@@ -21,7 +21,7 @@ class ModuleIdAndName(val id: ModuleId, val name: String?) {\nfun fromReference(text: String): ModuleIdAndName {\n// 1ed103c3-3aa6-49b7-9c21-6765ee11f224(MPS.Editor)\n- val matchResult = Regex(\"\"\"~?(.+)\\((.+)\\)\"\"\").matchEntire(text)\n+ val matchResult = Regex(\"\"\"(~?.+)\\((.+)\\)\"\"\").matchEntire(text)\nif (matchResult == null) return ModuleIdAndName(ModuleId(text), null)\nreturn ModuleIdAndName(ModuleId(matchResult.groupValues[1]), matchResult.groupValues[2])\n}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Dependency on generated stub models couldn't be resolved |
426,496 | 12.03.2022 16:59:05 | -3,600 | c172fd6440b9da845cc008bbd2091866cad0401d | Run ant in a separate process instead of importing the script as gradle tasks
The script is generated by a gradle task and after that it's to late to
load new tasks. | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -22,6 +22,7 @@ import org.gradle.api.internal.project.DefaultAntBuilder\nimport org.gradle.api.internal.project.ant.AntLoggingAdapter\nimport org.gradle.api.publish.PublishingExtension\nimport org.gradle.api.publish.maven.MavenPublication\n+import org.gradle.api.tasks.Exec\nimport org.modelix.buildtools.*\nimport org.w3c.dom.Element\nimport org.zeroturnaround.zip.ZipUtil\n@@ -140,29 +141,44 @@ class MPSBuildPlugin : Plugin<Project> {\ntask.actions = listOf(action)\n}\n+ val generator = createBuildScriptGenerator(settings, project, buildDir, dirsToMine)\nval antScriptFile = File(buildDir, \"build-modules.xml\")\nval antScriptTask = project.task(\"generatorAntScript\") { task ->\nval action = Action { task: Task? ->\n- generateAntScript(settings, project, buildDir, antScriptFile, dirsToMine)\n+ generateAntScript(generator, antScriptFile)\n}\ntask.actions = listOf(action)\ntask.dependsOn(generateStubsTask)\n}\n-\n- val generator = generateAntScript(settings, project, buildDir, antScriptFile, dirsToMine)\n- val ant = DefaultAntBuilder(project, AntLoggingAdapter())\n- ant.importBuild(antScriptFile) { \"mpsbuild-$it\" }\n- project.tasks.getByPath(\"mpsbuild-generate\").dependsOn(antScriptTask)\n- project.tasks.getByPath(\"mpsbuild-assemble\").dependsOn(antScriptTask)\n+// val assembleMpsTask = project.task(\"assembleMps\") { task ->\n+// val action = Action { task: Task? ->\n+// val ant = DefaultAntBuilder(project, AntLoggingAdapter())\n+// ant.importBuild(antScriptFile) { \"mpsbuild-$it\" }\n+//\n+// project.tasks.getByPath(\"mpsbuild-assemble\").\n+// }\n+// task.actions = listOf(action)\n+// task.dependsOn(antScriptTask)\n+// }\n+ val assembleMpsTask = project.tasks.create(\"assembleMps\", Exec::class.java) {\n+ it.workingDir = antScriptFile.parentFile\n+ it.commandLine = listOf(\"ant\", \"-f\", antScriptFile.absolutePath, \"assemble\")\n+ it.standardOutput = System.out\n+ it.errorOutput = System.err\n+ it.standardInput = System.`in`\n+ it.dependsOn(antScriptTask)\n+ }\nproject.configurations.create(\"mpsmodules\")\n+ val publications = generator.getPublications()\n+ println(\"Publications: \" + publications.map { it.name })\nval publishing = project.extensions.findByType(PublishingExtension::class.java)\nval publicationsVersion = (\"\" + project.version).ifEmpty { \"0.1\" }\npublishing?.apply {\npublications {\n- val ownPublications = generator.publications.map { it.name }.toSet()\n- for (publicationData in generator.publications) {\n+ val ownPublications = publications.map { it.name }.toSet()\n+ for (publicationData in publications) {\nwhen (publicationData) {\nis BuildScriptGenerator.ModulePublication -> {\nit.create(\"mpsmodule-${publicationData.name}\", MavenPublication::class.java) {\n@@ -204,7 +220,7 @@ class MPSBuildPlugin : Plugin<Project> {\nval artifact = project.artifacts.add(\"mpsmodules\", jar.file) {\nit.type = \"jar\"\nit.classifier = jar.classifier\n- it.builtBy(antScriptTask, \"mpsbuild-assemble\")\n+ it.builtBy(assembleMpsTask)\n}\nartifact(artifact)\n}\n@@ -247,7 +263,7 @@ class MPSBuildPlugin : Plugin<Project> {\nval artifact = project.artifacts.add(\"mpsmodules\", jar) {\nit.type = \"jar\"\nit.classifier = jar.nameWithoutExtension\n- it.builtBy(antScriptTask, \"mpsbuild-assemble\")\n+ it.builtBy(assembleMpsTask)\n}\nartifact(artifact)\n}\n@@ -265,7 +281,7 @@ class MPSBuildPlugin : Plugin<Project> {\nval artifact = project.artifacts.add(\"mpsmodules\", file.file) {\nit.type = \"zip\"\nit.classifier = file.classifier\n- it.builtBy(antScriptTask, \"mpsbuild-assemble\")\n+ it.builtBy(assembleMpsTask)\n}\nartifact(artifact)\n}\n@@ -305,7 +321,7 @@ class MPSBuildPlugin : Plugin<Project> {\npom {\nit.withXml {\nit.asElement().newChild(\"dependencies\") {\n- for (publicationData in generator.publications) {\n+ for (publicationData in publications) {\nnewChild(\"dependency\") {\nnewChild(\"groupId\", groupId)\nnewChild(\"artifactId\", publicationData.name)\n@@ -336,7 +352,20 @@ class MPSBuildPlugin : Plugin<Project> {\nreturn allDependencies\n}\n- private fun generateAntScript(settings: MPSBuildSettings, project: Project, buildDir: File, antScriptFile: File, dependencyFiles: Set<File>): BuildScriptGenerator {\n+ private fun generateAntScript(generator: BuildScriptGenerator, antScriptFile: File): BuildScriptGenerator {\n+ val xml = generator.generateXML()\n+ try {\n+ FileUtils.writeStringToFile(antScriptFile, xml, StandardCharsets.UTF_8)\n+ } catch (e: IOException) {\n+ throw RuntimeException(e)\n+ }\n+ return generator\n+ }\n+\n+ private fun createBuildScriptGenerator(settings: MPSBuildSettings,\n+ project: Project,\n+ buildDir: File,\n+ dependencyFiles: Set<File>): BuildScriptGenerator {\nval modulesMiner = ModulesMiner()\nfor (modulePath in settings.resolveModulePaths(project.projectDir.toPath())) {\nmodulesMiner.searchInFolder(modulePath.toFile())\n@@ -383,12 +412,6 @@ class MPSBuildPlugin : Plugin<Project> {\n?: throw RuntimeException(\"module $moduleName not found\"))\nBuildScriptGenerator.IdeaPlugin(module, \"\" + project.version, pluginSettings.pluginXml)\n}\n- val xml = generator.generateXML()\n- try {\n- FileUtils.writeStringToFile(antScriptFile, xml, StandardCharsets.UTF_8)\n- } catch (e: IOException) {\n- throw RuntimeException(e)\n- }\nreturn generator\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -23,13 +23,12 @@ import kotlin.io.path.absolutePathString\nimport kotlin.io.path.pathString\nclass BuildScriptGenerator(val modulesMiner: ModulesMiner,\n- val modulesToGenerate: List<ModuleId>? = null,\n+ private val modulesToGenerate: List<ModuleId>? = null,\nval ignoredModules: Set<ModuleId> = HashSet(),\nval initialMacros: Macros = Macros(),\nval buildDir: File = File(\".\", \"build\")) {\nprivate var compileCycleIds: Map<DependencyGraph<FoundModule, ModuleId>.DependencyNode, Int> = HashMap()\n- val publications: MutableList<Publication> = ArrayList();\nvar generatorHeapSize: String = \"2G\"\nval ideaPlugins: MutableList<IdeaPlugin> = ArrayList()\n@@ -53,21 +52,23 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nreturn xmlToString(doc)\n}\n- fun generateAnt(): Document {\n- val modulesToGenerate_ = modulesToGenerate\n- ?: modulesMiner.getModules().getModules().values\n- .filter { it.owner is SourceModuleOwner && it.moduleType == ModuleType.Language }\n- .map { it.moduleId }\n- .toList()\n- val (plan, dependencyGraph) = generatePlan(modulesToGenerate_ - ignoredModules.toSet())\n- val resolver = ModuleResolver(modulesMiner.getModules(), ignoredModules)\n- val mpsHome = modulesMiner.getModules().mpsHome ?: throw RuntimeException(\"mps.home not found\")\n- val macros = initialMacros.with(\n+ fun getMpsHome() = modulesMiner.getModules().mpsHome ?: throw RuntimeException(\"mps.home not found\")\n+\n+ fun getMacros(): Macros {\n+ val mpsHome = getMpsHome()\n+ return initialMacros.with(\n\"platform_lib\" to mpsHome.toPath().resolve(\"lib\"),\n\"lib_ext\" to mpsHome.toPath().resolve(\"lib\").resolve(\"ext\"),\n\"mps_home\" to mpsHome.toPath(),\n\"mps.home\" to mpsHome.toPath(),\n)\n+ }\n+\n+ fun generateAnt(): Document {\n+ val resolver = ModuleResolver(modulesMiner.getModules(), ignoredModules)\n+ val (plan, dependencyGraph) = generatePlan(getModulesToGenerate(), resolver)\n+ val mpsHome = getMpsHome()\n+ val macros = getMacros()\nval module2ideaPlugin = ideaPlugins.associateBy { it.module }\nval dbf = DocumentBuilderFactory.newInstance()\n@@ -252,30 +253,6 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n}\n}\n- publications += (modulesToCompile - module2ideaPlugin.keys).map { it.owner }.distinct()\n- .filterIsInstance<SourceModuleOwner>().map { owner ->\n- val nonGen = owner.modules.values.first { it.moduleType != ModuleType.Generator }\n- val gen = owner.modules.values.filter { it.moduleType == ModuleType.Generator }\n- ModulePublication(\n- nonGen.name,\n- listOf(PublicationFile(getJarFile(nonGen), \"\"), PublicationFile(getSrcJarFile(nonGen), \"src\")) +\n- gen.mapIndexed { i, m -> PublicationFile(getJarFile(m), if (i == 0) \"generator\" else \"$i-generator\") },\n- owner.modules.values\n- .flatMap { it.getClassPathDependencies(resolver) }\n- .map { it.owner }\n- .distinct()\n- .map { PublicationDependency(it.modules.values.first().name, it.path.getLocalAbsolutePath()) },\n- owner.modules.values.flatMap { it.getOwnJars(macros) }\n- )\n- }\n- publications += ideaPlugins.map { plugin ->\n- IdeaPluginPublication(\n- \"idea.plugin.\" + plugin.getPluginId(),\n- plugin.getPluginId(),\n- listOf(PublicationFile(plugin.getPackagedPlugin(buildDir), \"\")),\n- plugin.pluginDependencies(resolver).map { PublicationDependency(it.pluginId, it.path.getLocalAbsolutePath()) }\n- )\n- }\n// target: compile\nnewChild(\"target\") {\n@@ -506,6 +483,52 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nreturn doc\n}\n+ fun getModulesToGenerate(): List<ModuleId> {\n+ return (modulesToGenerate\n+ ?: modulesMiner.getModules().getModules().values\n+ .filter { it.owner is SourceModuleOwner && it.moduleType == ModuleType.Language }\n+ .map { it.moduleId }\n+ .toList()) - ignoredModules.toSet()\n+ }\n+\n+ fun getPublications(): List<Publication> {\n+ val resolver = ModuleResolver(modulesMiner.getModules(), ignoredModules, true)\n+ val dependencyGraph = GeneratorDependencyGraph(resolver)\n+ dependencyGraph.load(getModulesToGenerate().mapNotNull { modulesMiner.getModules().getModules()[it] })\n+ val sourceModules = dependencyGraph.getNodes().flatMap { it.modules }.filter { it.owner is SourceModuleOwner }\n+ val generatorModules = sourceModules.flatMap { it.owner.modules.values - it }\n+ val modulesToCompile = sourceModules + generatorModules\n+ val module2ideaPlugin = ideaPlugins.associateBy { it.module }\n+ val macros = getMacros()\n+ val publications = ArrayList<Publication>()\n+\n+ publications += (modulesToCompile - module2ideaPlugin.keys).map { it.owner }.distinct()\n+ .filterIsInstance<SourceModuleOwner>().map { owner ->\n+ val nonGen = owner.modules.values.first { it.moduleType != ModuleType.Generator }\n+ val gen = owner.modules.values.filter { it.moduleType == ModuleType.Generator }\n+ ModulePublication(\n+ nonGen.name,\n+ listOf(PublicationFile(getJarFile(nonGen), \"\"), PublicationFile(getSrcJarFile(nonGen), \"src\")) +\n+ gen.mapIndexed { i, m -> PublicationFile(getJarFile(m), if (i == 0) \"generator\" else \"$i-generator\") },\n+ owner.modules.values\n+ .flatMap { it.getClassPathDependencies(resolver) }\n+ .map { it.owner }\n+ .distinct()\n+ .map { PublicationDependency(it.modules.values.first().name, it.path.getLocalAbsolutePath()) },\n+ owner.modules.values.flatMap { it.getOwnJars(macros) }\n+ )\n+ }\n+ publications += ideaPlugins.map { plugin ->\n+ IdeaPluginPublication(\n+ \"idea.plugin.\" + plugin.getPluginId(),\n+ plugin.getPluginId(),\n+ listOf(PublicationFile(plugin.getPackagedPlugin(buildDir), \"\")),\n+ plugin.pluginDependencies(resolver).map { PublicationDependency(it.pluginId, it.path.getLocalAbsolutePath()) }\n+ )\n+ }\n+ return publications\n+ }\n+\nprivate fun Element.createCompileTarget(\nmodules: List<FoundModule>,\nclassPath: List<File>,\n@@ -722,8 +745,8 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n} + module.getOwnJars(macros)\n}\n- private fun generatePlan(modulesToGenerate: List<ModuleId>): Pair<GenerationPlan, GeneratorDependencyGraph> {\n- val planBuilder = GenerationPlanBuilder(modulesMiner.getModules(), ignoredModules)\n+ private fun generatePlan(modulesToGenerate: List<ModuleId>, resolver: ModuleResolver): Pair<GenerationPlan, GeneratorDependencyGraph> {\n+ val planBuilder = GenerationPlanBuilder(resolver)\nval dependencyGraph = planBuilder.build(modulesToGenerate.mapNotNull { modulesMiner.getModules().getModules()[it] })\nreturn planBuilder.plan to dependencyGraph\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/GenerationPlanBuilder.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/GenerationPlanBuilder.kt",
"diff": "@@ -15,13 +15,13 @@ package org.modelix.buildtools\nimport kotlin.math.max\n-class GenerationPlanBuilder(val availableModules: FoundModules, val ignoredModules: Set<ModuleId>) {\n+class GenerationPlanBuilder(val resolver: ModuleResolver) {\nval plan: GenerationPlan = GenerationPlan()\nprivate val processedNodes: MutableSet<DependencyGraph<FoundModule, ModuleId>.DependencyNode> = HashSet()\nprivate val chunkIndexes: MutableMap<DependencyGraph<FoundModule, ModuleId>.DependencyNode, Int> = HashMap()\nfun build(modules: Iterable<FoundModule>): GeneratorDependencyGraph {\n- val dependencyGraph = GeneratorDependencyGraph(ModuleResolver(availableModules, ignoredModules))\n+ val dependencyGraph = GeneratorDependencyGraph(resolver)\ndependencyGraph.load(modules)\ndependencyGraph.getRoots().forEach { build(it) }\nreturn dependencyGraph\n@@ -64,7 +64,7 @@ class GenerationPlanBuilder(val availableModules: FoundModules, val ignoredModul\n}\n}\nis LibraryModuleOwner -> plan.addLibrary(moduleOwner)\n- is PluginModuleOwner -> availableModules.getPluginWithDependencies(moduleOwner.pluginId, plugins)\n+ is PluginModuleOwner -> resolver.availableModules.getPluginWithDependencies(moduleOwner.pluginId, plugins)\nelse -> throw RuntimeException(\"Unknown owner: $moduleOwner\")\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModuleResolver.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModuleResolver.kt",
"diff": "*/\npackage org.modelix.buildtools\n-class ModuleResolver(val availableModules: FoundModules, val ignoredModules: Set<ModuleId>) {\n+class ModuleResolver(val availableModules: FoundModules,\n+ val ignoredModules: Set<ModuleId>,\n+ val ignoreAllMissing: Boolean = false) {\nfun resolveModule(dep: ModuleDependency, usedBy: FoundModule, required: Boolean = true): FoundModule? {\nreturn resolveModule(ModuleIdAndName(dep.id, dep.moduleName), usedBy, required)\n}\nfun resolveModule(dep: ModuleIdAndName, usedBy: FoundModule, required: Boolean = true): FoundModule? {\nval resolved = availableModules.getModules()[dep.id]\n- if (resolved == null && required && !ignoredModules.contains(dep.id)) {\n+ if (!ignoreAllMissing && resolved == null && required && !ignoredModules.contains(dep.id)) {\nthrow RuntimeException(\"Dependency $dep not found (used by ${usedBy.moduleId}(${usedBy.name}) in ${usedBy.owner.path.getLocalAbsolutePath()} )\")\n}\nreturn resolved\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Run ant in a separate process instead of importing the script as gradle tasks
The script is generated by a gradle task and after that it's to late to
load new tasks. |
426,496 | 12.03.2022 18:47:06 | -3,600 | 450529a4ebc1c079399711f58b37d6e0a0b12ee5 | pom was not found | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -18,8 +18,6 @@ import org.gradle.api.*\nimport org.gradle.api.artifacts.Configuration\nimport org.gradle.api.artifacts.ResolvedConfiguration\nimport org.gradle.api.artifacts.ResolvedDependency\n-import org.gradle.api.internal.project.DefaultAntBuilder\n-import org.gradle.api.internal.project.ant.AntLoggingAdapter\nimport org.gradle.api.publish.PublishingExtension\nimport org.gradle.api.publish.maven.MavenPublication\nimport org.gradle.api.tasks.Exec\n@@ -50,7 +48,6 @@ class MPSBuildPlugin : Plugin<Project> {\nproject_.afterEvaluate { project: Project ->\nsettings.validate()\nval buildDir = project.buildDir.resolve(\"mpsbuild\").normalize()\n- val stubsDir = buildDir.resolve(\"stubs\")\nvar mpsDir: File? = null\nsettings.mpsDependenciesConfig?.let {\n@@ -61,8 +58,8 @@ class MPSBuildPlugin : Plugin<Project> {\n}\nval dependenciesDir = buildDir.resolve(\"dependencies\")\n- val dirsToMine = setOfNotNull(dependenciesDir, stubsDir, mpsDir)\n- val copiedDependencies = copyDependencies(settings.moduleDependenciesConfig, dependenciesDir.normalize())\n+ val dirsToMine = setOfNotNull(dependenciesDir, mpsDir)\n+ val copiedDependencies = copyDependencies(settings.dependenciesConfig, dependenciesDir.normalize())\nval moduleName2pom: Map<String, Pom> = copiedDependencies.map { it.getProperty(MODULE_NAME_PROPERTY) to it }\n.filter { it.first != null }.associate { it.first!! to it.second }\nval pluginId2pom: Map<String, Pom> = copiedDependencies.map { it.getProperty(IDEA_PLUGIN_ID_PROPERTY) to it }\n@@ -75,72 +72,6 @@ class MPSBuildPlugin : Plugin<Project> {\nproject.dependencies.create(\"org.modelix:mps-build-tools:$modelixVersion\")\n)\n- val generateStubsTask = project.task(\"generateStubs\") { task ->\n- val action = Action { task: Task? ->\n- val resolvedConfiguration = settings.stubsDependenciesConfig.resolvedConfiguration\n- val allDependencies = resolvedConfiguration.getAllDependencies()\n- val getSolutionName: (ResolvedDependency)->String = {\n-// val clean: (String)->String = { it.replace(Regex(\"[^a-zA-Z0-9]\"), \"_\") }\n-// val group = clean(it.moduleGroup)\n-// val artifactId = clean(it.moduleName)\n-// val version = clean(it.moduleVersion)\n-// \"stubs.$group.$artifactId.$version\"\n- \"stubs#\" + it.module.id.toString().replace(\":\", \"#\")\n- }\n- for (dependency in allDependencies) {\n- val solutionName = getSolutionName(dependency)\n- val jars = dependency.moduleArtifacts.map { it.file }.filter { it.extension == \"jar\" }\n- val xml = newXmlDocument {\n- newChild(\"solution\") {\n- setAttribute(\"name\", solutionName)\n- setAttribute(\"pluginKind\", \"PLUGIN_OTHER\")\n- setAttribute(\"moduleVersion\", \"0\")\n- setAttribute(\"uuid\", \"~$solutionName\")\n- newChild(\"facets\") {\n- newChild(\"facet\") {\n- setAttribute(\"type\", \"java\")\n- }\n- }\n- newChild(\"models\") {\n- for (jar in jars) {\n- newChild(\"modelRoot\") {\n- setAttribute(\"type\", \"java_classes\")\n- setAttribute(\"contentPath\", jar.parentFile.absolutePath)\n- newChild(\"sourceRoot\") {\n- setAttribute(\"location\", jar.name)\n- }\n- }\n- }\n- }\n- newChild(\"dependencies\") {\n- newChild(\"dependency\", \"6354ebe7-c22a-4a0f-ac54-50b52ab9b065(JDK)\") {\n- setAttribute(\"reexport\", \"true\")\n- }\n- for (transitiveDep in dependency.children) {\n- val n = getSolutionName(transitiveDep)\n- newChild(\"dependency\", \"~$n($n)\") {\n- setAttribute(\"reexport\", \"true\")\n- }\n- }\n- }\n- newChild(\"stubModelEntries\") {\n- for (jar in jars) {\n- newChild(\"stubModelEntry\") {\n- setAttribute(\"path\", jar.absolutePath)\n- }\n- }\n- }\n- }\n- }\n- val solutionFile = stubsDir.resolve(solutionName).resolve(\"$solutionName.msd\")\n- solutionFile.parentFile.mkdirs()\n- solutionFile.writeText(xmlToString(xml))\n- }\n-\n- }\n- task.actions = listOf(action)\n- }\n-\nval generator = createBuildScriptGenerator(settings, project, buildDir, dirsToMine)\nval antScriptFile = File(buildDir, \"build-modules.xml\")\nval antScriptTask = project.task(\"generatorAntScript\") { task ->\n@@ -148,7 +79,6 @@ class MPSBuildPlugin : Plugin<Project> {\ngenerateAntScript(generator, antScriptFile)\n}\ntask.actions = listOf(action)\n- task.dependsOn(generateStubsTask)\n}\n// val assembleMpsTask = project.task(\"assembleMps\") { task ->\n// val action = Action { task: Task? ->\n@@ -172,13 +102,13 @@ class MPSBuildPlugin : Plugin<Project> {\nproject.configurations.create(\"mpsmodules\")\nval publications = generator.getPublications()\n- println(\"Publications: \" + publications.map { it.name })\nval publishing = project.extensions.findByType(PublishingExtension::class.java)\nval publicationsVersion = (\"\" + project.version).ifEmpty { \"0.1\" }\npublishing?.apply {\npublications {\nval ownPublications = publications.map { it.name }.toSet()\nfor (publicationData in publications) {\n+ if (publicationData.name.startsWith(\"stubs#\")) continue\nwhen (publicationData) {\nis BuildScriptGenerator.ModulePublication -> {\nit.create(\"mpsmodule-${publicationData.name}\", MavenPublication::class.java) {\n@@ -189,7 +119,7 @@ class MPSBuildPlugin : Plugin<Project> {\npom {\nit.withXml {\nit.asElement().newChild(\"dependencies\") {\n- for (classifier in publicationData.files.map { it.classifier } + \"pom\") {\n+ for (classifier in publicationData.files.map { it.classifier }) {\nnewChild(\"dependency\") {\nnewChild(\"groupId\", groupId)\nnewChild(\"artifactId\", \"mpsmodule-${publicationData.name}\".toValidPublicationName())\n@@ -197,6 +127,20 @@ class MPSBuildPlugin : Plugin<Project> {\nnewChild(\"classifier\", classifier)\n}\n}\n+ newChild(\"dependency\") {\n+ newChild(\"groupId\", groupId)\n+ newChild(\"artifactId\", \"mpsmodule-${publicationData.name}\".toValidPublicationName())\n+ newChild(\"version\", version)\n+ newChild(\"type\", \"pom\")\n+ }\n+ if (publicationData.libs.isNotEmpty()) {\n+ newChild(\"dependency\") {\n+ newChild(\"groupId\", groupId)\n+ newChild(\"artifactId\", \"mpsmodule-${publicationData.name}-lib\".toValidPublicationName())\n+ newChild(\"version\", version)\n+ newChild(\"type\", \"pom\")\n+ }\n+ }\nfor (jar in publicationData.libs) {\nnewChild(\"dependency\") {\nnewChild(\"groupId\", groupId)\n@@ -227,24 +171,7 @@ class MPSBuildPlugin : Plugin<Project> {\npom {\nit.properties.put(MODULE_NAME_PROPERTY, publicationData.name)\nit.withXml {\n- it.asElement().newChild(\"dependencies\") {\n- for (dependency in publicationData.dependencies) {\n- val pom = moduleName2pom[dependency.name]\n- if (pom != null) {\n- newChild(\"dependency\") {\n- newChild(\"artifactId\", pom.artifactId)\n- newChild(\"groupId\", pom.group)\n- newChild(\"version\", pom.version)\n- }\n- } else if (ownPublications.contains(dependency.name)) {\n- newChild(\"dependency\") {\n- newChild(\"artifactId\", dependency.name.toValidPublicationName())\n- newChild(\"groupId\", project.group.toString())\n- newChild(\"version\", version)\n- }\n- }\n- }\n- }\n+ it.asElement().publicationDependenciesToXml(publicationData, moduleName2pom, ownPublications, project, this, settings)\n}\n}\n}\n@@ -288,24 +215,7 @@ class MPSBuildPlugin : Plugin<Project> {\npom {\nit.properties.put(IDEA_PLUGIN_ID_PROPERTY, publicationData.pluginId)\nit.withXml {\n- it.asElement().newChild(\"dependencies\") {\n- for (dependency in publicationData.dependencies) {\n- val pom = artifactId2pom[dependency.name]\n- if (pom != null) {\n- newChild(\"dependency\") {\n- newChild(\"artifactId\", pom.artifactId)\n- newChild(\"groupId\", pom.group)\n- newChild(\"version\", pom.version)\n- }\n- } else if (ownPublications.contains(dependency.name)) {\n- newChild(\"dependency\") {\n- newChild(\"artifactId\", dependency.name.toValidPublicationName())\n- newChild(\"groupId\", project.group.toString())\n- newChild(\"version\", version)\n- }\n- }\n- }\n- }\n+ it.asElement().publicationDependenciesToXml(publicationData, moduleName2pom, ownPublications, project, this, settings)\n}\n}\n}\n@@ -322,9 +232,10 @@ class MPSBuildPlugin : Plugin<Project> {\nit.withXml {\nit.asElement().newChild(\"dependencies\") {\nfor (publicationData in publications) {\n+ if (publicationData.name.startsWith(\"stubs#\")) continue\nnewChild(\"dependency\") {\nnewChild(\"groupId\", groupId)\n- newChild(\"artifactId\", publicationData.name)\n+ newChild(\"artifactId\", publicationData.name.toValidPublicationName())\nnewChild(\"version\", version)\n}\n}\n@@ -339,8 +250,103 @@ class MPSBuildPlugin : Plugin<Project> {\n}\n+ private fun generateStubsSolution(dependency: ResolvedDependency, stubsDir: File) {\n+ val solutionName = getStubSolutionName(dependency)\n+ val jars = dependency.moduleArtifacts.map { it.file }.filter { it.extension == \"jar\" }\n+ val xml = newXmlDocument {\n+ newChild(\"solution\") {\n+ setAttribute(\"name\", solutionName)\n+ setAttribute(\"pluginKind\", \"PLUGIN_OTHER\")\n+ setAttribute(\"moduleVersion\", \"0\")\n+ setAttribute(\"uuid\", \"~$solutionName\")\n+ newChild(\"facets\") {\n+ newChild(\"facet\") {\n+ setAttribute(\"type\", \"java\")\n+ }\n+ }\n+ newChild(\"models\") {\n+ for (jar in jars) {\n+ newChild(\"modelRoot\") {\n+ setAttribute(\"type\", \"java_classes\")\n+ setAttribute(\"contentPath\", jar.parentFile.absolutePath)\n+ newChild(\"sourceRoot\") {\n+ setAttribute(\"location\", jar.name)\n+ }\n+ }\n+ }\n+ }\n+ newChild(\"dependencies\") {\n+ newChild(\"dependency\", \"6354ebe7-c22a-4a0f-ac54-50b52ab9b065(JDK)\") {\n+ setAttribute(\"reexport\", \"true\")\n+ }\n+ for (transitiveDep in dependency.children) {\n+ val n = getStubSolutionName(transitiveDep)\n+ newChild(\"dependency\", \"~$n($n)\") {\n+ setAttribute(\"reexport\", \"true\")\n+ }\n+ }\n+ }\n+ newChild(\"stubModelEntries\") {\n+ for (jar in jars) {\n+ newChild(\"stubModelEntry\") {\n+ setAttribute(\"path\", jar.absolutePath)\n+ }\n+ }\n+ }\n+ }\n+ }\n+ val solutionFile = stubsDir.resolve(solutionName).resolve(\"$solutionName.msd\")\n+ solutionFile.parentFile.mkdirs()\n+ solutionFile.writeText(xmlToString(xml))\n+ }\n+\n+ private fun Element.publicationDependenciesToXml(publicationData: BuildScriptGenerator.Publication,\n+ moduleName2pom: Map<String, Pom>,\n+ ownPublications: Set<String>,\n+ project: Project,\n+ mavenPublication: MavenPublication,\n+ settings: MPSBuildSettings) {\n+ newChild(\"dependencies\") {\n+ for (dependency in publicationData.dependencies) {\n+ val coordinates = Regex(\"stubs#(.+)#(.+)#(.+)\").matchEntire(dependency.name)\n+ if (coordinates != null) {\n+ newChild(\"dependency\") {\n+ newChild(\"groupId\", coordinates.groupValues[1])\n+ newChild(\"artifactId\", coordinates.groupValues[2])\n+ newChild(\"version\", coordinates.groupValues[3])\n+ }\n+ } else {\n+ val pom = moduleName2pom[dependency.name]\n+ if (pom != null) {\n+ newChild(\"dependency\") {\n+ newChild(\"artifactId\", pom.artifactId)\n+ newChild(\"groupId\", pom.group)\n+ newChild(\"version\", pom.version)\n+ }\n+ } else if (ownPublications.contains(dependency.name)) {\n+ newChild(\"dependency\") {\n+ newChild(\"artifactId\", dependency.name.toValidPublicationName())\n+ newChild(\"groupId\", project.group.toString())\n+ newChild(\"version\", mavenPublication.version)\n+ }\n+ }\n+ }\n+\n+ }\n+ }\n+ }\n+\nprivate fun String.toValidPublicationName() = replace(Regex(\"[^A-Za-z0-9_\\\\-.]\"), \"_\")\n+ private fun getStubSolutionName(dependency: ResolvedDependency): String {\n+// val clean: (String)->String = { it.replace(Regex(\"[^a-zA-Z0-9]\"), \"_\") }\n+// val group = clean(it.moduleGroup)\n+// val artifactId = clean(it.moduleName)\n+// val version = clean(it.moduleVersion)\n+// \"stubs.$group.$artifactId.$version\"\n+ return \"stubs#\" + dependency.module.id.toString().replace(\":\", \"#\")\n+ }\n+\nprivate fun ResolvedConfiguration.getAllDependencies(): List<ResolvedDependency> {\nval allDependencies: MutableList<ResolvedDependency> = ArrayList()\nobject : GraphWithCyclesVisitor<ResolvedDependency>() {\n@@ -423,31 +429,36 @@ class MPSBuildPlugin : Plugin<Project> {\nval pom = files.filter { it.extension == \"pom\" }.map { readPOM(it) }.firstOrNull()\nif (pom != null) poms += pom\nfor (file in files.filter { it.extension != \"pom\" }) {\n- copyDependency(file, targetFolder, pom)\n+ copyDependency(file, targetFolder, pom, dependency)\n}\n}\nreturn poms\n}\n- private fun copyDependency(file: File, targetFolder: File, pom: Pom?) {\n- val targetFile: File = pom?.let { pom ->\n+ private fun copyDependency(file: File, targetFolder: File, pom: Pom?, dependency: ResolvedDependency) {\n+ if (pom == null) {\n+ generateStubsSolution(dependency, targetFolder.resolve(\"stubs\"))\n+ } else {\nval moduleName = pom.getProperty(MODULE_NAME_PROPERTY)\nval ideaPluginId = pom.getProperty(IDEA_PLUGIN_ID_PROPERTY)\n- if (moduleName != null) {\n+ val targetFile = if (moduleName != null) {\nval isLibs = pom.getProperty(IS_LIBS_PROPERTY).toBoolean()\nval classifier = pom.getClassifier(file)\nif (isLibs) {\n- targetFolder.resolve(pom.group).resolve(\"$moduleName-lib\").resolve(\"$classifier.${file.extension}\")\n+ targetFolder.resolve(\"modules\").resolve(pom.group).resolve(\"$moduleName-lib\").resolve(\"$classifier.${file.extension}\")\n} else {\nval classifierSuffix = if (classifier.isEmpty()) \"\" else \"-$classifier\"\n- targetFolder.resolve(pom.group).resolve(\"$moduleName$classifierSuffix.${file.extension}\")\n+ targetFolder.resolve(\"modules\").resolve(pom.group).resolve(\"$moduleName$classifierSuffix.${file.extension}\")\n}\n} else if (ideaPluginId != null) {\n- targetFolder.resolve(pom.group).resolve(\"plugins\").resolve(ideaPluginId)\n+ targetFolder.resolve(\"plugins\").resolve(pom.group).resolve(ideaPluginId)\n} else null\n- } ?: targetFolder.resolve(file.name)\n-\n+ if (targetFile != null) {\ncopyAndUnzip(file, targetFile)\n+ } else {\n+ println(\"Ignored file $file from dependency ${dependency.module.id}\")\n+ }\n+ }\n}\nprivate fun copyAndUnzip(sourceFile: File, targetFile: File) {\n@@ -464,6 +475,7 @@ class MPSBuildPlugin : Plugin<Project> {\nrequire(pomFile.extension == \"pom\") { \"Not a .pom file: $pomFile\" }\nreturn cachedPomContent.computeIfAbsent(pomFile) {\ntry {\n+ println(\"Loading POM from $pomFile\")\nPom(readXmlFile(it).documentElement, it)\n} catch (e : Exception) {\nprintln(\"Failed to read $pomFile\")\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | pom was not found |
426,496 | 13.03.2022 09:47:37 | -3,600 | ea5cb5ee3a685eca1d6acbcd4a53e7ca49736e5e | mps("2020.3.6") is enough to download MPS from maven | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.kt",
"diff": "@@ -27,9 +27,9 @@ import kotlin.collections.ArrayList\nimport kotlin.collections.HashSet\nopen class MPSBuildSettings {\n+ private val mpsVersionPattern = Regex(\"(\\\\d+\\\\.\\\\d+)(\\\\.\\\\d+)?\")\nprivate lateinit var project: Project\n- lateinit var moduleDependenciesConfig: Configuration\n- lateinit var stubsDependenciesConfig: Configuration\n+ lateinit var dependenciesConfig: Configuration\nvar mpsDependenciesConfig: Configuration? = null\nvar mpsHome: String? = null\n@@ -39,25 +39,54 @@ open class MPSBuildSettings {\nprivate val macros: MutableMap<String, String> = HashMap()\nvar generatorHeapSize: String = \"2G\"\nval ideaPlugins: MutableList<IdeaPluginSettings> = ArrayList()\n+ private var mpsMajorVersion: String? = null\n+ private var mpsMinorVersion: String? = null\n+ private var mpsFullVersion: String? = null\n+\n+ fun mpsVersion(v: String) {\n+ require(mpsFullVersion == null) { \"MPS version is already set ($mpsFullVersion)\" }\n+ val match = mpsVersionPattern.matchEntire(v)\n+ ?: throw RuntimeException(\"Not a valid MPS version: $v\")\n+ mpsFullVersion = v\n+ mpsMajorVersion = match.groupValues[1]\n+ mpsMinorVersion = match.groupValues.getOrNull(2)\n+ mpsFromMaven(getMpsMavenCoordinates())\n+ }\n+\n+ fun getMpsDownloadUrl(): String {\n+ return \"https://download.jetbrains.com/mps/$mpsMajorVersion/MPS-$mpsFullVersion.zip\"\n+ }\n+\n+ fun getMpsMavenCoordinates(): String {\n+ return \"com.jetbrains:mps:$mpsFullVersion\"\n+ }\nfun setProject(p: Project) {\nproject = p\n- moduleDependenciesConfig = project.configurations.create(\"mpsBuild-modules\")\n- stubsDependenciesConfig = project.configurations.create(\"mpsBuild-stubs\")\n+ dependenciesConfig = project.configurations.create(\"mpsBuild-dependencies\")\n}\nfun externalModules(coordinates: Any) {\n- project.dependencies.add(moduleDependenciesConfig.name, coordinates)\n+ project.dependencies.add(dependenciesConfig.name, coordinates)\n}\nfun stubs(coordinates: Any) {\n- project.dependencies.add(stubsDependenciesConfig.name, coordinates)\n+ project.dependencies.add(dependenciesConfig.name, coordinates)\n}\n- fun mps(coordinates: Any) {\n- if (mpsDependenciesConfig == null) {\n- mpsDependenciesConfig = project.configurations.create(\"mpsBuild-mps\")\n+ fun mps(spec: Any) {\n+ if (spec is String && mpsVersionPattern.matches(spec)) {\n+ mpsVersion(spec)\n+ } else if (spec is String && spec.startsWith(\"https://\")) {\n+ TODO(\"Download URL is not supported yet\")\n+ } else {\n+ mpsFromMaven(spec)\n+ }\n}\n+\n+ fun mpsFromMaven(coordinates: Any) {\n+ require(mpsDependenciesConfig == null) { \"MPS dependency is already set\" }\n+ mpsDependenciesConfig = project.configurations.create(\"mpsBuild-mps\")\nproject.dependencies.add(mpsDependenciesConfig!!.name, coordinates)\n}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | mps("2020.3.6") is enough to download MPS from maven |
426,496 | 13.03.2022 10:36:44 | -3,600 | a3f0869cc7cc60b254324aecfd1c69de97212fc8 | Download MPS from JetBrains if it doesn't exist in maven | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -25,6 +25,7 @@ import org.modelix.buildtools.*\nimport org.w3c.dom.Element\nimport org.zeroturnaround.zip.ZipUtil\nimport java.io.File\n+import java.io.FileOutputStream\nimport java.io.IOException\nimport java.net.URL\nimport java.nio.charset.StandardCharsets\n@@ -48,16 +49,10 @@ class MPSBuildPlugin : Plugin<Project> {\nproject_.afterEvaluate { project: Project ->\nsettings.validate()\nval buildDir = project.buildDir.resolve(\"mpsbuild\").normalize()\n- var mpsDir: File? = null\n+ val dependenciesDir = buildDir.resolve(\"dependencies\")\n- settings.mpsDependenciesConfig?.let {\n- mpsDir = buildDir.resolve(\"mps\")\n- for (file in it.resolve()) {\n- copyAndUnzip(file, mpsDir!!.resolve(file.name))\n- }\n- }\n+ val mpsDir = downloadMps(settings, buildDir.resolve(\"mps\"))\n- val dependenciesDir = buildDir.resolve(\"dependencies\")\nval dirsToMine = setOfNotNull(dependenciesDir, mpsDir)\nval copiedDependencies = copyDependencies(settings.dependenciesConfig, dependenciesDir.normalize())\nval moduleName2pom: Map<String, Pom> = copiedDependencies.map { it.getProperty(MODULE_NAME_PROPERTY) to it }\n@@ -250,6 +245,41 @@ class MPSBuildPlugin : Plugin<Project> {\n}\n+ private fun downloadMps(settings: MPSBuildSettings, targetDir: File): File? {\n+ var mpsDir: File? = null\n+ settings.mpsDependenciesConfig?.resolvedConfiguration?.lenientConfiguration?.let {\n+ for (file in it.files) {\n+ val targetFile = targetDir.resolve(file.name)\n+ if (!targetFile.exists()) {\n+ copyAndUnzip(file, targetFile)\n+ }\n+ mpsDir = targetFile\n+ }\n+ }\n+\n+ if (mpsDir == null) {\n+ val url = settings.getMpsDownloadUrl()\n+ if (url != null) {\n+ val file = targetDir.resolve(url.toString().substringAfterLast(\"/\"))\n+ if (!file.exists()) {\n+ println(\"Downloading $url\")\n+ file.parentFile.mkdirs()\n+ url.openStream().use { istream ->\n+ file.outputStream().use { ostream ->\n+ istream.copyTo(ostream)\n+ }\n+ }\n+ }\n+ if (file.isFile) {\n+ ZipUtil.explode(file)\n+ }\n+ mpsDir = file\n+ }\n+ }\n+\n+ return mpsDir\n+ }\n+\nprivate fun generateStubsSolution(dependency: ResolvedDependency, stubsDir: File) {\nval solutionName = getStubSolutionName(dependency)\nval jars = dependency.moduleArtifacts.map { it.file }.filter { it.extension == \"jar\" }\n"
},
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.kt",
"diff": "@@ -20,6 +20,7 @@ import org.modelix.buildtools.Macros\nimport org.modelix.buildtools.readXmlFile\nimport org.w3c.dom.Document\nimport java.io.ByteArrayInputStream\n+import java.net.URL\nimport java.nio.file.Path\nimport java.util.HashMap\nimport java.util.stream.Collectors\n@@ -42,6 +43,7 @@ open class MPSBuildSettings {\nprivate var mpsMajorVersion: String? = null\nprivate var mpsMinorVersion: String? = null\nprivate var mpsFullVersion: String? = null\n+ private var mpsDownloadUrl: URL? = null\nfun mpsVersion(v: String) {\nrequire(mpsFullVersion == null) { \"MPS version is already set ($mpsFullVersion)\" }\n@@ -53,8 +55,12 @@ open class MPSBuildSettings {\nmpsFromMaven(getMpsMavenCoordinates())\n}\n- fun getMpsDownloadUrl(): String {\n- return \"https://download.jetbrains.com/mps/$mpsMajorVersion/MPS-$mpsFullVersion.zip\"\n+ fun getMpsDownloadUrl(): URL? {\n+ if (mpsDownloadUrl != null) return mpsDownloadUrl\n+ if (mpsFullVersion != null) {\n+ return URL(\"https://download.jetbrains.com/mps/$mpsMajorVersion/MPS-$mpsFullVersion.zip\")\n+ }\n+ return null\n}\nfun getMpsMavenCoordinates(): String {\n@@ -77,8 +83,8 @@ open class MPSBuildSettings {\nfun mps(spec: Any) {\nif (spec is String && mpsVersionPattern.matches(spec)) {\nmpsVersion(spec)\n- } else if (spec is String && spec.startsWith(\"https://\")) {\n- TODO(\"Download URL is not supported yet\")\n+ } else if (spec is String && spec.contains(\"://\")) {\n+ mpsDownloadUrl = URL(spec)\n} else {\nmpsFromMaven(spec)\n}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Download MPS from JetBrains if it doesn't exist in maven |
426,496 | 13.03.2022 11:22:54 | -3,600 | 315355f51fa144f0bea76b6db2929157638599c4 | Declare more dependencies in the POM | [
{
"change_type": "ADD",
"old_path": null,
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/AllDependencyGraph.kt",
"diff": "+/*\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.modelix.buildtools\n+\n+class AllDependencyGraph(val resolver: ModuleResolver) : DependencyGraph<FoundModule, ModuleId>() {\n+ override fun getKey(element: FoundModule): ModuleId {\n+ return element.moduleId\n+ }\n+\n+ override fun getDependencies(element: FoundModule): Iterable<FoundModule> {\n+ return (element.getClassPathDependencies(resolver) + element.getClassPathDependencies(resolver)).toSet()\n+ }\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -493,7 +493,7 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nfun getPublications(): List<Publication> {\nval resolver = ModuleResolver(modulesMiner.getModules(), ignoredModules, true)\n- val dependencyGraph = GeneratorDependencyGraph(resolver)\n+ val dependencyGraph = AllDependencyGraph(resolver)\ndependencyGraph.load(getModulesToGenerate().mapNotNull { modulesMiner.getModules().getModules()[it] })\nval sourceModules = dependencyGraph.getNodes().flatMap { it.modules }.filter { it.owner is SourceModuleOwner }\nval generatorModules = sourceModules.flatMap { it.owner.modules.values - it }\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Declare more dependencies in the POM |
426,496 | 13.03.2022 12:21:05 | -3,600 | d5ec6aa3e6ae4013662181e2bb830cbaf165a564 | generate version number if none is set on the project | [
{
"change_type": "MODIFY",
"old_path": "build.gradle",
"new_path": "build.gradle",
"diff": "@@ -53,7 +53,7 @@ plugins {\nid \"org.jetbrains.kotlin.plugin.serialization\" version \"1.6.10\" apply false\n}\n-def githubCredentials = getGithubCredentials()\n+ext.githubCredentials = getGithubCredentials()\nif (System.getenv(\"NEXUS_USERNAME\") != null) ext.nexusUsername = System.getenv(\"NEXUS_USERNAME\")\nif (System.getenv(\"NEXUS_PASSWORD\") != null) ext.nexusPassword = System.getenv(\"NEXUS_PASSWORD\")\n"
},
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/build.gradle",
"new_path": "gradle-mpsbuild-plugin/build.gradle",
"diff": "@@ -38,9 +38,11 @@ publishing {\nmaven {\nname = \"GitHubPackages\"\nurl = uri(\"https://maven.pkg.github.com/modelix/modelix\")\n+ if (githubCredentials != null) {\ncredentials {\n- username = System.getenv(\"GITHUB_ACTOR\")\n- password = System.getenv(\"GITHUB_TOKEN\")\n+ username = githubCredentials[0]\n+ password = githubCredentials[1]\n+ }\n}\n}\n/* maven {\n"
},
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -30,11 +30,12 @@ import java.io.IOException\nimport java.net.URL\nimport java.nio.charset.StandardCharsets\nimport java.nio.file.Path\n-import java.util.ArrayList\n-import java.util.Enumeration\n+import java.text.SimpleDateFormat\n+import java.util.*\nimport java.util.jar.Manifest\nimport java.util.stream.Collectors\nimport kotlin.RuntimeException\n+import kotlin.collections.HashMap\nimport kotlin.collections.HashSet\nconst val MODULE_NAME_PROPERTY = \"mps.module.name\"\n@@ -98,7 +99,11 @@ class MPSBuildPlugin : Plugin<Project> {\nval publications = generator.getPublications()\nval publishing = project.extensions.findByType(PublishingExtension::class.java)\n- val publicationsVersion = (\"\" + project.version).ifEmpty { \"0.1\" }\n+ val publicationsVersion = if (project.version == Project.DEFAULT_VERSION) {\n+ null\n+ } else {\n+ (\"\" + project.version).ifEmpty { null }\n+ } ?: generateVersionNumber(generator.modulesMiner.getModules().mpsHome)\npublishing?.apply {\npublications {\nval ownPublications = publications.map { it.name }.toSet()\n@@ -280,6 +285,38 @@ class MPSBuildPlugin : Plugin<Project> {\nreturn mpsDir\n}\n+ private fun generateVersionNumber(mpsHome: File?): String {\n+ val mpsVersion = mpsHome?.let { readMPSVersion(it) }\n+ val timestamp = SimpleDateFormat(\"yyyyMMddHHmm\").format(Date())\n+ return if (mpsVersion == null) timestamp else \"$mpsVersion-$timestamp\"\n+ }\n+\n+ private fun readMPSVersion(mpsHome: File): String? {\n+ val buildPropertiesFiles = mpsHome.resolve(\"build.properties\")\n+ if (!buildPropertiesFiles.exists()) return null\n+ val buildProperties = Properties()\n+ buildPropertiesFiles.inputStream().use { buildProperties.load(it) }\n+\n+ return listOf(\n+ buildProperties[\"mpsBootstrapCore.version.major\"],\n+ buildProperties[\"mpsBootstrapCore.version.minor\"],\n+ buildProperties[\"mpsBootstrapCore.version.bugfixNr\"],\n+ buildProperties[\"mpsBootstrapCore.version.eap\"],\n+ ).filterNotNull()\n+ .map { it.toString().trim('.') }\n+ .filter { it.isNotEmpty() }\n+ .joinToString(\".\")\n+\n+/*\n+mpsBootstrapCore.version.major=2020\n+mpsBootstrapCore.version.minor=3\n+mpsBootstrapCore.version.bugfixNr=.6\n+mpsBootstrapCore.version.eap=\n+mpsBootstrapCore.version=2020.3\n+\n+ */\n+ }\n+\nprivate fun generateStubsSolution(dependency: ResolvedDependency, stubsDir: File) {\nval solutionName = getStubSolutionName(dependency)\nval jars = dependency.moduleArtifacts.map { it.file }.filter { it.extension == \"jar\" }\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | generate version number if none is set on the project |
426,496 | 13.03.2022 13:15:42 | -3,600 | c46a79cd1a186f5efd61a8d251f221900a27c530 | only lowercase characters are allow in artifact IDs (github packages) | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -307,14 +307,11 @@ class MPSBuildPlugin : Plugin<Project> {\n.filter { it.isNotEmpty() }\n.joinToString(\".\")\n-/*\n-mpsBootstrapCore.version.major=2020\n-mpsBootstrapCore.version.minor=3\n-mpsBootstrapCore.version.bugfixNr=.6\n-mpsBootstrapCore.version.eap=\n-mpsBootstrapCore.version=2020.3\n-\n- */\n+// mpsBootstrapCore.version.major=2020\n+// mpsBootstrapCore.version.minor=3\n+// mpsBootstrapCore.version.bugfixNr=.6\n+// mpsBootstrapCore.version.eap=\n+// mpsBootstrapCore.version=2020.3\n}\nprivate fun generateStubsSolution(dependency: ResolvedDependency, stubsDir: File) {\n@@ -403,7 +400,7 @@ mpsBootstrapCore.version=2020.3\n}\n}\n- private fun String.toValidPublicationName() = replace(Regex(\"[^A-Za-z0-9_\\\\-.]\"), \"_\")\n+ private fun String.toValidPublicationName() = replace(Regex(\"[^A-Za-z0-9_\\\\-.]\"), \"_\").toLowerCase()\nprivate fun getStubSolutionName(dependency: ResolvedDependency): String {\n// val clean: (String)->String = { it.replace(Regex(\"[^a-zA-Z0-9]\"), \"_\") }\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | only lowercase characters are allow in artifact IDs (github packages) |
426,496 | 15.03.2022 07:22:53 | -3,600 | 9eda7fcde4b89ae95422f7e25355d2e31731c42d | Add dependencies between publications to the .pom | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -78,7 +78,7 @@ class MPSBuildPlugin : Plugin<Project> {\n} else {\n(\"\" + project.version).ifEmpty { null }\n} ?: generateVersionNumber(settings.mpsFullVersion)\n-\n+ val mavenPublications = HashMap<MPSBuildSettings.PublicationSettings, MavenPublication>()\nlateinit var copiedDependencies: List<Pom>\nvar mpsDir: File? = null\n@@ -190,10 +190,28 @@ class MPSBuildPlugin : Plugin<Project> {\nrequire(publication != null) {\n\"Module $modules is used by multiple publications ${node.getReverseDependencies().mapNotNull(getPublication).map { it.name }}, but not part of any publication itself.\"\n}\n- println(\"Publication chunk ${publication?.name}\")\n+ println(\"Publication ${publication.name}\")\nfor (module in modules) {\nprintln(\" $module\")\n}\n+\n+ val dependencies = node.getDependencies().mapNotNull(getPublication)\n+ if (dependencies.isNotEmpty()) {\n+ mavenPublications[publication]!!.pom { pom ->\n+ pom.withXml { xml ->\n+ xml.asElement().newChild(\"dependencies\") {\n+ for (dependency in dependencies) {\n+ newChild(\"dependency\") {\n+ newChild(\"groupId\", project.group.toString())\n+ newChild(\"artifactId\", dependency.name.toValidPublicationName())\n+ newChild(\"version\", publicationsVersion)\n+ //newChild(\"classifier\", classifier)\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n}\nval packagedModulesDir = generator.getPackagedModulesDir()\n@@ -230,6 +248,7 @@ class MPSBuildPlugin : Plugin<Project> {\npublishing?.publications { publications ->\nfor (publicationData in settings.getPublications()) {\npublications.create(publicationData.name, MavenPublication::class.java) { publication ->\n+ mavenPublications[publicationData] = publication\npublication.groupId = project.group.toString()\npublication.artifactId = publicationData.name.toValidPublicationName()\npublication.version = publicationsVersion\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Add dependencies between publications to the .pom |
426,496 | 15.03.2022 08:56:36 | -3,600 | 7bba11211817503b33dcf57e51eecd8b7ba4b6fc | dependencies on stubs added to the .pom | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -45,6 +45,7 @@ const val IDEA_PLUGIN_ID_PROPERTY = \"idea.plugin.id\"\nconst val IS_LIBS_PROPERTY = \"mps.module.libs\"\nclass MPSBuildPlugin : Plugin<Project> {\n+ private val stubsPattern = Regex(\"stubs#([^#]+)#([^#]+)#([^#]+)\")\nprivate lateinit var project: Project\nprivate lateinit var settings: MPSBuildSettings\n@@ -194,30 +195,14 @@ class MPSBuildPlugin : Plugin<Project> {\nfor (module in modules) {\nprintln(\" $module\")\n}\n-\n- val dependencies = node.getDependencies().mapNotNull(getPublication)\n- if (dependencies.isNotEmpty()) {\n- mavenPublications[publication]!!.pom { pom ->\n- pom.withXml { xml ->\n- xml.asElement().newChild(\"dependencies\") {\n- for (dependency in dependencies) {\n- newChild(\"dependency\") {\n- newChild(\"groupId\", project.group.toString())\n- newChild(\"artifactId\", dependency.name.toValidPublicationName())\n- newChild(\"version\", publicationsVersion)\n- //newChild(\"classifier\", classifier)\n- }\n- }\n- }\n- }\n- }\n- }\n}\nval packagedModulesDir = generator.getPackagedModulesDir()\nfor (publication in settings.getPublications()) {\n- val modules = publication2dnode[publication]!!.getMergedNode().modules\n- .filter { !it.name.startsWith(\"stubs#\") }\n+ val dnode = publication2dnode[publication]!!.getMergedNode()\n+ val modulesAndStubs = dnode.modules\n+ val stubs = modulesAndStubs.filter { it.name.startsWith(\"stubs#\") }.toSet()\n+ val modules = modulesAndStubs - stubs\nval generatedFiles = modules.map { it.owner }.filterIsInstance<SourceModuleOwner>()\n.distinct().flatMap { generator.getGeneratedFiles(it) }.map { it.absoluteFile.normalize() }\nval zipFile = publicationsDir.resolve(\"${publication.name}.zip\")\n@@ -236,6 +221,34 @@ class MPSBuildPlugin : Plugin<Project> {\n}\n}\n}\n+\n+ val dependencies = dnode.getDependencies().mapNotNull(getPublication)\n+ if (dependencies.isNotEmpty() || stubs.isNotEmpty()) {\n+ mavenPublications[publication]!!.pom { pom ->\n+ pom.withXml { xml ->\n+ xml.asElement().newChild(\"dependencies\") {\n+ for (dependency in dependencies) {\n+ newChild(\"dependency\") {\n+ newChild(\"groupId\", project.group.toString())\n+ newChild(\"artifactId\", dependency.name.toValidPublicationName())\n+ newChild(\"version\", publicationsVersion)\n+ //newChild(\"classifier\", classifier)\n+ }\n+ }\n+ for (stub in stubs) {\n+ val match = stubsPattern.matchEntire(stub.name)\n+ ?: throw RuntimeException(\"Failed to extract maven coordinates from ${stub.name}\")\n+ newChild(\"dependency\") {\n+ newChild(\"groupId\", match.groupValues[1])\n+ newChild(\"artifactId\", match.groupValues[2])\n+ newChild(\"version\", match.groupValues[3])\n+ //newChild(\"classifier\", classifier)\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n}\nprintln(\"Version $publicationsVersion ready for publishing\")\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | dependencies on stubs added to the .pom |
426,496 | 15.03.2022 12:24:09 | -3,600 | eb5c0e94871264ae0ca86ec62bc5d49e2dc087ef | read XML files without validating them against the DTD | [
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/XmlUtils.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/XmlUtils.kt",
"diff": "@@ -95,6 +95,7 @@ fun readXmlFile(file: File): Document {\ntry {\nval dbf = DocumentBuilderFactory.newInstance()\n//dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true)\n+ disableDTD(dbf)\nval db = dbf.newDocumentBuilder()\nreturn db.parse(file)\n} catch (e: Exception) {\n@@ -105,10 +106,20 @@ fun readXmlFile(file: File): Document {\nfun readXmlFile(file: InputStream): Document {\nval dbf = DocumentBuilderFactory.newInstance()\n//dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true)\n+ disableDTD(dbf)\nval db = dbf.newDocumentBuilder()\nreturn db.parse(file)\n}\n+private fun disableDTD(dbf: DocumentBuilderFactory) {\n+ dbf.setValidating(false);\n+ dbf.setNamespaceAware(true);\n+ dbf.setFeature(\"http://xml.org/sax/features/namespaces\", false);\n+ dbf.setFeature(\"http://xml.org/sax/features/validation\", false);\n+ dbf.setFeature(\"http://apache.org/xml/features/nonvalidating/load-dtd-grammar\", false);\n+ dbf.setFeature(\"http://apache.org/xml/features/nonvalidating/load-external-dtd\", false);\n+}\n+\nfun newXmlDocument(body: (Document.()->Unit)? = null): Document {\nval dbf = DocumentBuilderFactory.newInstance()\n//dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true)\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | read XML files without validating them against the DTD |
426,496 | 15.03.2022 16:40:55 | -3,600 | 9c6ef5454fb637e46e254a5f678fb2f875f8d9d8 | idea plugins were missing in the publications | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -181,9 +181,12 @@ class MPSBuildPlugin : Plugin<Project> {\n}\nval packagedModulesDir = generator.getPackagedModulesDir()\n+ val generatedPlugins = generator.getGeneratedPlugins().entries.associate { it.key.name to it.value }\n+ val pluginModuleNames = settings.getPublications()\n+ .flatMap { it.ideaPlugins }.map { it.getImplementationModuleName() }.toSet()\nfor (publication in settings.getPublications()) {\nval dnode = publication2dnode[publication]!!.getMergedNode()\n- val modulesAndStubs = dnode.modules\n+ val modulesAndStubs = dnode.modules.filter { !pluginModuleNames.contains(it.name) }\nval stubs = modulesAndStubs.filter { it.name.startsWith(\"stubs#\") }.toSet()\nval modules = modulesAndStubs - stubs\nval generatedFiles = modules.map { it.owner }.filterIsInstance<SourceModuleOwner>()\n@@ -192,16 +195,28 @@ class MPSBuildPlugin : Plugin<Project> {\nzipFile.parentFile.mkdirs()\nzipFile.outputStream().use { os ->\nZipOutputStream(os).use { zipStream ->\n- for (file in generatedFiles) {\n- val path = packagedModulesDir.toPath().relativize(file.toPath()).toString()\n- require(!path.startsWith(\"..\") && !path.contains(\"/../\")) {\n- \"$file expected to be inside $packagedModulesDir\"\n+ val packFile: (File, Path, Path)->Unit = { file, path, parent ->\n+ val relativePath = parent.relativize(path).toString()\n+ require(!path.toString().startsWith(\"..\") && !path.toString().contains(\"/../\")) {\n+ \"$file expected to be inside $parent\"\n}\n- val entry = ZipEntry(path)\n+ val entry = ZipEntry(relativePath)\nzipStream.putNextEntry(entry)\nfile.inputStream().use { istream -> istream.copyTo(zipStream) }\nzipStream.closeEntry()\n}\n+ for (file in generatedFiles) {\n+ packFile(file, file.toPath(), packagedModulesDir.parentFile.toPath())\n+ }\n+ for (ideaPlugin in publication.ideaPlugins) {\n+ val pluginFolder = generatedPlugins[ideaPlugin.getImplementationModuleName()]\n+ ?: throw RuntimeException(\"Output for plugin '${ideaPlugin.getImplementationModuleName()}' not found\")\n+ for (file in pluginFolder.walk()) {\n+ if (file.isFile) {\n+ packFile(file, file.toPath(), pluginFolder.parentFile.parentFile.toPath())\n+ }\n+ }\n+ }\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -538,6 +538,10 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nreturn moduleJars + libJars\n}\n+ fun getGeneratedPlugins(): Map<FoundModule, File> {\n+ return ideaPlugins.associate { it.module to it.getPluginDir(buildDir) }\n+ }\n+\nprivate fun Element.createCompileTarget(\nmodules: List<FoundModule>,\nclassPath: List<File>,\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/FoundModules.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/FoundModules.kt",
"diff": "@@ -58,7 +58,7 @@ class FoundModules {\nif (existing.owner != module.owner) {\nprintln(\"\"\"\nDuplicate module ${module.moduleId}\n- in ${module.owner.path.getLocalAbsolutePath()}\n+ in ${module.owner.path.getLocalAbsolutePath()} (ignored)\nand ${existing.owner.path.getLocalAbsolutePath()}\n\"\"\".trimIndent())\n// throw RuntimeException(\"Module ${module.moduleId} (${module.name}) already exists\")\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | idea plugins were missing in the publications |
426,496 | 15.03.2022 20:23:04 | -3,600 | 0d486d02ea2799afb099e931381be5cd9bcdd10a | Dependencies on publications from other projects were missing | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -23,6 +23,8 @@ import org.gradle.api.artifacts.ResolvedConfiguration\nimport org.gradle.api.artifacts.ResolvedDependency\nimport org.gradle.api.publish.PublishingExtension\nimport org.gradle.api.publish.maven.MavenPublication\n+import org.gradle.api.publish.maven.tasks.GenerateMavenPom\n+import org.gradle.api.publish.maven.tasks.PublishToMavenRepository\nimport org.gradle.api.tasks.Exec\nimport org.modelix.buildtools.*\nimport org.zeroturnaround.zip.ZipUtil\n@@ -40,6 +42,7 @@ class MPSBuildPlugin : Plugin<Project> {\nprivate val stubsPattern = Regex(\"stubs#([^#]+)#([^#]+)#([^#]+)\")\nprivate lateinit var project: Project\nprivate lateinit var settings: MPSBuildSettings\n+ private val folder2owningDependency = HashMap<Path, ResolvedDependency>()\nprivate fun newTask(name: String, body: ()->Unit): Task {\nreturn project.task(name) { task ->\n@@ -156,8 +159,9 @@ class MPSBuildPlugin : Plugin<Project> {\nwhile (true) {\nvar anyMerge = false\nfor (n in graph.getNodes().filter { it.getReverseDependencies().size == 1 }) {\n+ if (n.modules.all { it.owner !is SourceModuleOwner }) continue\nval reverseDependencies = n.getReverseDependencies()\n- if (reverseDependencies.size != 1) continue\n+ if (reverseDependencies.size != 1) continue // may have changed, because this loop modifies the graph\nif (publication2dnode.values.map { it.getMergedNode() }.contains(n)) continue\ngraph.mergeNodes(n, reverseDependencies.first())\nanyMerge = true\n@@ -168,7 +172,11 @@ class MPSBuildPlugin : Plugin<Project> {\nensurePublicationsNotMerged()\nfor (node in graph.getNodes()) {\n- val modules = node.modules.filter { it.owner is SourceModuleOwner }.map { it.name }.sorted()\n+ val modules = node.modules\n+ .filter { it.owner is SourceModuleOwner }\n+ .map { it.name }\n+ .filter { !it.startsWith(\"stubs#\") }\n+ .sorted()\nif (modules.isEmpty()) continue\nval publication = getPublication(node)\nrequire(publication != null) {\n@@ -220,19 +228,31 @@ class MPSBuildPlugin : Plugin<Project> {\n}\n}\n- val dependencies = dnode.getDependencies().mapNotNull(getPublication)\n- if (dependencies.isNotEmpty() || stubs.isNotEmpty()) {\nmavenPublications[publication]!!.pom { pom ->\npom.withXml { xml ->\nxml.asElement().newChild(\"dependencies\") {\n- for (dependency in dependencies) {\n+ // dependencies between own publications\n+ for (dependency in dnode.getDependencies().mapNotNull(getPublication)) {\nnewChild(\"dependency\") {\nnewChild(\"groupId\", project.group.toString())\nnewChild(\"artifactId\", dependency.name.toValidPublicationName())\nnewChild(\"version\", publicationsVersion)\n- //newChild(\"classifier\", classifier)\n}\n}\n+\n+ // dependencies to downloaded publications\n+ val externalDependencies = (dnode.getDependencies() + dnode).flatMap { it.modules }\n+ .mapNotNull { getOwningDependency(it.owner.path.getLocalAbsolutePath()) }\n+ .distinct()\n+ for (dependency in externalDependencies) {\n+ newChild(\"dependency\") {\n+ newChild(\"groupId\", dependency.moduleGroup)\n+ newChild(\"artifactId\", dependency.moduleName)\n+ newChild(\"version\", dependency.moduleVersion)\n+ }\n+ }\n+\n+ // dependencies to java libraries\nfor (stub in stubs) {\nval match = stubsPattern.matchEntire(stub.name)\n?: throw RuntimeException(\"Failed to extract maven coordinates from ${stub.name}\")\n@@ -240,8 +260,6 @@ class MPSBuildPlugin : Plugin<Project> {\nnewChild(\"groupId\", match.groupValues[1])\nnewChild(\"artifactId\", match.groupValues[2])\nnewChild(\"version\", match.groupValues[3])\n- //newChild(\"classifier\", classifier)\n- }\n}\n}\n}\n@@ -258,7 +276,7 @@ class MPSBuildPlugin : Plugin<Project> {\nval publishing = project.extensions.findByType(PublishingExtension::class.java)\npublishing?.publications { publications ->\nfor (publicationData in settings.getPublications()) {\n- publications.create(publicationData.name, MavenPublication::class.java) { publication ->\n+ publications.create(\"_\"+ publicationData.name + \"_\", MavenPublication::class.java) { publication ->\nmavenPublications[publicationData] = publication\npublication.groupId = project.group.toString()\npublication.artifactId = publicationData.name.toValidPublicationName()\n@@ -272,7 +290,7 @@ class MPSBuildPlugin : Plugin<Project> {\npublication.artifact(artifact)\n}\n}\n- publications.create(\"allmodules\", MavenPublication::class.java) { publication ->\n+ publications.create(\"all\", MavenPublication::class.java) { publication ->\npublication.groupId = project.group.toString()\npublication.artifactId = \"all\"\npublication.version = publicationsVersion\n@@ -291,6 +309,10 @@ class MPSBuildPlugin : Plugin<Project> {\n}\n}\n}\n+\n+ project.tasks.withType(GenerateMavenPom::class.java).matching { it.name.matches(Regex(\".+_.+_.+\")) }.all {\n+ it.dependsOn(taskPackagePublications)\n+ }\n}\nprivate fun getPublicationsVersion() = if (project.version == Project.DEFAULT_VERSION) {\n@@ -530,12 +552,23 @@ class MPSBuildPlugin : Plugin<Project> {\n.resolve(dependency.moduleGroup)\n.resolve(dependency.moduleName)\n//.resolve(file.name)\n+ folder2owningDependency[targetFile.absoluteFile.toPath().normalize()] = dependency\ncopyAndUnzip(file, targetFile)\n}\nelse -> println(\"Ignored file $file from dependency ${dependency.module.id}\")\n}\n}\n+ private fun getOwningDependency(file: Path): ResolvedDependency? {\n+ var f: Path? = file.toAbsolutePath().normalize()\n+ while (f != null) {\n+ val owner = folder2owningDependency[f]\n+ if (owner != null) return owner\n+ f = f.parent\n+ }\n+ return null\n+ }\n+\nprivate fun copyAndUnzip(sourceFile: File, targetFile: File) {\ntargetFile.parentFile.mkdirs()\nif (sourceFile.extension == \"zip\") {\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Dependencies on publications from other projects were missing |
426,496 | 16.03.2022 10:00:15 | -3,600 | a42dfa0820fe9dccf9b9f2dd7d20077d92a5a0fb | use generated version number as the teamcity build number | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -358,7 +358,9 @@ class MPSBuildPlugin : Plugin<Project> {\nprivate fun generateVersionNumber(mpsVersion: String?): String {\nval timestamp = SimpleDateFormat(\"yyyyMMddHHmm\").format(Date())\n- return if (mpsVersion == null) timestamp else \"$mpsVersion-$timestamp\"\n+ val version = if (mpsVersion == null) timestamp else \"$mpsVersion-$timestamp\"\n+ println(\"##teamcity[buildNumber '${version}']\")\n+ return version\n}\nprivate fun readMPSVersion(mpsHome: File): String? {\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | use generated version number as the teamcity build number |
426,496 | 16.03.2022 13:34:13 | -3,600 | 358e8b04bc256360a69c9b378670021ca4517ec4 | Check for publication cycles before running the expensive ant script
This provides faster feedback after a change of the configuration. | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -88,16 +88,9 @@ class MPSBuildPlugin : Plugin<Project> {\n}\ntaskGenerateAntScript.dependsOn(taskCopyDependencies)\n- val taskAssembleMpsModules = project.tasks.create(\"assembleMpsModules\", Exec::class.java) {\n- it.workingDir = antScriptFile.parentFile\n- it.commandLine = listOf(\"ant\", \"-f\", antScriptFile.absolutePath, \"assemble\")\n- it.standardOutput = System.out\n- it.errorOutput = System.err\n- it.standardInput = System.`in`\n- }\n- taskAssembleMpsModules.dependsOn(taskGenerateAntScript)\n-\n- val taskPackagePublications = newTask(\"packageMpsPublications\") {\n+ lateinit var publication2dnode: Map<MPSBuildSettings.PublicationSettings, DependencyGraph<FoundModule, ModuleId>.DependencyNode>\n+ lateinit var getPublication: (DependencyGraph<FoundModule, ModuleId>.DependencyNode)->MPSBuildSettings.PublicationSettings?\n+ val taskCheckConfig = newTask(\"checkMpsbuildConfig\") {\nval resolver = ModuleResolver(generator.modulesMiner.getModules(), generator.ignoredModules)\nval graph = PublicationDependencyGraph(resolver)\nval publication2modules = settings.getPublications().associateWith { resolvePublicationModules(it, resolver).toSet() }\n@@ -112,7 +105,8 @@ class MPSBuildPlugin : Plugin<Project> {\n}\ngraph.load(publication2modules.values.flatten())\nval module2publication = publication2modules.flatMap { entry -> entry.value.map { it to entry.key } }.associate { it }\n- val getPublication: (DependencyGraph<FoundModule, ModuleId>.DependencyNode)->MPSBuildSettings.PublicationSettings? = {\n+\n+ getPublication = {\nit.modules.mapNotNull { module2publication[it] }.firstOrNull()\n}\n@@ -135,7 +129,7 @@ class MPSBuildPlugin : Plugin<Project> {\n}\n}\ncheckCyclesBetweenPublications()\n- val publication2dnode = publication2modules.entries.associate {\n+ publication2dnode = publication2modules.entries.associate {\nit.key to graph.mergeElements(it.value)\n}\ncheckCyclesBetweenPublications()\n@@ -187,7 +181,19 @@ class MPSBuildPlugin : Plugin<Project> {\n// println(\" $module\")\n// }\n}\n+ }\n+ taskCheckConfig.dependsOn(taskGenerateAntScript)\n+ val taskAssembleMpsModules = project.tasks.create(\"assembleMpsModules\", Exec::class.java) {\n+ it.workingDir = antScriptFile.parentFile\n+ it.commandLine = listOf(\"ant\", \"-f\", antScriptFile.absolutePath, \"assemble\")\n+ it.standardOutput = System.out\n+ it.errorOutput = System.err\n+ it.standardInput = System.`in`\n+ }\n+ taskAssembleMpsModules.dependsOn(taskGenerateAntScript)\n+\n+ val taskPackagePublications = newTask(\"packageMpsPublications\") {\nval packagedModulesDir = generator.getPackagedModulesDir()\nval generatedPlugins = generator.getGeneratedPlugins().entries.associate { it.key.name to it.value }\nval pluginModuleNames = settings.getPublications()\n@@ -269,8 +275,9 @@ class MPSBuildPlugin : Plugin<Project> {\nprintln(\"Version $publicationsVersion ready for publishing\")\n}\n+ taskPackagePublications.dependsOn(taskCheckConfig)\ntaskPackagePublications.dependsOn(taskAssembleMpsModules)\n- //taskPackagePublications.dependsOn(taskGenerateAntScript)\n+ taskAssembleMpsModules.mustRunAfter(taskCheckConfig) // fail fast\nval mpsPublicationsConfig = project.configurations.create(\"mpsPublications\")\nval publishing = project.extensions.findByType(PublishingExtension::class.java)\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Check for publication cycles before running the expensive ant script
This provides faster feedback after a change of the configuration. |
426,496 | 16.03.2022 16:36:22 | -3,600 | aa9e79b8edd8b9f4c2cd6c5c8b003ddd7492e62b | Allow to generate the pom without running the MPS ant script | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -193,47 +193,12 @@ class MPSBuildPlugin : Plugin<Project> {\n}\ntaskAssembleMpsModules.dependsOn(taskGenerateAntScript)\n- val taskPackagePublications = newTask(\"packageMpsPublications\") {\n- val packagedModulesDir = generator.getPackagedModulesDir()\n- val generatedPlugins = generator.getGeneratedPlugins().entries.associate { it.key.name to it.value }\n- val pluginModuleNames = settings.getPublications()\n- .flatMap { it.ideaPlugins }.map { it.getImplementationModuleName() }.toSet()\n+ val taskLoadPomDependencies = newTask(\"loadPomDependencies\") {\nfor (publication in settings.getPublications()) {\nval dnode = publication2dnode[publication]!!.getMergedNode()\n+ val pluginModuleNames = settings.getPluginModuleNames()\nval modulesAndStubs = dnode.modules.filter { !pluginModuleNames.contains(it.name) }\nval stubs = modulesAndStubs.filter { it.name.startsWith(\"stubs#\") }.toSet()\n- val modules = modulesAndStubs - stubs\n- val generatedFiles = modules.map { it.owner }.filterIsInstance<SourceModuleOwner>()\n- .distinct().flatMap { generator.getGeneratedFiles(it) }.map { it.absoluteFile.normalize() }\n- val zipFile = publicationsDir.resolve(\"${publication.name}.zip\")\n- zipFile.parentFile.mkdirs()\n- zipFile.outputStream().use { os ->\n- ZipOutputStream(os).use { zipStream ->\n- val packFile: (File, Path, Path)->Unit = { file, path, parent ->\n- val relativePath = parent.relativize(path).toString()\n- require(!path.toString().startsWith(\"..\") && !path.toString().contains(\"/../\")) {\n- \"$file expected to be inside $parent\"\n- }\n- val entry = ZipEntry(relativePath)\n- zipStream.putNextEntry(entry)\n- file.inputStream().use { istream -> istream.copyTo(zipStream) }\n- zipStream.closeEntry()\n- }\n- for (file in generatedFiles) {\n- packFile(file, file.toPath(), packagedModulesDir.parentFile.toPath())\n- }\n- for (ideaPlugin in publication.ideaPlugins) {\n- val pluginFolder = generatedPlugins[ideaPlugin.getImplementationModuleName()]\n- ?: throw RuntimeException(\"Output for plugin '${ideaPlugin.getImplementationModuleName()}' not found\")\n- for (file in pluginFolder.walk()) {\n- if (file.isFile) {\n- packFile(file, file.toPath(), pluginFolder.parentFile.parentFile.toPath())\n- }\n- }\n- }\n- }\n- }\n-\nmavenPublications[publication]!!.pom { pom ->\npom.withXml { xml ->\nxml.asElement().newChild(\"dependencies\") {\n@@ -272,10 +237,54 @@ class MPSBuildPlugin : Plugin<Project> {\n}\n}\n}\n+ }\n+ taskLoadPomDependencies.dependsOn(taskCheckConfig)\n+\n+ val taskPackagePublications = newTask(\"packageMpsPublications\") {\n+ val packagedModulesDir = generator.getPackagedModulesDir()\n+ val generatedPlugins = generator.getGeneratedPlugins().entries.associate { it.key.name to it.value }\n+ val pluginModuleNames = settings.getPluginModuleNames()\n+ for (publication in settings.getPublications()) {\n+ val dnode = publication2dnode[publication]!!.getMergedNode()\n+ val modulesAndStubs = dnode.modules.filter { !pluginModuleNames.contains(it.name) }\n+ val stubs = modulesAndStubs.filter { it.name.startsWith(\"stubs#\") }.toSet()\n+ val modules = modulesAndStubs - stubs\n+ val generatedFiles = modules.map { it.owner }.filterIsInstance<SourceModuleOwner>()\n+ .distinct().flatMap { generator.getGeneratedFiles(it) }.map { it.absoluteFile.normalize() }\n+ val zipFile = publicationsDir.resolve(\"${publication.name}.zip\")\n+ zipFile.parentFile.mkdirs()\n+ zipFile.outputStream().use { os ->\n+ ZipOutputStream(os).use { zipStream ->\n+ val packFile: (File, Path, Path)->Unit = { file, path, parent ->\n+ val relativePath = parent.relativize(path).toString()\n+ require(!path.toString().startsWith(\"..\") && !path.toString().contains(\"/../\")) {\n+ \"$file expected to be inside $parent\"\n+ }\n+ val entry = ZipEntry(relativePath)\n+ zipStream.putNextEntry(entry)\n+ file.inputStream().use { istream -> istream.copyTo(zipStream) }\n+ zipStream.closeEntry()\n+ }\n+ for (file in generatedFiles) {\n+ packFile(file, file.toPath(), packagedModulesDir.parentFile.toPath())\n+ }\n+ for (ideaPlugin in publication.ideaPlugins) {\n+ val pluginFolder = generatedPlugins[ideaPlugin.getImplementationModuleName()]\n+ ?: throw RuntimeException(\"Output for plugin '${ideaPlugin.getImplementationModuleName()}' not found\")\n+ for (file in pluginFolder.walk()) {\n+ if (file.isFile) {\n+ packFile(file, file.toPath(), pluginFolder.parentFile.parentFile.toPath())\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\nprintln(\"Version $publicationsVersion ready for publishing\")\n}\ntaskPackagePublications.dependsOn(taskCheckConfig)\n+ taskPackagePublications.dependsOn(taskLoadPomDependencies)\ntaskPackagePublications.dependsOn(taskAssembleMpsModules)\ntaskAssembleMpsModules.mustRunAfter(taskCheckConfig) // fail fast\n@@ -318,7 +327,7 @@ class MPSBuildPlugin : Plugin<Project> {\n}\nproject.tasks.withType(GenerateMavenPom::class.java).matching { it.name.matches(Regex(\".+_.+_.+\")) }.all {\n- it.dependsOn(taskPackagePublications)\n+ it.dependsOn(taskLoadPomDependencies)\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.kt",
"diff": "@@ -40,6 +40,10 @@ open class MPSBuildSettings {\nfun getPublications(): List<PublicationSettings> = publications.values.toList()\n+ fun getPluginModuleNames(): Set<String> {\n+ return getPublications().flatMap { it.ideaPlugins }.map { it.getImplementationModuleName() }.toSet()\n+ }\n+\nfun mpsVersion(v: String) {\nrequire(mpsFullVersion == null) { \"MPS version is already set ($mpsFullVersion)\" }\nval match = mpsVersionPattern.matchEntire(v)\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Allow to generate the pom without running the MPS ant script |
426,496 | 16.03.2022 16:56:48 | -3,600 | bf2a4067fc143b1a24946a2991b228d5e17f5ee5 | use the MPS major version only (e.g. 2020.3) to generate a publication version
Instead of the full version (e.g. 2020.3.6). Usually modules work in any
bugfix version of the same major version. | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -335,7 +335,7 @@ class MPSBuildPlugin : Plugin<Project> {\nnull\n} else {\n(\"\" + project.version).ifEmpty { null }\n- } ?: generateVersionNumber(settings.mpsFullVersion)\n+ } ?: generateVersionNumber(settings.mpsMajorVersion)\nprivate fun downloadMps(settings: MPSBuildSettings, targetDir: File): File? {\nvar mpsDir: File? = null\n"
},
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.kt",
"diff": "@@ -33,7 +33,7 @@ open class MPSBuildSettings {\nprivate val searchPaths: MutableList<String> = ArrayList()\nprivate val macros: MutableMap<String, String> = HashMap()\nvar generatorHeapSize: String = \"2G\"\n- private var mpsMajorVersion: String? = null\n+ var mpsMajorVersion: String? = null\nprivate var mpsMinorVersion: String? = null\nvar mpsFullVersion: String? = null\nprivate var mpsDownloadUrl: URL? = null\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | use the MPS major version only (e.g. 2020.3) to generate a publication version
Instead of the full version (e.g. 2020.3.6). Usually modules work in any
bugfix version of the same major version. |
426,496 | 18.03.2022 14:53:50 | -3,600 | 3b007eea153262333b5dccc56b816a0c3eec7c63 | create gradle tasks earlier to allow defining dependencies on them | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -44,6 +44,14 @@ class MPSBuildPlugin : Plugin<Project> {\nprivate lateinit var settings: MPSBuildSettings\nprivate val folder2owningDependency = HashMap<Path, ResolvedDependency>()\n+ lateinit var taskCopyDependencies: Task\n+ lateinit var taskGenerateAntScript: Task\n+ lateinit var taskCheckConfig: Task\n+ lateinit var taskLoadPomDependencies: Task\n+ lateinit var taskPackagePublications: Task\n+\n+ private fun newTask(name: String): Task = project.task(name)\n+\nprivate fun newTask(name: String, body: ()->Unit): Task {\nreturn project.task(name) { task ->\nval action = Action { task: Task? ->\n@@ -53,11 +61,24 @@ class MPSBuildPlugin : Plugin<Project> {\n}\n}\n+ private fun taskBody(task: Task, body: ()->Unit) {\n+ val action = Action { task: Task? ->\n+ body()\n+ }\n+ task.actions = listOf(action)\n+ }\n+\noverride fun apply(project_: Project) {\nproject = project_\nsettings = project.extensions.create(\"mpsBuild\", MPSBuildSettings::class.java)\nsettings.setProject(project_)\n+ taskCopyDependencies = newTask(\"copyDependencies\")\n+ taskGenerateAntScript = newTask(\"generateMpsAntScript\")\n+ taskCheckConfig = newTask(\"checkMpsbuildConfig\")\n+ taskLoadPomDependencies = newTask(\"loadPomDependencies\")\n+ taskPackagePublications = newTask(\"packageMpsPublications\")\n+\nproject_.afterEvaluate { project__: Project ->\nsettings.validate()\nafterEvaluate()\n@@ -74,14 +95,14 @@ class MPSBuildPlugin : Plugin<Project> {\nvar mpsDir: File? = null\n- val taskCopyDependencies = newTask(\"copyDependencies\") {\n+ taskBody(taskCopyDependencies) {\ncopyDependencies(settings.dependenciesConfig, dependenciesDir.normalize())\nmpsDir = downloadMps(settings, buildDir.resolve(\"mps\"))\n-\n}\n+ settings.getTaskDependencies().forEach { taskCopyDependencies.dependsOn(it) }\nlateinit var generator: BuildScriptGenerator\n- val taskGenerateAntScript = newTask(\"generateMpsAntScript\") {\n+ taskBody(taskGenerateAntScript) {\nval dirsToMine = setOfNotNull(dependenciesDir, mpsDir)\ngenerator = createBuildScriptGenerator(settings, project, buildDir, dirsToMine)\ngenerateAntScript(generator, antScriptFile)\n@@ -90,7 +111,8 @@ class MPSBuildPlugin : Plugin<Project> {\nlateinit var publication2dnode: Map<MPSBuildSettings.PublicationSettings, DependencyGraph<FoundModule, ModuleId>.DependencyNode>\nlateinit var getPublication: (DependencyGraph<FoundModule, ModuleId>.DependencyNode)->MPSBuildSettings.PublicationSettings?\n- val taskCheckConfig = newTask(\"checkMpsbuildConfig\") {\n+\n+ taskBody(taskCheckConfig) {\nval resolver = ModuleResolver(generator.modulesMiner.getModules(), generator.ignoredModules)\nval graph = PublicationDependencyGraph(resolver)\nval publication2modules = settings.getPublications().associateWith { resolvePublicationModules(it, resolver).toSet() }\n@@ -193,7 +215,7 @@ class MPSBuildPlugin : Plugin<Project> {\n}\ntaskAssembleMpsModules.dependsOn(taskGenerateAntScript)\n- val taskLoadPomDependencies = newTask(\"loadPomDependencies\") {\n+ taskBody(taskLoadPomDependencies) {\nfor (publication in settings.getPublications()) {\nval dnode = publication2dnode[publication]!!.getMergedNode()\nval pluginModuleNames = settings.getPluginModuleNames()\n@@ -240,7 +262,7 @@ class MPSBuildPlugin : Plugin<Project> {\n}\ntaskLoadPomDependencies.dependsOn(taskCheckConfig)\n- val taskPackagePublications = newTask(\"packageMpsPublications\") {\n+ taskBody(taskPackagePublications) {\nval packagedModulesDir = generator.getPackagedModulesDir()\nval generatedPlugins = generator.getGeneratedPlugins().entries.associate { it.key.name to it.value }\nval pluginModuleNames = settings.getPluginModuleNames()\n"
},
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildSettings.kt",
"diff": "@@ -37,6 +37,13 @@ open class MPSBuildSettings {\nprivate var mpsMinorVersion: String? = null\nvar mpsFullVersion: String? = null\nprivate var mpsDownloadUrl: URL? = null\n+ private val taskDependencies: MutableList<Any> = ArrayList()\n+\n+ fun getTaskDependencies(): List<Any> = taskDependencies\n+\n+ fun dependsOn(vararg tasks: Any) {\n+ taskDependencies.addAll(tasks)\n+ }\nfun getPublications(): List<PublicationSettings> = publications.values.toList()\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | create gradle tasks earlier to allow defining dependencies on them |
426,496 | 18.03.2022 16:30:24 | -3,600 | 41940fa9bda0bae1d0f3b086a8d130f299100239 | Plugins where the META-INF/plugn.xml is part of a jar where not found | [
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/FoundModules.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/FoundModules.kt",
"diff": "@@ -37,7 +37,11 @@ class FoundModules {\n}\nresult += pluginId to plugin\nfor (dependency in plugin.pluginDependencies) {\n+ try {\ngetPluginWithDependencies(dependency, result)\n+ } catch (e: RuntimeException) {\n+ throw RuntimeException(\"Failed to resolve dependencies for plugin $pluginId in ${plugin.path.getLocalAbsolutePath()}\", e)\n+ }\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModulesMiner.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/ModulesMiner.kt",
"diff": "@@ -19,7 +19,9 @@ import org.zeroturnaround.zip.ZipUtil\nimport java.io.File\nimport java.io.FileInputStream\nimport java.io.InputStream\n+import java.util.*\nimport java.util.zip.ZipEntry\n+import kotlin.collections.HashMap\nclass ModulesMiner() {\n@@ -70,17 +72,24 @@ class ModulesMiner() {\nmodules.addPlugin(PluginModuleOwner(origin.localModulePath(file), \"com.intellij.modules.mps\", \"MPS Workbench\", setOf()))\n} else if (!file.nameWithoutExtension.endsWith(\"-src\") && !file.nameWithoutExtension.endsWith(\"-generator\")) {\nval libraryModuleOwner = LibraryModuleOwner(origin.localModulePath(file), owner as? PluginModuleOwner)\n- val modules: MutableMap<String, FoundModule> = HashMap()\n+ val libraryModules: MutableMap<String, FoundModule> = HashMap()\nval jarContentVisitor = { stream: InputStream, entry: ZipEntry ->\n- if (entry.name == \"META-INF/module.xml\") {\n+ when (entry.name) {\n+ \"META-INF/module.xml\" -> {\nloadModules(stream, libraryModuleOwner)\n}\n+ \"META-INF/plugin.xml\" -> {\n+ modules.addPlugin(PluginModuleOwner.fromPluginFolder(origin.localModulePath(file)))\n+ }\n+ else -> {\nwhen (entry.name.substringAfterLast('.', \"\").lowercase()) {\n\"msd\", \"mpl\", \"devkit\" -> {\nloadModules(stream, libraryModuleOwner)\n}\n}\n}\n+ }\n+ }\nval srcAndGeneratorNames: Set<String> = (\nsetOf(file.nameWithoutExtension + \"-src.\" + file.extension) +\n(file.nameWithoutExtension + \"-generator.\" + file.extension) +\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/PluginModuleOwner.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/PluginModuleOwner.kt",
"diff": "@@ -15,9 +15,15 @@ package org.modelix.buildtools\nimport java.io.ByteArrayInputStream\nimport java.io.File\n+import java.io.FileInputStream\nimport java.io.StringReader\n+import java.net.URI\n+import java.nio.file.FileSystems\n+import java.nio.file.Path\nimport java.util.regex.Matcher\nimport java.util.regex.Pattern\n+import java.util.zip.ZipInputStream\n+import kotlin.io.path.readLines\n/**\n* Modules packaged as an IDEA plugin containing a META-INF/plugin.xml file.\n@@ -51,11 +57,22 @@ class PluginModuleOwner(path: ModulePath, val pluginId: String, val name: String\ncompanion object {\nfun fromPluginFolder(path: ModulePath): PluginModuleOwner {\nval pluginPath = path.getLocalAbsolutePath().toFile()\n- val pluginDescriptorFile = File(File(pluginPath, \"META-INF\"), \"plugin.xml\")\n+ val lines = if (pluginPath.isFile && pluginPath.extension == \"jar\") {\n+ val uri = URI(\"jar\", pluginPath.toURI().toString(), null)\n+ FileSystems.newFileSystem(uri, mapOf<String, Any>(), null).use {\n+ it.getPath(\"META-INF\", \"plugin.xml\").readLines()\n+ }\n+ } else {\n+ path.getLocalAbsolutePath().resolve(\"META-INF\").resolve(\"Plugin.xml\").readLines()\n+ }\n+ return fromPluginDescriptor(path, lines)\n+ }\n+\n+ private fun fromPluginDescriptor(path: ModulePath, lines: List<String>): PluginModuleOwner {\nvar pluginId: String? = null\nvar name: String? = null\nval pluginDependencies: MutableSet<String> = HashSet()\n- for (line in pluginDescriptorFile.readLines()) {\n+ for (line in lines) {\nif (pluginId == null) {\nval idMatch = Regex(\"\"\".*<id>(.+)</id>.*\"\"\").matchEntire(line)\nif (idMatch != null) pluginId = idMatch.groupValues[1]\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Plugins where the META-INF/plugn.xml is part of a jar where not found |
426,496 | 18.03.2022 17:27:25 | -3,600 | bff88b121492a18a152964411d69903004a16536 | MPS 2021.2 requires a different classpath for the generator | [
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"new_path": "gradle-mpsbuild-plugin/src/main/java/org/modelix/gradle/mpsbuild/MPSBuildPlugin.kt",
"diff": "@@ -401,29 +401,6 @@ class MPSBuildPlugin : Plugin<Project> {\nreturn version\n}\n- private fun readMPSVersion(mpsHome: File): String? {\n- val buildPropertiesFiles = mpsHome.resolve(\"build.properties\")\n- if (!buildPropertiesFiles.exists()) return null\n- val buildProperties = Properties()\n- buildPropertiesFiles.inputStream().use { buildProperties.load(it) }\n-\n- return listOfNotNull(\n- buildProperties[\"mpsBootstrapCore.version.major\"],\n- buildProperties[\"mpsBootstrapCore.version.minor\"],\n- buildProperties[\"mpsBootstrapCore.version.bugfixNr\"],\n- buildProperties[\"mpsBootstrapCore.version.eap\"],\n- )\n- .map { it.toString().trim('.') }\n- .filter { it.isNotEmpty() }\n- .joinToString(\".\")\n-\n-// mpsBootstrapCore.version.major=2020\n-// mpsBootstrapCore.version.minor=3\n-// mpsBootstrapCore.version.bugfixNr=.6\n-// mpsBootstrapCore.version.eap=\n-// mpsBootstrapCore.version=2020.3\n- }\n-\nprivate fun generateStubsSolution(dependency: ResolvedDependency, stubsDir: File) {\nval solutionName = getStubSolutionName(dependency)\nval jars = dependency.moduleArtifacts.map { it.file }.filter { it.extension == \"jar\" }\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"new_path": "mps-build-tools/src/main/kotlin/org/modelix/buildtools/BuildScriptGenerator.kt",
"diff": "@@ -18,7 +18,11 @@ import org.w3c.dom.Document\nimport org.w3c.dom.Element\nimport java.io.File\nimport java.nio.file.Path\n+import java.util.*\nimport javax.xml.parsers.DocumentBuilderFactory\n+import kotlin.collections.ArrayList\n+import kotlin.collections.HashMap\n+import kotlin.collections.HashSet\nimport kotlin.io.path.absolutePathString\nimport kotlin.io.path.pathString\n@@ -64,10 +68,38 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\n)\n}\n+ fun getMpsVersion(): String {\n+ return readMPSVersion(getMpsHome())\n+ }\n+\n+ private fun readMPSVersion(mpsHome: File): String {\n+ val buildPropertiesFiles = mpsHome.resolve(\"build.properties\")\n+ require(buildPropertiesFiles.exists()) { \"${buildPropertiesFiles.absolutePath} not found\" }\n+ val buildProperties = Properties()\n+ buildPropertiesFiles.inputStream().use { buildProperties.load(it) }\n+\n+ return listOfNotNull(\n+ buildProperties[\"mpsBootstrapCore.version.major\"],\n+ buildProperties[\"mpsBootstrapCore.version.minor\"],\n+ //buildProperties[\"mpsBootstrapCore.version.bugfixNr\"],\n+ buildProperties[\"mpsBootstrapCore.version.eap\"],\n+ )\n+ .map { it.toString().trim('.') }\n+ .filter { it.isNotEmpty() }\n+ .joinToString(\".\")\n+\n+// mpsBootstrapCore.version.major=2020\n+// mpsBootstrapCore.version.minor=3\n+// mpsBootstrapCore.version.bugfixNr=.6\n+// mpsBootstrapCore.version.eap=\n+// mpsBootstrapCore.version=2020.3\n+ }\n+\nfun generateAnt(): Document {\nval resolver = ModuleResolver(modulesMiner.getModules(), ignoredModules)\nval (plan, dependencyGraph) = generatePlan(getModulesToGenerate(), resolver)\nval mpsHome = getMpsHome()\n+ val mpsVersion = getMpsVersion()\nval macros = getMacros()\nval module2ideaPlugin = ideaPlugins.associateBy { it.module }\n@@ -94,14 +126,18 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nnewChild(\"path\") {\nsetAttribute(\"id\", \"path.mps.ant.path\")\n+ val addLib: (String)->Unit = { path ->\nnewChild(\"pathelement\") {\n- setAttribute(\"location\", \"\\${mps.home}/lib/ant/lib/ant-mps.jar\")\n+ setAttribute(\"location\", \"\\${mps.home}/$path\")\n}\n- newChild(\"pathelement\") {\n- setAttribute(\"location\", \"\\${mps.home}/lib/log4j.jar\")\n}\n- newChild(\"pathelement\") {\n- setAttribute(\"location\", \"\\${mps.home}/lib/jdom.jar\")\n+ if (mpsVersion < \"2021.2\") {\n+ addLib(\"lib/ant/lib/ant-mps.jar\")\n+ addLib(\"lib/log4j.jar\")\n+ addLib(\"lib/jdom.jar\")\n+ } else {\n+ addLib(\"lib/ant/lib/ant-mps.jar\")\n+ addLib(\"lib/util.jar\")\n}\n}\nnewChild(\"path\") {\n@@ -176,6 +212,9 @@ class BuildScriptGenerator(val modulesMiner: ModulesMiner,\nnewChild(\"arg\") {\nsetAttribute(\"value\", \"-Xmx$generatorHeapSize\")\n}\n+ newChild(\"arg\") {\n+ setAttribute(\"value\", \"-Dfile.encoding=UTF8\")\n+ }\n}\nfor (macro in macros.macros) {\nnewChild(\"macro\") {\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | MPS 2021.2 requires a different classpath for the generator |
426,496 | 18.03.2022 20:17:20 | -3,600 | abe9fd2f6803a0068db956f258da41e1bdd25c58 | Try to use itemis nexus with a different JDK distribution | [
{
"change_type": "MODIFY",
"old_path": ".github/workflows/integrationtests.yml",
"new_path": ".github/workflows/integrationtests.yml",
"diff": "@@ -23,9 +23,10 @@ jobs:\ngradle-runIntegrationTests-\ngradle-\n- name: Set up JDK 11\n- uses: actions/setup-java@v1\n+ uses: actions/setup-java@v2\nwith:\n- java-version: 11\n+ distribution: 'temurin'\n+ java-version: '11'\n- name: Integration Tests\nenv:\nGITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n"
},
{
"change_type": "MODIFY",
"old_path": ".github/workflows/modelclient.yml",
"new_path": ".github/workflows/modelclient.yml",
"diff": "@@ -23,9 +23,10 @@ jobs:\ngradle-build-\ngradle-\n- name: Set up JDK 11\n- uses: actions/setup-java@v1\n+ uses: actions/setup-java@v2\nwith:\n- java-version: 11\n+ distribution: 'temurin'\n+ java-version: '11'\n- name: Assemble\nenv:\nGITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n@@ -38,9 +39,10 @@ jobs:\nsteps:\n- uses: actions/checkout@v1\n- name: Set up JDK 11\n- uses: actions/setup-java@v1\n+ uses: actions/setup-java@v2\nwith:\n- java-version: 11\n+ distribution: 'temurin'\n+ java-version: '11'\n- uses: actions/[email protected]\nwith:\npath: |\n@@ -63,9 +65,10 @@ jobs:\nsteps:\n- uses: actions/checkout@v1\n- name: Set up JDK 11\n- uses: actions/setup-java@v1\n+ uses: actions/setup-java@v2\nwith:\n- java-version: 11\n+ distribution: 'temurin'\n+ java-version: '11'\n- uses: actions/[email protected]\nwith:\npath: |\n@@ -88,9 +91,10 @@ jobs:\nsteps:\n- uses: actions/checkout@v1\n- name: Set up JDK 11\n- uses: actions/setup-java@v1\n+ uses: actions/setup-java@v2\nwith:\n- java-version: 11\n+ distribution: 'temurin'\n+ java-version: '11'\n- uses: actions/[email protected]\nwith:\npath: |\n"
},
{
"change_type": "MODIFY",
"old_path": ".github/workflows/modelserver.yml",
"new_path": ".github/workflows/modelserver.yml",
"diff": "@@ -13,9 +13,10 @@ jobs:\nsteps:\n- uses: actions/checkout@v1\n- name: Set up JDK 11\n- uses: actions/setup-java@v1\n+ uses: actions/setup-java@v2\nwith:\n- java-version: 11\n+ distribution: 'temurin'\n+ java-version: '11'\n- uses: actions/[email protected]\nwith:\npath: |\n@@ -38,9 +39,10 @@ jobs:\nsteps:\n- uses: actions/checkout@v1\n- name: Set up JDK 11\n- uses: actions/setup-java@v1\n+ uses: actions/setup-java@v2\nwith:\n- java-version: 11\n+ distribution: 'temurin'\n+ java-version: '11'\n- uses: actions/[email protected]\nwith:\npath: |\n@@ -63,9 +65,10 @@ jobs:\nsteps:\n- uses: actions/checkout@v1\n- name: Set up JDK 11\n- uses: actions/setup-java@v1\n+ uses: actions/setup-java@v2\nwith:\n- java-version: 11\n+ distribution: 'temurin'\n+ java-version: '11'\n- uses: actions/[email protected]\nwith:\npath: |\n@@ -88,9 +91,10 @@ jobs:\nsteps:\n- uses: actions/checkout@v1\n- name: Set up JDK 11\n- uses: actions/setup-java@v1\n+ uses: actions/setup-java@v2\nwith:\n- java-version: 11\n+ distribution: 'temurin'\n+ java-version: '11'\n- uses: actions/[email protected]\nwith:\npath: |\n"
},
{
"change_type": "MODIFY",
"old_path": ".github/workflows/overallbuild.yml",
"new_path": ".github/workflows/overallbuild.yml",
"diff": "@@ -13,9 +13,10 @@ jobs:\nsteps:\n- uses: actions/checkout@v1\n- name: Set up JDK 11\n- uses: actions/setup-java@v1\n+ uses: actions/setup-java@v2\nwith:\n- java-version: 11\n+ distribution: 'temurin'\n+ java-version: '11'\n- uses: actions/[email protected]\nwith:\npath: |\n"
},
{
"change_type": "MODIFY",
"old_path": ".github/workflows/publish.yml",
"new_path": ".github/workflows/publish.yml",
"diff": "@@ -9,11 +9,12 @@ jobs:\nnewRelease:\nruns-on: ubuntu-latest\nsteps:\n- - uses: actions/checkout@v1\n+ - uses: actions/checkout@v2\n- name: Set up JDK 11\n- uses: actions/setup-java@v1\n+ uses: actions/setup-java@v2\nwith:\n- java-version: 11\n+ distribution: 'temurin'\n+ java-version: '11'\n- name: Use tag as version\nrun: echo \"${GITHUB_REF#refs/*/}\" > modelix.version\n- name: Build and Publish\n"
},
{
"change_type": "MODIFY",
"old_path": "build.gradle",
"new_path": "build.gradle",
"diff": "@@ -20,24 +20,7 @@ buildscript {\nmaven { url \"https://repo.maven.apache.org/maven2\" }\nmaven { url 'https://plugins.gradle.org/m2/' }\nmavenCentral()\n- maven {\n- url = uri(\"https://maven.pkg.github.com/mbeddr/mps-gradle-plugin\")\n- if (project.hasProperty(\"gpr.user\") && project.hasProperty(\"gpr.key\")) {\n- credentials {\n- username = project.findProperty(\"gpr.user\").toString()\n- password = project.findProperty(\"gpr.key\").toString()\n- }\n- } else if (System.getenv(\"GITHUB_ACTOR\") != null && System.getenv(\"GITHUB_TOKEN\") != null) {\n- credentials {\n- username = System.getenv(\"GITHUB_ACTOR\")\n- password = System.getenv(\"GITHUB_TOKEN\")\n- }\n- } else {\n- logger.error(\"Please specify your github username (gpr.user) and access token (gpr.key) in ~/.gradle/gradle.properties\")\n- }\n- }\n- //maven { url 'https://projects.itemis.de/nexus/content/repositories/mbeddr' }\n- //maven { url = uri(\"https://modelix.jfrog.io/artifactory/itemis/\") } // caching proxy for the itemis repo\n+ maven { url 'https://projects.itemis.de/nexus/content/repositories/mbeddr' }\n}\ndependencies {\n@@ -51,6 +34,7 @@ plugins {\nid \"org.jetbrains.kotlin.jvm\" version \"1.6.10\" apply false\nid \"org.jetbrains.kotlin.multiplatform\" version \"1.6.10\" apply false\nid \"org.jetbrains.kotlin.plugin.serialization\" version \"1.6.10\" apply false\n+ id \"maven-publish\"\n}\next.githubCredentials = getGithubCredentials()\n@@ -109,17 +93,27 @@ if (!project.hasProperty(\"gpr.key\") && System.getenv(\"GITHUB_TOKEN\") != null) {\next.setProperty(\"gpr.key\", System.getenv(\"GITHUB_TOKEN\"))\n}\n-allprojects {\n+subprojects {\n+ apply plugin: 'maven-publish'\n+\ngroup 'org.modelix'\nversion modelixVersion\nrepositories {\n/* It is useful to have the central maven repo before the Itemis's one\nas it is more reliable */\n+ mavenLocal()\nmaven { url \"https://repo.maven.apache.org/maven2\" }\nmavenCentral()\n+ maven { url 'https://projects.itemis.de/nexus/content/repositories/mbeddr' }\n+ }\n+\n+ publishing {\n+ repositories {\n+ if (githubCredentials != null) {\nmaven {\n- url = uri(\"https://maven.pkg.github.com/JetBrains/MPS-extensions\")\n+ name = \"GitHubPackages\"\n+ url = uri(\"https://maven.pkg.github.com/modelix/modelix\")\nif (githubCredentials != null) {\ncredentials {\nusername = githubCredentials[0]\n@@ -127,18 +121,20 @@ allprojects {\n}\n}\n}\n+ }\n+ if (project.hasProperty(\"artifacts.itemis.cloud.user\")) {\nmaven {\n- url = uri(\"https://maven.pkg.github.com/mbeddr/build.publish.mps\")\n- if (githubCredentials != null) {\n+ name = \"itemisCloud\"\n+ url = modelixVersion.contains(\"SNAPSHOT\")\n+ ? uri(\"https://artifacts.itemis.cloud/repository/maven-mps-snapshots/\")\n+ : uri(\"https://artifacts.itemis.cloud/repository/maven-mps-releases/\")\ncredentials {\n- username = githubCredentials[0]\n- password = githubCredentials[1]\n+ username = project.findProperty(\"artifacts.itemis.cloud.user\").toString()\n+ password = project.findProperty(\"artifacts.itemis.cloud.pw\").toString()\n+ }\n}\n}\n}\n- //maven { url 'https://projects.itemis.de/nexus/content/repositories/mbeddr' }\n- //maven { url = uri(\"https://modelix.jfrog.io/artifactory/itemis/\") } // caching proxy for the itemis repo\n- mavenLocal()\n}\n}\ndescription = \"Cloud storage and web UI for MPS\"\n"
},
{
"change_type": "MODIFY",
"old_path": "gradle-mpsbuild-plugin/build.gradle",
"new_path": "gradle-mpsbuild-plugin/build.gradle",
"diff": "@@ -34,27 +34,6 @@ jar {\n}\npublishing {\n- repositories {\n- maven {\n- name = \"GitHubPackages\"\n- url = uri(\"https://maven.pkg.github.com/modelix/modelix\")\n- if (githubCredentials != null) {\n- credentials {\n- username = githubCredentials[0]\n- password = githubCredentials[1]\n- }\n- }\n- }\n-/* maven {\n- url rootProject.publishingRepository\n- if (rootProject.hasProperty('nexusUsername')) {\n- credentials {\n- username rootProject.nexusUsername\n- password rootProject.nexusPassword\n- }\n- }\n- }*/\n- }\npublications {\nmodelixGradleMPSBuildPlugin(MavenPublication) {\ngroupId project.group\n"
},
{
"change_type": "MODIFY",
"old_path": "gradle-plugin/build.gradle",
"new_path": "gradle-plugin/build.gradle",
"diff": "@@ -36,25 +36,6 @@ jar {\n}\npublishing {\n- repositories {\n- maven {\n- name = \"GitHubPackages\"\n- url = uri(\"https://maven.pkg.github.com/modelix/modelix\")\n- credentials {\n- username = System.getenv(\"GITHUB_ACTOR\")\n- password = System.getenv(\"GITHUB_TOKEN\")\n- }\n- }\n-/* maven {\n- url rootProject.publishingRepository\n- if (rootProject.hasProperty('nexusUsername')) {\n- credentials {\n- username rootProject.nexusUsername\n- password rootProject.nexusPassword\n- }\n- }\n- }*/\n- }\npublications {\nmodelixGradlePlugin(MavenPublication) {\ngroupId project.group\n"
},
{
"change_type": "MODIFY",
"old_path": "headless-mps/build.gradle.kts",
"new_path": "headless-mps/build.gradle.kts",
"diff": "@@ -40,18 +40,6 @@ tasks.getByName(\"compileKotlin\") {\n}\npublishing {\n- repositories {\n- maven {\n- name = \"GitHubPackages\"\n- url = uri(\"https://maven.pkg.github.com/modelix/modelix\")\n- if (rootProject.ext.get(\"githubCredentials\") != null) {\n- credentials {\n- username = (rootProject.ext.get(\"githubCredentials\") as groovy.lang.Tuple<*>).get(0) as String\n- password = (rootProject.ext.get(\"githubCredentials\") as groovy.lang.Tuple<*>).get(1) as String\n- }\n- }\n- }\n- }\npublications {\ncreate<MavenPublication>(\"maven\") {\ngroupId = \"org.modelix\"\n"
},
{
"change_type": "MODIFY",
"old_path": "model-client/build.gradle",
"new_path": "model-client/build.gradle",
"diff": "@@ -156,25 +156,3 @@ String stripVersion(String fileNameWithVersion) {\nprintln \"stripVersion($fileNameWithVersion) -> $name\"\nreturn name\n}\n-\n-publishing {\n- repositories {\n- maven {\n- name = \"GitHubPackages\"\n- url = uri(\"https://maven.pkg.github.com/modelix/modelix\")\n- credentials {\n- username = System.getenv(\"GITHUB_ACTOR\")\n- password = System.getenv(\"GITHUB_TOKEN\")\n- }\n- }\n-/* maven {\n- url rootProject.publishingRepository\n- if (rootProject.hasProperty('nexusUsername')) {\n- credentials {\n- username rootProject.nexusUsername\n- password rootProject.nexusPassword\n- }\n- }\n- }*/\n- }\n-}\n"
},
{
"change_type": "MODIFY",
"old_path": "model-server/build.gradle.kts",
"new_path": "model-server/build.gradle.kts",
"diff": "@@ -105,25 +105,6 @@ application {\n}\npublishing {\n- repositories {\n- maven {\n- name = \"GitHubPackages\"\n- url = uri(\"https://maven.pkg.github.com/modelix/modelix\")\n- credentials {\n- username = System.getenv(\"GITHUB_ACTOR\")\n- password = System.getenv(\"GITHUB_TOKEN\")\n- }\n- }\n-/* maven {\n- url rootProject.publishingRepository\n- if (rootProject.hasProperty('nexusUsername')) {\n- credentials {\n- username rootProject.nexusUsername\n- password rootProject.nexusPassword\n- }\n- }\n- }*/\n- }\npublications {\n/* modelServer(MavenPublication) {\ngroupId project.group\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-build-tools/build.gradle.kts",
"new_path": "mps-build-tools/build.gradle.kts",
"diff": "@@ -25,18 +25,6 @@ tasks.getByName<Test>(\"test\") {\n}\npublishing {\n- repositories {\n- maven {\n- name = \"GitHubPackages\"\n- url = uri(\"https://maven.pkg.github.com/modelix/modelix\")\n- if (rootProject.ext.get(\"githubCredentials\") != null) {\n- credentials {\n- username = (rootProject.ext.get(\"githubCredentials\") as groovy.lang.Tuple<*>).get(0) as String\n- password = (rootProject.ext.get(\"githubCredentials\") as groovy.lang.Tuple<*>).get(1) as String\n- }\n- }\n- }\n- }\npublications {\ncreate<MavenPublication>(\"maven\") {\ngroupId = \"org.modelix\"\n"
},
{
"change_type": "MODIFY",
"old_path": "mps/build.gradle",
"new_path": "mps/build.gradle",
"diff": "@@ -205,25 +205,6 @@ task packageBuildScripts(type: Zip, dependsOn: buildMpsModules) {\n}\npublishing {\n- repositories {\n- maven {\n- name = \"GitHubPackages\"\n- url = uri(\"https://maven.pkg.github.com/modelix/modelix\")\n- credentials {\n- username = System.getenv(\"GITHUB_ACTOR\")\n- password = System.getenv(\"GITHUB_TOKEN\")\n- }\n- }\n-/* maven {\n- url rootProject.publishingRepository\n- if (rootProject.hasProperty('nexusUsername')) {\n- credentials {\n- username rootProject.nexusUsername\n- password rootProject.nexusPassword\n- }\n- }\n- }*/\n- }\npublications {\nmodelixMpsModelPlugin(MavenPublication) {\ngroupId 'org.modelix'\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Try to use itemis nexus with a different JDK distribution |
426,504 | 24.03.2022 10:05:22 | -3,600 | fa23ef9a97d73d2733111f65aa0671bccf98eb18 | harmonizing build.gradle with new changes in master | [
{
"change_type": "MODIFY",
"old_path": "build.gradle",
"new_path": "build.gradle",
"diff": "@@ -80,14 +80,6 @@ if (System.getenv(\"TRAVIS_TAG\") != null && !System.getenv(\"TRAVIS_TAG\").isEmpty(\nversionFile.write(ext.modelixVersion)\nprintln(\"modelix version: \" + ext.modelixVersion)\n-ext.releaseRepository = 'https://maven.pkg.github.com/modelix/modelix'\n-ext.snapshotRepository = 'https://projects.itemis.de/nexus/content/repositories/mbeddr_snapshots'\n-ext.publishingRepository = modelixVersion.endsWith(\"-SNAPSHOT\") ? snapshotRepository : releaseRepository\n-\n-println(\"gpr.user = \" + project.findProperty(\"gpr.user\"))\n-println(\"gpr.key = \" + project.findProperty(\"gpr.key\"))\n-println(\"GITHUB_ACTOR = \" + System.getenv(\"GITHUB_ACTOR\"))\n-println(\"GITHUB_TOKEN = \" + System.getenv(\"GITHUB_TOKEN\"))\nif (!project.hasProperty(\"gpr.user\") && System.getenv(\"GITHUB_ACTOR\") != null) {\next.setProperty(\"gpr.user\", System.getenv(\"GITHUB_ACTOR\"))\n}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | harmonizing build.gradle with new changes in master |
426,504 | 24.03.2022 10:09:48 | -3,600 | aca3b3ac663a24a54df733577562cb3c34fb2d92 | update several build.gradle files based on changes on master | [
{
"change_type": "MODIFY",
"old_path": "gradle-plugin/build.gradle",
"new_path": "gradle-plugin/build.gradle",
"diff": "@@ -36,16 +36,6 @@ jar {\n}\npublishing {\n- repositories {\n- maven {\n- name = \"GitHubPackages\"\n- url = uri(rootProject.publishingRepository)\n- credentials {\n- username = System.getenv(\"GITHUB_ACTOR\")\n- password = System.getenv(\"GITHUB_TOKEN\")\n- }\n- }\n- }\npublications {\nmodelixGradlePlugin(MavenPublication) {\ngroupId project.group\n"
},
{
"change_type": "MODIFY",
"old_path": "model-client/build.gradle",
"new_path": "model-client/build.gradle",
"diff": "@@ -156,16 +156,3 @@ String stripVersion(String fileNameWithVersion) {\nprintln \"stripVersion($fileNameWithVersion) -> $name\"\nreturn name\n}\n-\n-publishing {\n- repositories {\n- maven {\n- name = \"GitHubPackages\"\n- url = uri(rootProject.publishingRepository)\n- credentials {\n- username = System.getenv(\"GITHUB_ACTOR\")\n- password = System.getenv(\"GITHUB_TOKEN\")\n- }\n- }\n- }\n-}\n"
},
{
"change_type": "MODIFY",
"old_path": "mps/build.gradle",
"new_path": "mps/build.gradle",
"diff": "@@ -205,16 +205,6 @@ task packageBuildScripts(type: Zip, dependsOn: buildMpsModules) {\n}\npublishing {\n- repositories {\n- maven {\n- name = \"GitHubPackages\"\n- url = uri(rootProject.publishingRepository)\n- credentials {\n- username = System.getenv(\"GITHUB_ACTOR\")\n- password = System.getenv(\"GITHUB_TOKEN\")\n- }\n- }\n- }\npublications {\nmodelixMpsModelPlugin(MavenPublication) {\ngroupId 'org.modelix'\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | update several build.gradle files based on changes on master |
426,504 | 24.03.2022 10:10:53 | -3,600 | 2646c937d13d9445021cf4fefe55af13d6cb86ba | removed obsolete model-server/build.gradle | [
{
"change_type": "DELETE",
"old_path": "model-server/build.gradle",
"new_path": null,
"diff": "-plugins {\n- id \"java\"\n- id \"application\"\n- id \"com.diffplug.gradle.spotless\"\n- id 'maven-publish'\n- id 'com.adarshr.test-logger' version '2.1.0'\n- id \"org.jetbrains.kotlin.jvm\"\n- id 'com.github.johnrengelman.shadow' version '6.1.0'\n-}\n-\n-description = 'Model Server offering access to model storage'\n-\n-defaultTasks 'build'\n-\n-compileJava {\n- sourceCompatibility = '11'\n- targetCompatibility = '11'\n-}\n-\n-dependencies {\n- implementation group: 'org.modelix', name: 'model-api', version: \"$mpsExtensionsVersion\"\n- implementation project(':model-client')\n- implementation group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', version: kotlinVersion\n- implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.10'\n-\n- implementation group: 'org.json', name: 'json', version:'20180813'\n- implementation group: 'org.java-websocket', name: 'Java-WebSocket', version:'1.4.0'\n- implementation group: 'org.apache.commons', name: 'commons-collections4', version:'4.4'\n- implementation group: 'io.lettuce', name: 'lettuce-core', version:'5.1.8.RELEASE'\n- implementation group: 'ch.qos.logback', name: 'logback-classic', version:'1.2.7'\n-\n- def igniteVersion = '2.10.0'\n- implementation group: 'org.apache.ignite', name: 'ignite-core', version: igniteVersion\n- implementation group: 'org.apache.ignite', name: 'ignite-spring', version: igniteVersion\n- implementation group: 'org.apache.ignite', name: 'ignite-indexing', version: igniteVersion\n-\n- implementation group: 'org.postgresql', name: 'postgresql', version:'42.2.14'\n-\n- implementation group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.4.21.v20190926'\n- implementation group: 'org.eclipse.jetty.websocket', name: 'websocket-servlet', version: '9.4.21.v20190926'\n- implementation group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '9.4.21.v20190926'\n- implementation group: 'org.eclipse.jetty.websocket', name: 'websocket-server', version: '9.4.21.v20190926'\n- implementation group: 'org.eclipse.jetty', name: 'jetty-servlets', version: '9.4.21.v20190926'\n-\n- implementation group: 'commons-io', name: 'commons-io', version: '2.6'\n- implementation group: 'com.google.guava', name: 'guava', version: '28.1-jre'\n- implementation group: 'com.beust', name: 'jcommander', version: '1.7'\n- implementation group: 'org.apache.cxf', name: 'cxf-rt-rs-sse', version: '3.3.7'\n- implementation group: 'org.apache.cxf', name: 'cxf-rt-rs-client', version: '3.3.7'\n-\n- testImplementation group: 'junit', name: 'junit', version: '4.12'\n- testImplementation group: 'io.cucumber', name: 'cucumber-java', version: '6.2.2'\n-}\n-\n-configurations {\n- cucumberRuntime {\n- extendsFrom testImplementation\n- }\n-}\n-\n-jar {\n- manifest {\n- attributes 'Main-Class': 'org.modelix.model.server.Main'\n- }\n-}\n-\n-shadowJar {\n- archiveBaseName.set('model-server')\n- archiveClassifier.set('fatJar')\n- archiveVersion.set('latest')\n-}\n-\n-def fatJarFile = file(\"$buildDir/libs/model-server-latest-fatJar.jar\")\n-def fatJarArtifact = artifacts.add('archives', fatJarFile) {\n- type 'jar'\n- builtBy 'shadowJar'\n-}\n-\n-task cucumber() {\n- dependsOn shadowJar, compileTestJava\n- doLast {\n- javaexec {\n- main = \"io.cucumber.core.cli.Main\"\n- classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output\n- args = ['--plugin', 'pretty', '--glue', 'org.modelix.model.server.functionaltests', 'src/test/resources/functionaltests']\n- }\n- }\n-}\n-\n-task copyLibs(type: Copy) {\n- into \"$buildDir/libs\"\n- from configurations.default\n-}\n-\n-assemble.finalizedBy(copyLibs)\n-\n-application {\n- mainClassName = \"org.modelix.model.server.Main\"\n-}\n-\n-publishing {\n- repositories {\n- maven {\n- name = \"GitHubPackages\"\n- url = uri(rootProject.publishingRepository)\n- credentials {\n- username = System.getenv(\"GITHUB_ACTOR\")\n- password = System.getenv(\"GITHUB_TOKEN\")\n- }\n- }\n- }\n- publications {\n-/* modelServer(MavenPublication) {\n- groupId project.group\n- version project.version\n-\n- from components.java\n- }*/\n- modelServerFatJar(MavenPublication) {\n- groupId project.group\n- artifactId 'model-server-fatjar'\n- version project.version\n-\n- artifact fatJarArtifact\n- }\n- }\n-}\n-\n-spotless {\n- java {\n- googleJavaFormat(\"1.8\").aosp()\n- licenseHeader '/*\\n' +\n- ' * Licensed under the Apache License, Version 2.0 (the \"License\");\\n' +\n- ' * you may not use this file except in compliance with the License.\\n' +\n- ' * You may obtain a copy of the License at\\n' +\n- ' *\\n' +\n- ' * http://www.apache.org/licenses/LICENSE-2.0\\n' +\n- ' *\\n' +\n- ' * Unless required by applicable law or agreed to in writing,\\n' +\n- ' * software distributed under the License is distributed on an\\n' +\n- ' * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\\n' +\n- ' * KIND, either express or implied. See the License for the\\n' +\n- ' * specific language governing permissions and limitations\\n' +\n- ' * under the License. \\n' +\n- ' */\\n' +\n- '\\n'\n- }\n-}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | removed obsolete model-server/build.gradle |
426,504 | 24.03.2022 10:23:55 | -3,600 | 1699a65e22ee012a0b9808b3fb7fae1106067936 | support usage of modelix specific github credentials | [
{
"change_type": "MODIFY",
"old_path": "build.gradle",
"new_path": "build.gradle",
"diff": "import java.text.SimpleDateFormat\ndef getGithubCredentials() {\n+ if (project.hasProperty(\"modelix.github.user\") && project.hasProperty(\"modelix.github.token\")) {\n+ return new Tuple(project.findProperty(\"modelix.github.user\").toString(), project.findProperty(\"modelix.github.token\").toString())\nif (project.hasProperty(\"gpr.user\") && project.hasProperty(\"gpr.key\")) {\nreturn new Tuple(project.findProperty(\"gpr.user\").toString(), project.findProperty(\"gpr.key\").toString())\n} else if (System.getenv(\"GITHUB_ACTOR\") != null && System.getenv(\"GITHUB_TOKEN\") != null) {\n@@ -108,7 +110,7 @@ subprojects {\nif (githubCredentials != null) {\nmaven {\nname = \"GitHubPackages\"\n- url = uri(\"https://maven.pkg.github.com/modelix/modelix\")\n+ url = uri(\"https://maven.pkg.github.com/ftomassetti/modelix\")\nif (githubCredentials != null) {\ncredentials {\nusername = githubCredentials[0]\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | support usage of modelix specific github credentials |
426,504 | 24.03.2022 10:24:47 | -3,600 | 035c74e0375613a7917c818e4e4d313524ad90d5 | support usage of modelix specific github credentials: correction | [
{
"change_type": "MODIFY",
"old_path": "build.gradle",
"new_path": "build.gradle",
"diff": "@@ -3,7 +3,7 @@ import java.text.SimpleDateFormat\ndef getGithubCredentials() {\nif (project.hasProperty(\"modelix.github.user\") && project.hasProperty(\"modelix.github.token\")) {\nreturn new Tuple(project.findProperty(\"modelix.github.user\").toString(), project.findProperty(\"modelix.github.token\").toString())\n- if (project.hasProperty(\"gpr.user\") && project.hasProperty(\"gpr.key\")) {\n+ } else if (project.hasProperty(\"gpr.user\") && project.hasProperty(\"gpr.key\")) {\nreturn new Tuple(project.findProperty(\"gpr.user\").toString(), project.findProperty(\"gpr.key\").toString())\n} else if (System.getenv(\"GITHUB_ACTOR\") != null && System.getenv(\"GITHUB_TOKEN\") != null) {\nreturn new Tuple(System.getenv(\"GITHUB_ACTOR\"), System.getenv(\"GITHUB_TOKEN\"))\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | support usage of modelix specific github credentials: correction |
426,496 | 01.04.2022 17:57:41 | -7,200 | b2099b7b10e8fb625aa7f8afda493901c3f0d0ca | use latest MPS-extensions version | [
{
"change_type": "MODIFY",
"old_path": "model-client/src/commonMain/kotlin/org/modelix/model/lazy/CLTree.kt",
"new_path": "model-client/src/commonMain/kotlin/org/modelix/model/lazy/CLTree.kt",
"diff": "@@ -126,10 +126,18 @@ class CLTree : ITree, IBulkTree {\nreturn newTree\n}\n+ override fun addNewChild(parentId: Long, role: String?, index: Int, childId: Long, concept: IConceptReference?): ITree {\n+ TODO(\"Not yet implemented\")\n+ }\n+\noverride fun addNewChildren(parentId: Long, role: String?, index: Int, newIds: LongArray, concepts: Array<IConcept?>): ITree {\nthrow UnsupportedOperationException(\"Not implemented yet\")\n}\n+ override fun addNewChildren(parentId: Long, role: String?, index: Int, newIds: LongArray, concepts: Array<IConceptReference?>): ITree {\n+ TODO(\"Not yet implemented\")\n+ }\n+\noverride fun deleteNodes(nodeIds: LongArray): ITree {\nthrow UnsupportedOperationException(\"Not implemented yet\")\n}\n@@ -302,6 +310,12 @@ class CLTree : ITree, IBulkTree {\n}\n}\n+ override fun getConceptReference(nodeId: Long): IConceptReference? {\n+ // TODO this method was introduced to avoid the resolution of concepts, but implementing it correctly\n+ // requires some effort to ensure we don't break deserialization of existing models\n+ return getConcept(nodeId)?.getReference()\n+ }\n+\noverride fun getParent(nodeId: Long): Long {\nval node = resolveElement(nodeId)\nreturn node!!.getData().parentId\n"
},
{
"change_type": "MODIFY",
"old_path": "model-client/src/commonMain/kotlin/org/modelix/model/metameta/PersistedConcept.kt",
"new_path": "model-client/src/commonMain/kotlin/org/modelix/model/metameta/PersistedConcept.kt",
"diff": "@@ -68,6 +68,10 @@ data class PersistedConcept(val id: Long, val uid: String?) : IConcept, IConcept\nthrow UnsupportedOperationException()\n}\n+ override fun serialize(): String {\n+ TODO(\"Not yet implemented\")\n+ }\n+\noverride fun getAllChildLinks(): List<IChildLink> {\nthrow UnsupportedOperationException()\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "model-client/src/commonMain/kotlin/org/modelix/model/operations/OTWriteTransaction.kt",
"new_path": "model-client/src/commonMain/kotlin/org/modelix/model/operations/OTWriteTransaction.kt",
"diff": "@@ -69,6 +69,10 @@ class OTWriteTransaction(\napply(AddNewChildOp(PositionInRole(parentId, role, index_), childId, concept))\n}\n+ override fun addNewChild(parentId: Long, role: String?, index: Int, childId: Long, concept: IConceptReference?) {\n+ TODO(\"Not yet implemented\")\n+ }\n+\noverride fun deleteNode(nodeId: Long) {\ngetAllChildren(nodeId).forEach { deleteNode(it) }\napply(DeleteNodeOp(nodeId))\n@@ -84,6 +88,10 @@ class OTWriteTransaction(\n}\n}\n+ override fun addNewChild(parentId: Long, role: String?, index: Int, concept: IConceptReference?): Long {\n+ TODO(\"Not yet implemented\")\n+ }\n+\noverride fun containsNode(nodeId: Long): Boolean {\nreturn transaction.containsNode(nodeId)\n}\n@@ -103,6 +111,10 @@ class OTWriteTransaction(\nreturn transaction.getConcept(nodeId)\n}\n+ override fun getConceptReference(nodeId: Long): IConceptReference? {\n+ return transaction.getConceptReference(nodeId)\n+ }\n+\noverride fun getParent(nodeId: Long): Long {\nreturn transaction.getParent(nodeId)\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "model-client/src/commonTest/kotlin/org/modelix/model/ConflictResolutionTest.kt",
"new_path": "model-client/src/commonTest/kotlin/org/modelix/model/ConflictResolutionTest.kt",
"diff": "@@ -108,8 +108,8 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue01() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(ITree.ROOT_ID, \"role1\", 0, 0xe, null)\n- t.addNewChild(ITree.ROOT_ID, \"role2\", 0, 0x12, null)\n+ t.addNewChild(ITree.ROOT_ID, \"role1\", 0, 0xe, null as IConcept?)\n+ t.addNewChild(ITree.ROOT_ID, \"role2\", 0, 0x12, null as IConcept?)\n},\n{ t ->\nt.moveChild(ITree.ROOT_ID, \"role3\", 0, 0xe)\n@@ -127,14 +127,14 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue02() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(ITree.ROOT_ID, \"role2\", 0, 0x3, null)\n+ t.addNewChild(ITree.ROOT_ID, \"role2\", 0, 0x3, null as IConcept?)\n},\n{ t ->\nt.deleteNode(0x3)\n},\n{ t ->\nt.deleteNode(0x3)\n- t.addNewChild(ITree.ROOT_ID, \"role2\", 0, 0x13, null)\n+ t.addNewChild(ITree.ROOT_ID, \"role2\", 0, 0x13, null as IConcept?)\nt.deleteNode(0x13)\n}\n)\n@@ -146,15 +146,15 @@ class ConflictResolutionTest : TreeTestBase() {\n{ t ->\n},\n{ t ->\n- t.addNewChild(1, \"role2\", 0, 0xff00000007, null)\n+ t.addNewChild(1, \"role2\", 0, 0xff00000007, null as IConcept?)\nt.deleteNode(0xff00000007)\n},\n{ t ->\n- t.addNewChild(1, \"role2\", 0, 0xff0000000a, null)\n+ t.addNewChild(1, \"role2\", 0, 0xff0000000a, null as IConcept?)\nt.deleteNode(0xff0000000a)\n},\n{ t ->\n- t.addNewChild(1, \"role2\", 0, 0xff0000000e, null)\n+ t.addNewChild(1, \"role2\", 0, 0xff0000000e, null as IConcept?)\nt.deleteNode(0xff0000000e)\n}\n)\n@@ -166,12 +166,12 @@ class ConflictResolutionTest : TreeTestBase() {\n{ t ->\n},\n{ t ->\n- t.addNewChild(1, \"role3\", 0, 0xff00000006, null)\n- t.addNewChild(0xff00000006, \"role3\", 0, 0xff00000008, null)\n+ t.addNewChild(1, \"role3\", 0, 0xff00000006, null as IConcept?)\n+ t.addNewChild(0xff00000006, \"role3\", 0, 0xff00000008, null as IConcept?)\nt.moveChild(1, \"role1\", 0, 0xff00000006)\n},\n{ t ->\n- t.addNewChild(1, \"role3\", 0, 0xff0000000e, null)\n+ t.addNewChild(1, \"role3\", 0, 0xff0000000e, null as IConcept?)\n}\n)\n}\n@@ -186,10 +186,10 @@ class ConflictResolutionTest : TreeTestBase() {\n{ t -> // 1\n},\n{ t -> // 2\n- t.addNewChild(0x1, \"role3\", 0, 0xff0000000f, null)\n+ t.addNewChild(0x1, \"role3\", 0, 0xff0000000f, null as IConcept?)\n},\n{ t -> // 3\n- t.addNewChild(0x1, \"role3\", 0, 0xff00000011, null)\n+ t.addNewChild(0x1, \"role3\", 0, 0xff00000011, null as IConcept?)\nt.deleteNode(0xff00000011)\n}\n)\n@@ -199,9 +199,9 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue06() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"role1\", 0, 0xff0000000e, null)\n- t.addNewChild(0x1, \"role2\", 0, 0xff00000011, null)\n- t.addNewChild(0xff00000011, \"role1\", 0, 0xff00000010, null)\n+ t.addNewChild(0x1, \"role1\", 0, 0xff0000000e, null as IConcept?)\n+ t.addNewChild(0x1, \"role2\", 0, 0xff00000011, null as IConcept?)\n+ t.addNewChild(0xff00000011, \"role1\", 0, 0xff00000010, null as IConcept?)\n},\n{ t -> // 0\nt.moveChild(0x1, \"role1\", 0, 0xff00000010)\n@@ -221,16 +221,16 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue07() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"role1\", 0, 0xff0000000e, null)\n- t.addNewChild(0xff0000000e, \"role3\", 0, 0xff00000010, null)\n- t.addNewChild(0xff00000010, \"role2\", 0, 0xff00000011, null)\n+ t.addNewChild(0x1, \"role1\", 0, 0xff0000000e, null as IConcept?)\n+ t.addNewChild(0xff0000000e, \"role3\", 0, 0xff00000010, null as IConcept?)\n+ t.addNewChild(0xff00000010, \"role2\", 0, 0xff00000011, null as IConcept?)\n},\n{ t -> // 0\nt.deleteNode(0xff00000011)\n},\n{ t -> // 1\nt.moveChild(0x1, \"role2\", 0, 0xff00000011)\n- t.addNewChild(0x1, \"role2\", 0, 0xff00000032, null)\n+ t.addNewChild(0x1, \"role2\", 0, 0xff00000032, null as IConcept?)\n}\n)\n// Attempt to access a deleted location: 1\n@@ -240,10 +240,10 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue08() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"role1\", 0, 0xff0000000e, null)\n- t.addNewChild(0x1, \"role5\", 0, 0xff00000010, null)\n- t.addNewChild(0xff00000010, \"role2\", 0, 0xff00000011, null)\n- t.addNewChild(0xff00000010, \"role1\", 0, 0xff00000012, null)\n+ t.addNewChild(0x1, \"role1\", 0, 0xff0000000e, null as IConcept?)\n+ t.addNewChild(0x1, \"role5\", 0, 0xff00000010, null as IConcept?)\n+ t.addNewChild(0xff00000010, \"role2\", 0, 0xff00000011, null as IConcept?)\n+ t.addNewChild(0xff00000010, \"role1\", 0, 0xff00000012, null as IConcept?)\n},\n{ t -> // 0\nt.moveChild(0xff00000012, \"role2\", 0, 0xff0000000e)\n@@ -259,8 +259,8 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue09a() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"role1\", 0, 0xff0000000e, null)\n- t.addNewChild(0x1, \"role2\", 0, 0xff00000011, null)\n+ t.addNewChild(0x1, \"role1\", 0, 0xff0000000e, null as IConcept?)\n+ t.addNewChild(0x1, \"role2\", 0, 0xff00000011, null as IConcept?)\n},\n{ t -> // 0\nt.moveChild(0x1, \"role6\", 0, 0xff0000000e)\n@@ -276,8 +276,8 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue09b() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"role1\", 0, 0xff0000000e, null)\n- t.addNewChild(0x1, \"role2\", 0, 0xff00000011, null)\n+ t.addNewChild(0x1, \"role1\", 0, 0xff0000000e, null as IConcept?)\n+ t.addNewChild(0x1, \"role2\", 0, 0xff00000011, null as IConcept?)\n},\n{ t -> // 0\nt.moveChild(0x1, \"role6\", 0, 0xff0000000e)\n@@ -293,9 +293,9 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue09c() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"role1\", 0, 0xff000000aa, null)\n- t.addNewChild(0x1, \"role1\", 1, 0xff0000000e, null)\n- t.addNewChild(0x1, \"role2\", 0, 0xff00000011, null)\n+ t.addNewChild(0x1, \"role1\", 0, 0xff000000aa, null as IConcept?)\n+ t.addNewChild(0x1, \"role1\", 1, 0xff0000000e, null as IConcept?)\n+ t.addNewChild(0x1, \"role2\", 0, 0xff00000011, null as IConcept?)\n},\n{ t -> // 0\nt.moveChild(0x1, \"role6\", 0, 0xff0000000e)\n@@ -311,13 +311,13 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue10() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"role1\", 0, 0xff00000010, null)\n+ t.addNewChild(0x1, \"role1\", 0, 0xff00000010, null as IConcept?)\n},\n{ t -> // 0\nt.deleteNode(0xff00000010)\n},\n{ t -> // 1\n- t.addNewChild(0xff00000010, \"role1\", 0, 0xff0000002b, null)\n+ t.addNewChild(0xff00000010, \"role1\", 0, 0xff0000002b, null as IConcept?)\nt.deleteNode(0xff0000002b)\n}\n)\n@@ -327,17 +327,17 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue11() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"role2\", 0, 0xff00000011, null)\n+ t.addNewChild(0x1, \"role2\", 0, 0xff00000011, null as IConcept?)\n},\n{ t -> // 0\nt.deleteNode(0xff00000011)\n},\n{ t -> // 1\n- t.addNewChild(0xff00000011, \"role2\", 0, 0xff0000002e, null)\n+ t.addNewChild(0xff00000011, \"role2\", 0, 0xff0000002e, null as IConcept?)\nt.moveChild(0x1, \"role3\", 0, 0xff0000002e)\n},\n{ t -> // 2\n- t.addNewChild(0xff00000011, \"role3\", 0, 0xff00000043, null)\n+ t.addNewChild(0xff00000011, \"role3\", 0, 0xff00000043, null as IConcept?)\n}\n)\n}\n@@ -346,16 +346,16 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue12() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"role1\", 0, 0xff00000012, null)\n- t.addNewChild(0x1, \"role3\", 0, 0xff0000000e, null)\n+ t.addNewChild(0x1, \"role1\", 0, 0xff00000012, null as IConcept?)\n+ t.addNewChild(0x1, \"role3\", 0, 0xff0000000e, null as IConcept?)\n},\n{ t -> // 0\nt.deleteNode(0xff00000012)\nt.deleteNode(0xff0000000e)\n},\n{ t -> // 1\n- t.addNewChild(0xff00000012, \"role3\", 0, 0xff00000043, null)\n- t.addNewChild(0xff0000000e, \"role3\", 0, 0xff00000044, null)\n+ t.addNewChild(0xff00000012, \"role3\", 0, 0xff00000043, null as IConcept?)\n+ t.addNewChild(0xff0000000e, \"role3\", 0, 0xff00000044, null as IConcept?)\nt.deleteNode(0xff00000043)\n}\n)\n@@ -365,14 +365,14 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue13() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"role4\", 0, 0xff00000012, null)\n+ t.addNewChild(0x1, \"role4\", 0, 0xff00000012, null as IConcept?)\n},\n{ t -> // 0\nt.deleteNode(0xff00000012)\n},\n{ t -> // 1\n- t.addNewChild(0xff00000012, \"role3\", 0, 0xff00000043, null)\n- t.addNewChild(0x1, \"role5\", 0, 0xff00000044, null)\n+ t.addNewChild(0xff00000012, \"role3\", 0, 0xff00000043, null as IConcept?)\n+ t.addNewChild(0x1, \"role5\", 0, 0xff00000044, null as IConcept?)\nt.moveChild(0xff00000012, \"role5\", 0, 0xff00000044)\nt.deleteNode(0xff00000043)\nt.deleteNode(0xff00000044)\n@@ -384,14 +384,14 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue14() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"role2\", 0, 0xff00000011, null)\n+ t.addNewChild(0x1, \"role2\", 0, 0xff00000011, null as IConcept?)\n},\n{ t -> // 0\nt.deleteNode(0xff00000011)\n},\n{ t -> // 1\nt.moveChild(0x1, \"role1\", 0, 0xff00000011)\n- t.addNewChild(0x1, \"role1\", 1, 0xff0000002d, null)\n+ t.addNewChild(0x1, \"role1\", 1, 0xff0000002d, null as IConcept?)\n}\n)\n}\n@@ -400,14 +400,14 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue15() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"role5\", 0, 0xff00000012, null)\n+ t.addNewChild(0x1, \"role5\", 0, 0xff00000012, null as IConcept?)\n},\n{ t -> // 0\nt.deleteNode(0xff00000012)\n},\n{ t -> // 1\n- t.addNewChild(0xff00000012, \"role1\", 0, 0xff00000043, null)\n- t.addNewChild(0xff00000012, \"role3\", 0, 0xff00000045, null)\n+ t.addNewChild(0xff00000012, \"role1\", 0, 0xff00000043, null as IConcept?)\n+ t.addNewChild(0xff00000012, \"role3\", 0, 0xff00000045, null as IConcept?)\nt.deleteNode(0xff00000045)\nt.deleteNode(0xff00000043)\n}\n@@ -418,23 +418,23 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue16() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"role3\", 0, 0xff0000000e, null)\n- t.addNewChild(0xff0000000e, \"role3\", 0, 0xff00000010, null)\n- t.addNewChild(0xff00000010, \"role3\", 0, 0xff00000011, null)\n- t.addNewChild(0xff00000010, \"role3\", 0, 0xff00000012, null)\n+ t.addNewChild(0x1, \"role3\", 0, 0xff0000000e, null as IConcept?)\n+ t.addNewChild(0xff0000000e, \"role3\", 0, 0xff00000010, null as IConcept?)\n+ t.addNewChild(0xff00000010, \"role3\", 0, 0xff00000011, null as IConcept?)\n+ t.addNewChild(0xff00000010, \"role3\", 0, 0xff00000012, null as IConcept?)\nt.moveChild(0x1, \"role2\", 0, 0xff00000011)\n},\n{ t -> // 0\nt.deleteNode(0xff00000012)\n- t.addNewChild(0x1, \"role2\", 1, 0xff0000001c, null)\n- t.addNewChild(0xff0000001c, \"role2\", 0, 0xff00000022, null)\n+ t.addNewChild(0x1, \"role2\", 1, 0xff0000001c, null as IConcept?)\n+ t.addNewChild(0xff0000001c, \"role2\", 0, 0xff00000022, null as IConcept?)\nt.deleteNode(0xff00000010)\nt.deleteNode(0xff0000000e)\n- t.addNewChild(0xff00000022, \"role3\", 0, 0xff00000023, null)\n+ t.addNewChild(0xff00000022, \"role3\", 0, 0xff00000023, null as IConcept?)\n},\n{ t -> // 1\n- t.addNewChild(0xff00000012, \"role3\", 0, 0xff00000043, null)\n- t.addNewChild(0xff00000043, \"role3\", 0, 0xff00000044, null)\n+ t.addNewChild(0xff00000012, \"role3\", 0, 0xff00000043, null as IConcept?)\n+ t.addNewChild(0xff00000043, \"role3\", 0, 0xff00000044, null as IConcept?)\nt.moveChild(0xff0000000e, \"role3\", 0, 0xff00000044)\nt.deleteNode(0xff00000043)\n}\n@@ -447,11 +447,11 @@ class ConflictResolutionTest : TreeTestBase() {\n{ t ->\n},\n{ t -> // 0\n- t.addNewChild(0x1, \"role1\", 0, 0xff00000002, null)\n+ t.addNewChild(0x1, \"role1\", 0, 0xff00000002, null as IConcept?)\nt.deleteNode(0xff00000002)\n},\n{ t -> // 1\n- t.addNewChild(0x1, \"role2\", 0, 0xff0000000d, null)\n+ t.addNewChild(0x1, \"role2\", 0, 0xff0000000d, null as IConcept?)\nt.moveChild(0x1, \"role2\", 1, 0xff0000000d)\nt.deleteNode(0xff0000000d)\n}\n@@ -464,11 +464,11 @@ class ConflictResolutionTest : TreeTestBase() {\n{ t ->\n},\n{ t -> // 0\n- t.addNewChild(0x1, \"role5\", 0, 0xff00000043, null)\n+ t.addNewChild(0x1, \"role5\", 0, 0xff00000043, null as IConcept?)\n},\n{ t -> // 1\n- t.addNewChild(0x1, \"role3\", 0, 0xff00000059, null)\n- t.addNewChild(0x1, \"role5\", 0, 0xff0000005c, null)\n+ t.addNewChild(0x1, \"role3\", 0, 0xff00000059, null as IConcept?)\n+ t.addNewChild(0x1, \"role5\", 0, 0xff0000005c, null as IConcept?)\nt.moveChild(0x1, \"role3\", 1, 0xff0000005c)\nt.deleteNode(0xff00000059)\n}\n@@ -479,10 +479,10 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue19() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"role5\", 0, 0xff00000012, null)\n+ t.addNewChild(0x1, \"role5\", 0, 0xff00000012, null as IConcept?)\n},\n{ t -> // 0\n- t.addNewChild(0xff00000012, \"role2\", 0, 0xff00000016, null)\n+ t.addNewChild(0xff00000012, \"role2\", 0, 0xff00000016, null as IConcept?)\n},\n{ t -> // 1\nt.deleteNode(0xff00000012)\n@@ -494,10 +494,10 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue20() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"role5\", 0, 0xff00000012, null)\n+ t.addNewChild(0x1, \"role5\", 0, 0xff00000012, null as IConcept?)\n},\n{ t -> // 0\n- t.addNewChild(0x1, \"role6\", 0, 0xff00000013, null)\n+ t.addNewChild(0x1, \"role6\", 0, 0xff00000013, null as IConcept?)\nt.moveChild(0xff00000012, \"role2\", 0, 0xff00000013)\n},\n{ t -> // 1\n@@ -510,19 +510,19 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue21() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"role3\", 0, 0xff0000000e, null)\n+ t.addNewChild(0x1, \"role3\", 0, 0xff0000000e, null as IConcept?)\nt.moveChild(0x1, \"role1\", 0, 0xff0000000e)\n- t.addNewChild(0xff0000000e, \"role2\", 0, 0xff0000000f, null)\n+ t.addNewChild(0xff0000000e, \"role2\", 0, 0xff0000000f, null as IConcept?)\nt.deleteNode(0xff0000000f)\n- t.addNewChild(0xff0000000e, \"role3\", 0, 0xff00000010, null)\n+ t.addNewChild(0xff0000000e, \"role3\", 0, 0xff00000010, null as IConcept?)\nt.moveChild(0xff0000000e, \"role3\", 0, 0xff00000010)\n- t.addNewChild(0xff00000010, \"role3\", 0, 0xff00000011, null)\n- t.addNewChild(0xff00000010, \"role3\", 0, 0xff00000012, null)\n+ t.addNewChild(0xff00000010, \"role3\", 0, 0xff00000011, null as IConcept?)\n+ t.addNewChild(0xff00000010, \"role3\", 0, 0xff00000012, null as IConcept?)\nt.moveChild(0x1, \"role2\", 0, 0xff00000011)\nt.moveChild(0xff00000011, \"role1\", 0, 0xff00000010)\nt.moveChild(0xff00000010, \"role1\", 0, 0xff00000012)\nt.moveChild(0x1, \"role2\", 1, 0xff00000011)\n- t.addNewChild(0x1, \"role2\", 0, 0xff00000013, null)\n+ t.addNewChild(0x1, \"role2\", 0, 0xff00000013, null as IConcept?)\n},\n{ t -> // 0\nt.moveChild(0xff00000012, \"role2\", 0, 0xff00000013)\n@@ -539,14 +539,14 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue22() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"role3\", 0, 0xff00000011, null)\n+ t.addNewChild(0x1, \"role3\", 0, 0xff00000011, null as IConcept?)\n},\n{ t -> // 0\nt.deleteNode(0xff00000011)\n},\n{ t -> // 1\n- t.addNewChild(0xff00000011, \"role2\", 0, 0xff0000002e, null)\n- t.addNewChild(0xff00000011, \"role3\", 0, 0xff00000030, null)\n+ t.addNewChild(0xff00000011, \"role2\", 0, 0xff0000002e, null as IConcept?)\n+ t.addNewChild(0xff00000011, \"role3\", 0, 0xff00000030, null as IConcept?)\nt.moveChild(0x1, \"role3\", 0, 0xff0000002e)\n}\n)\n@@ -556,7 +556,7 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue23() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"role3\", 0, 0xff00000001, null)\n+ t.addNewChild(0x1, \"role3\", 0, 0xff00000001, null as IConcept?)\nt.moveChild(0x1, \"role2\", 0, 0xff00000001)\n},\n{ t -> // 0\n@@ -572,8 +572,8 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue24() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"role3\", 0, 0xff00000003, null)\n- t.addNewChild(0xff00000003, \"role1\", 0, 0xff00000004, null)\n+ t.addNewChild(0x1, \"role3\", 0, 0xff00000003, null as IConcept?)\n+ t.addNewChild(0xff00000003, \"role1\", 0, 0xff00000004, null as IConcept?)\n},\n{ t -> // 0\nt.moveChild(0xff00000003, \"role2\", 0, 0xff00000004)\n@@ -589,7 +589,7 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue25() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"cRole2\", 0, 0xff00000001, null)\n+ t.addNewChild(0x1, \"cRole2\", 0, 0xff00000001, null as IConcept?)\n},\n{ t -> // 0\nt.moveChild(0x1, \"cRole2\", 1, 0xff00000001)\n@@ -604,8 +604,8 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue26() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"cRole2\", 0, 0xff00000002, null)\n- t.addNewChild(0x1, \"cRole2\", 1, 0xff00000003, null)\n+ t.addNewChild(0x1, \"cRole2\", 0, 0xff00000002, null as IConcept?)\n+ t.addNewChild(0x1, \"cRole2\", 1, 0xff00000003, null as IConcept?)\n},\n{ t -> // 0\nt.moveChild(0xff00000002, \"cRole3\", 0, 0xff00000003)\n@@ -620,8 +620,8 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue27() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"cRole1\", 0, 0xff00000003, null)\n- t.addNewChild(0x1, \"cRole2\", 0, 0xff00000004, null)\n+ t.addNewChild(0x1, \"cRole1\", 0, 0xff00000003, null as IConcept?)\n+ t.addNewChild(0x1, \"cRole2\", 0, 0xff00000004, null as IConcept?)\n},\n{ t -> // 0\nt.moveChild(0xff00000004, \"cRole3\", 0, 0xff00000003)\n@@ -637,8 +637,8 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue28() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"cRole2\", 0, 0xff00000001, null)\n- t.addNewChild(0x1, \"cRole1\", 0, 0xff00000002, null)\n+ t.addNewChild(0x1, \"cRole2\", 0, 0xff00000001, null as IConcept?)\n+ t.addNewChild(0x1, \"cRole1\", 0, 0xff00000002, null as IConcept?)\n},\n{ t -> // 0\nt.moveChild(0xff00000002, \"cRole2\", 0, 0xff00000001)\n@@ -646,7 +646,7 @@ class ConflictResolutionTest : TreeTestBase() {\n},\n{ t -> // 1\nt.moveChild(0xff00000001, \"cRole1\", 0, 0xff00000002)\n- t.addNewChild(0x1, \"cRole1\", 0, 0xff00000006, null)\n+ t.addNewChild(0x1, \"cRole1\", 0, 0xff00000006, null as IConcept?)\nt.moveChild(0xff00000006, \"cRole3\", 0, 0xff00000002)\n}\n)\n@@ -656,9 +656,9 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue29() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"cRole2\", 0, 0xff00000002, null)\n- t.addNewChild(0xff00000002, \"cRole2\", 0, 0xff00000001, null)\n- t.addNewChild(0x1, \"cRole3\", 0, 0xff00000004, null)\n+ t.addNewChild(0x1, \"cRole2\", 0, 0xff00000002, null as IConcept?)\n+ t.addNewChild(0xff00000002, \"cRole2\", 0, 0xff00000001, null as IConcept?)\n+ t.addNewChild(0x1, \"cRole3\", 0, 0xff00000004, null as IConcept?)\n},\n{ t -> // 0\nt.moveChild(0xff00000001, \"cRole3\", 0, 0xff00000004)\n@@ -673,8 +673,8 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue30() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"cRole3\", 0, 0xff00000003, null)\n- t.addNewChild(0x1, \"cRole2\", 0, 0xff00000004, null)\n+ t.addNewChild(0x1, \"cRole3\", 0, 0xff00000003, null as IConcept?)\n+ t.addNewChild(0x1, \"cRole2\", 0, 0xff00000004, null as IConcept?)\n},\n{ t -> // 0\nt.moveChild(0xff00000004, \"cRole1\", 0, 0xff00000003)\n@@ -690,14 +690,14 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue31() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"cRole2\", 0, 0xff00000001, null)\n- t.addNewChild(0xff00000001, \"cRole1\", 0, 0xff00000002, null)\n- t.addNewChild(0xff00000002, \"cRole2\", 0, 0xff00000003, null)\n- t.addNewChild(0xff00000001, \"cRole1\", 0, 0xff00000004, null)\n- t.addNewChild(0xff00000003, \"cRole2\", 0, 0xff00000005, null)\n+ t.addNewChild(0x1, \"cRole2\", 0, 0xff00000001, null as IConcept?)\n+ t.addNewChild(0xff00000001, \"cRole1\", 0, 0xff00000002, null as IConcept?)\n+ t.addNewChild(0xff00000002, \"cRole2\", 0, 0xff00000003, null as IConcept?)\n+ t.addNewChild(0xff00000001, \"cRole1\", 0, 0xff00000004, null as IConcept?)\n+ t.addNewChild(0xff00000003, \"cRole2\", 0, 0xff00000005, null as IConcept?)\n},\n{ t -> // 0\n- t.addNewChild(0xff00000002, \"cRole1\", 0, 0xff00000007, null)\n+ t.addNewChild(0xff00000002, \"cRole1\", 0, 0xff00000007, null as IConcept?)\n},\n{ t -> // 1\nt.deleteNode(0xff00000005)\n@@ -711,10 +711,10 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue32() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"cRole2\", 0, 0xff00000001, null)\n- t.addNewChild(0xff00000001, \"cRole3\", 0, 0xff00000002, null)\n- t.addNewChild(0x1, \"cRole2\", 1, 0xff00000003, null)\n- t.addNewChild(0xff00000003, \"cRole3\", 0, 0xff00000004, null)\n+ t.addNewChild(0x1, \"cRole2\", 0, 0xff00000001, null as IConcept?)\n+ t.addNewChild(0xff00000001, \"cRole3\", 0, 0xff00000002, null as IConcept?)\n+ t.addNewChild(0x1, \"cRole2\", 1, 0xff00000003, null as IConcept?)\n+ t.addNewChild(0xff00000003, \"cRole3\", 0, 0xff00000004, null as IConcept?)\n},\n{ t -> // 0\nt.moveChild(0xff00000004, \"cRole3\", 0, 0xff00000001)\n@@ -730,9 +730,9 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue33() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"cRole3\", 0, 0xff00000001, null)\n- t.addNewChild(0xff00000001, \"cRole3\", 0, 0xff00000002, null)\n- t.addNewChild(0xff00000001, \"cRole3\", 1, 0xff00000003, null)\n+ t.addNewChild(0x1, \"cRole3\", 0, 0xff00000001, null as IConcept?)\n+ t.addNewChild(0xff00000001, \"cRole3\", 0, 0xff00000002, null as IConcept?)\n+ t.addNewChild(0xff00000001, \"cRole3\", 1, 0xff00000003, null as IConcept?)\n},\n{ t -> // 0\nt.deleteNode(0xff00000002)\n@@ -747,11 +747,11 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue34() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"cRole3\", 0, 0xff00000001, null)\n- t.addNewChild(0xff00000001, \"cRole2\", 0, 0xff00000002, null)\n- t.addNewChild(0xff00000001, \"cRole2\", 1, 0xff00000003, null)\n- t.addNewChild(0xff00000002, \"cRole2\", 0, 0xff00000004, null)\n- t.addNewChild(0xff00000001, \"cRole1\", 0, 0xff00000005, null)\n+ t.addNewChild(0x1, \"cRole3\", 0, 0xff00000001, null as IConcept?)\n+ t.addNewChild(0xff00000001, \"cRole2\", 0, 0xff00000002, null as IConcept?)\n+ t.addNewChild(0xff00000001, \"cRole2\", 1, 0xff00000003, null as IConcept?)\n+ t.addNewChild(0xff00000002, \"cRole2\", 0, 0xff00000004, null as IConcept?)\n+ t.addNewChild(0xff00000001, \"cRole1\", 0, 0xff00000005, null as IConcept?)\n},\n{ t -> // 0\nt.moveChild(0x1, \"cRole2\", 0, 0xff00000005)\n@@ -768,11 +768,11 @@ class ConflictResolutionTest : TreeTestBase() {\nfun knownIssue35() {\nknownIssueTest(\n{ t ->\n- t.addNewChild(0x1, \"cRole2\", 0, 0xff00000001, null)\n- t.addNewChild(0x1, \"cRole3\", 0, 0xff00000002, null)\n- t.addNewChild(0xff00000002, \"cRole3\", 0, 0xff00000003, null)\n- t.addNewChild(0xff00000001, \"cRole1\", 0, 0xff00000004, null)\n- t.addNewChild(0xff00000004, \"cRole3\", 0, 0xff00000005, null)\n+ t.addNewChild(0x1, \"cRole2\", 0, 0xff00000001, null as IConcept?)\n+ t.addNewChild(0x1, \"cRole3\", 0, 0xff00000002, null as IConcept?)\n+ t.addNewChild(0xff00000002, \"cRole3\", 0, 0xff00000003, null as IConcept?)\n+ t.addNewChild(0xff00000001, \"cRole1\", 0, 0xff00000004, null as IConcept?)\n+ t.addNewChild(0xff00000004, \"cRole3\", 0, 0xff00000005, null as IConcept?)\n},\n{ t -> // 0\nt.moveChild(0xff00000003, \"cRole3\", 0, 0xff00000004)\n"
},
{
"change_type": "MODIFY",
"old_path": "model-client/src/commonTest/kotlin/org/modelix/model/RandomTreeChangeGenerator.kt",
"new_path": "model-client/src/commonTest/kotlin/org/modelix/model/RandomTreeChangeGenerator.kt",
"diff": "@@ -26,7 +26,7 @@ class RandomTreeChangeGenerator(private val idGenerator: IdGenerator, private va\nval childId = idGenerator.generate()\nval role = childRoles[rand.nextInt(childRoles.size)]\nval index = if (rand.nextBoolean()) rand.nextInt(t.getChildren(parent, role).count().toInt() + 1) else -1\n- t.addNewChild(parent, role, index, childId, null)\n+ t.addNewChild(parent, role, index, childId, null as IConcept?)\nif (expectedTree != null) {\nexpectedTree.expectedParents[childId] = parent\nexpectedTree.expectedRoles[childId] = role\n"
},
{
"change_type": "MODIFY",
"old_path": "model-client/src/commonTest/kotlin/org/modelix/model/TreeSerializationTest.kt",
"new_path": "model-client/src/commonTest/kotlin/org/modelix/model/TreeSerializationTest.kt",
"diff": "@@ -13,9 +13,9 @@ class TreeSerializationTest {\nfun initTree(branch: IBranch, moreThan10ops: Boolean) {\nbranch.runWrite {\nval t = branch.writeTransaction\n- t.addNewChild(ITree.ROOT_ID, \"c1\", 0, 0x7fffffff00000001, null)\n- t.addNewChild(0x7fffffff00000001, \"c2\", 0, 0x7fffffff00000002, null)\n- t.addNewChild(ITree.ROOT_ID, \"c3\", 0, 0x7fffffff00000003, null)\n+ t.addNewChild(ITree.ROOT_ID, \"c1\", 0, 0x7fffffff00000001, null as IConcept?)\n+ t.addNewChild(0x7fffffff00000001, \"c2\", 0, 0x7fffffff00000002, null as IConcept?)\n+ t.addNewChild(ITree.ROOT_ID, \"c3\", 0, 0x7fffffff00000003, null as IConcept?)\nt.moveChild(0x7fffffff00000002, \"c3\", 0, 0x7fffffff00000003)\nt.deleteNode(0x7fffffff00000003)\nt.moveChild(ITree.ROOT_ID, \"c1\", 1, 0x7fffffff00000002)\n@@ -25,7 +25,7 @@ class TreeSerializationTest {\nt.setReferenceTarget(0x7fffffff00000001, \"r2\", PNodeReference(0x7fffffff00000002, branch.getId()))\nif (moreThan10ops) {\n- t.addNewChild(ITree.ROOT_ID, \"bignode\", 0, 0x7fffffff00000004, null)\n+ t.addNewChild(ITree.ROOT_ID, \"bignode\", 0, 0x7fffffff00000004, null as IConcept?)\nfor (i in 1..20) {\nt.setProperty(0x7fffffff00000004, \"p$i\", \"value$i\")\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "model-client/src/commonTest/kotlin/org/modelix/model/api/CompositeAreaTest.kt",
"new_path": "model-client/src/commonTest/kotlin/org/modelix/model/api/CompositeAreaTest.kt",
"diff": "@@ -32,6 +32,10 @@ class MyNode(val name: String) : INode {\nTODO(\"Not yet implemented\")\n}\n+ override fun getConceptReference(): IConceptReference? {\n+ TODO(\"Not yet implemented\")\n+ }\n+\noverride val allChildren: Iterable<INode>\nget() = TODO(\"Not yet implemented\")\n"
},
{
"change_type": "MODIFY",
"old_path": "model-client/src/commonTest/kotlin/org/modelix/model/api/NodeUtilTest.kt",
"new_path": "model-client/src/commonTest/kotlin/org/modelix/model/api/NodeUtilTest.kt",
"diff": "@@ -95,6 +95,10 @@ class SimpleTestNode(override val concept: IConcept? = null) : INode {\nreturn childrenByRole[role] ?: emptyList()\n}\n+ override fun getConceptReference(): IConceptReference? {\n+ TODO(\"Not yet implemented\")\n+ }\n+\noverride val allChildren: Iterable<INode>\nget() = childrenByRole.values.flatten()\n"
},
{
"change_type": "MODIFY",
"old_path": "model-client/src/commonTest/kotlin/org/modelix/model/area/AreaWithMountsTests.kt",
"new_path": "model-client/src/commonTest/kotlin/org/modelix/model/area/AreaWithMountsTests.kt",
"diff": "*/\npackage org.modelix.model.area\n+import org.modelix.model.api.IConcept\nimport org.modelix.model.api.INode\nimport org.modelix.model.api.ITree\nimport org.modelix.model.api.PBranch\n@@ -46,15 +47,15 @@ class AreaWithMountsTests {\nval branch1 = PBranch(emptyTree, idGenerator)\nvar root1Id: Long = 0\nbranch1.runWrite {\n- root1Id = branch1.writeTransaction.addNewChild(ITree.ROOT_ID, null, -1, null)\n+ root1Id = branch1.writeTransaction.addNewChild(ITree.ROOT_ID, null, -1, null as IConcept?)\n}\nval area1 = PArea(branch1)\nval root1 = area1.getRoot()\nlateinit var mountPoint: INode\narea1.executeWrite {\nroot1.setPropertyValue(\"name\", \"root1\")\n- val child1a = root1.addNewChild(\"role1\", -1, null)\n- val child1b = root1.addNewChild(\"role1\", -1, null)\n+ val child1a = root1.addNewChild(\"role1\", -1, null as IConcept?)\n+ val child1b = root1.addNewChild(\"role1\", -1, null as IConcept?)\nmountPoint = child1b\nchild1a.setPropertyValue(\"name\", \"child1a\")\nchild1b.setPropertyValue(\"name\", \"child1b\")\n@@ -63,13 +64,13 @@ class AreaWithMountsTests {\nval branch2 = PBranch(emptyTree, idGenerator)\nvar root2Id: Long = 0\nbranch2.runWrite {\n- root2Id = branch2.writeTransaction.addNewChild(ITree.ROOT_ID, null, -1, null)\n+ root2Id = branch2.writeTransaction.addNewChild(ITree.ROOT_ID, null, -1, null as IConcept?)\n}\nval area2 = PArea(branch2)\nval root2 = area2.getRoot()\narea2.executeWrite {\nroot2.setPropertyValue(\"name\", \"root2\")\n- val child2a = root2.addNewChild(\"role1\", -1, null)\n+ val child2a = root2.addNewChild(\"role1\", -1, null as IConcept?)\nchild2a.setPropertyValue(\"name\", \"child2a\")\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "mps-version.properties",
"new_path": "mps-version.properties",
"diff": "mpsMajorVersion=2020.3\nmpsMinorVersion=5\nmpsVersion=2020.3.5\n-mpsExtensionsVersion=2020.3.2194.9dc1a5d\n+mpsExtensionsVersion=2020.3.2311.d08b348\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | use latest MPS-extensions version |
426,496 | 01.04.2022 17:58:21 | -7,200 | 5bdcfef720571d6f8478ccad57c7160e3f279f43 | use latest build script generator version | [
{
"change_type": "MODIFY",
"old_path": "workspace-manager/build.gradle.kts",
"new_path": "workspace-manager/build.gradle.kts",
"diff": "@@ -44,7 +44,7 @@ dependencies {\nimplementation(\"org.jasypt:jasypt:1.9.3\")\nimplementation(project(\":model-client\", configuration = \"jvmRuntimeElements\"))\nimplementation(project(\":headless-mps\"))\n- implementation(\"org.modelix.mpsbuild:build-tools:0.0.9\")\n+ implementation(\"org.modelix.mpsbuild:build-tools:1.0.0\")\nimplementation(\"io.ktor\",\"ktor-html-builder\", ktorVersion)\ntestImplementation(\"org.junit.jupiter:junit-jupiter-api:5.6.0\")\ntestRuntimeOnly(\"org.junit.jupiter:junit-jupiter-engine\")\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | use latest build script generator version |
426,496 | 01.04.2022 19:22:41 | -7,200 | e5df67e4cbdf1ba0fe84bcc27abd89067c5a470c | use latest MPS-extensions version (2) | [
{
"change_type": "MODIFY",
"old_path": "mps/org.modelix.model.client/org.modelix.model.client.msd",
"new_path": "mps/org.modelix.model.client/org.modelix.model.client.msd",
"diff": "<sourceRoot location=\"listenablefuture-empty-to-avoid-conflict-with-guava.jar\" />\n<sourceRoot location=\"model-client-js.jar\" />\n<sourceRoot location=\"model-client-jvm.jar\" />\n- <sourceRoot location=\"model-client-metadata-sources.jar\" />\n<sourceRoot location=\"model-client-metadata.jar\" />\n<sourceRoot location=\"osgi-resource-locator.jar\" />\n<sourceRoot location=\"trove4j.jar\" />\n"
},
{
"change_type": "MODIFY",
"old_path": "mps/org.modelix.model.mpsplugin/org.modelix.model.mpsplugin.msd",
"new_path": "mps/org.modelix.model.mpsplugin/org.modelix.model.mpsplugin.msd",
"diff": "<dependency reexport=\"false\">e52a4835-844d-46a1-99f8-c06129db796f(de.q60.mps.shadowmodels.runtime)</dependency>\n<dependency reexport=\"false\">bffdf123-0d7b-471b-a52b-fa3d3a024664(org.modelix.model.metametamodel)</dependency>\n<dependency reexport=\"false\">154f6b0f-97b3-40c8-9754-ebf11391299b(org.modelix.authentication)</dependency>\n- <dependency reexport=\"false\">8f6725be-608d-433b-98fd-844f816eb05f(jetbrains.mps.ide.make)</dependency>\n- <dependency reexport=\"false\">a1250a4d-c090-42c3-ad7c-d298a3357dd4(jetbrains.mps.make.runtime)</dependency>\n- <dependency reexport=\"false\">df9d410f-2ebb-43f7-893a-483a4f085250(jetbrains.mps.smodel.resources)</dependency>\n</dependencies>\n<languageVersions>\n<language slang=\"l:654422bf-e75f-44dc-936d-188890a746ce:de.slisson.mps.reflection\" version=\"0\" />\n<module reference=\"fdaaf35f-8ee3-4c37-b09d-9efaeaaa7a41(jetbrains.mps.core.tool.environment)\" version=\"0\" />\n<module reference=\"bfbdd672-7ff5-403f-af4f-16da5226f34c(jetbrains.mps.findUsages.runtime)\" version=\"0\" />\n<module reference=\"019b622b-0aef-4dd3-86d0-4eef01f3f6bb(jetbrains.mps.ide)\" version=\"0\" />\n- <module reference=\"8f6725be-608d-433b-98fd-844f816eb05f(jetbrains.mps.ide.make)\" version=\"0\" />\n<module reference=\"8d29d73f-ed99-4652-ae0a-083cdfe53c34(jetbrains.mps.ide.platform)\" version=\"0\" />\n<module reference=\"25092e07-e655-497c-92fb-558a8e3080ed(jetbrains.mps.ide.ui)\" version=\"0\" />\n<module reference=\"ceab5195-25ea-4f22-9b92-103b95ca8c0c(jetbrains.mps.lang.core)\" version=\"0\" />\n<module reference=\"a1250a4d-c090-42c3-ad7c-d298a3357dd4(jetbrains.mps.make.runtime)\" version=\"0\" />\n<module reference=\"8fe4c62a-2020-4ff4-8eda-f322a55bdc9f(jetbrains.mps.refactoring.runtime)\" version=\"0\" />\n<module reference=\"9a4afe51-f114-4595-b5df-048ce3c596be(jetbrains.mps.runtime)\" version=\"0\" />\n- <module reference=\"df9d410f-2ebb-43f7-893a-483a4f085250(jetbrains.mps.smodel.resources)\" version=\"0\" />\n<module reference=\"154f6b0f-97b3-40c8-9754-ebf11391299b(org.modelix.authentication)\" version=\"0\" />\n<module reference=\"acf6d2e2-4f00-4425-b7e9-fbf011feddf1(org.modelix.common)\" version=\"0\" />\n<module reference=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350(org.modelix.lib)\" version=\"0\" />\n"
},
{
"change_type": "MODIFY",
"old_path": "mps/org.modelix.notation.impl.baseLanguage/org.modelix.notation.impl.baseLanguage.mpl",
"new_path": "mps/org.modelix.notation.impl.baseLanguage/org.modelix.notation.impl.baseLanguage.mpl",
"diff": "<dependency reexport=\"false\">db058d09-86d2-48ce-b33c-595801a97e6c(org.modelix.ui.state)</dependency>\n<dependency reexport=\"false\">eb8d1040-bff5-4126-8949-fdd95ef4c502(org.modelix.ui.sm.server)</dependency>\n<dependency reexport=\"false\">0a7577d1-d4e5-431d-98b1-fae38f9aee80(org.modelix.model.repositoryconcepts)</dependency>\n- <dependency reexport=\"false\">8865b7a8-5271-43d3-884c-6fd1d9cfdd34(MPS.OpenAPI)</dependency>\n- <dependency reexport=\"false\">95085166-3236-4dd7-bd8e-e753c8d20885(de.q60.mps.incremental.runtime)</dependency>\n</dependencies>\n<languageVersions>\n<language slang=\"l:94b64715-a263-4c36-a138-8da14705ffa7:de.q60.mps.shadowmodels.transformation\" version=\"1\" />\n<language slang=\"l:f3061a53-9226-4cc5-a443-f952ceaf5816:jetbrains.mps.baseLanguage\" version=\"11\" />\n- <language slang=\"l:774bf8a0-62e5-41e1-af63-f4812e60e48b:jetbrains.mps.baseLanguage.checkedDots\" version=\"0\" />\n<language slang=\"l:443f4c36-fcf5-4eb6-9500-8d06ed259e3e:jetbrains.mps.baseLanguage.classifiers\" version=\"0\" />\n<language slang=\"l:fd392034-7849-419d-9071-12563d152375:jetbrains.mps.baseLanguage.closures\" version=\"0\" />\n<language slang=\"l:83888646-71ce-4f1c-9c53-c54016f6ad4f:jetbrains.mps.baseLanguage.collections\" version=\"1\" />\n"
},
{
"change_type": "MODIFY",
"old_path": "mps/org.modelix.ui.common/models/org.modelix.ui.common.mps",
"new_path": "mps/org.modelix.ui.common/models/org.modelix.ui.common.mps",
"diff": "<ref role=\"2AI5Lk\" to=\"wyt6:~Override\" resolve=\"Override\" />\n</node>\n</node>\n+ <node concept=\"3clFb_\" id=\"iac4jPIcmn\" role=\"jymVt\">\n+ <property role=\"TrG5h\" value=\"getConceptReference\" />\n+ <node concept=\"3Tm1VV\" id=\"iac4jPIcmo\" role=\"1B3o_S\" />\n+ <node concept=\"2AHcQZ\" id=\"iac4jPIcmq\" role=\"2AJF6D\">\n+ <ref role=\"2AI5Lk\" to=\"mhfm:~Nullable\" resolve=\"Nullable\" />\n+ </node>\n+ <node concept=\"3uibUv\" id=\"iac4jPIcmr\" role=\"3clF45\">\n+ <ref role=\"3uigEE\" to=\"jks5:~IConceptReference\" resolve=\"IConceptReference\" />\n+ </node>\n+ <node concept=\"3clFbS\" id=\"iac4jPIcms\" role=\"3clF47\">\n+ <node concept=\"3clFbF\" id=\"iac4jPInHT\" role=\"3cqZAp\">\n+ <node concept=\"2EnYce\" id=\"iac4jPIoYh\" role=\"3clFbG\">\n+ <node concept=\"1rXfSq\" id=\"iac4jPInHS\" role=\"2Oq$k0\">\n+ <ref role=\"37wK5l\" node=\"5mRomlpwoZu\" resolve=\"getConcept\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"iac4jPIoQP\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"jks5:~IConcept.getReference()\" resolve=\"getReference\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"2AHcQZ\" id=\"iac4jPIcmt\" role=\"2AJF6D\">\n+ <ref role=\"2AI5Lk\" to=\"wyt6:~Override\" resolve=\"Override\" />\n+ </node>\n+ </node>\n</node>\n<node concept=\"2tJIrI\" id=\"mtS_g4qB$x\" role=\"jymVt\" />\n<node concept=\"312cEu\" id=\"mtS_g4qKWx\" role=\"jymVt\">\n<ref role=\"2AI5Lk\" to=\"wyt6:~Override\" resolve=\"Override\" />\n</node>\n</node>\n+ <node concept=\"3clFb_\" id=\"iac4jPIpM8\" role=\"jymVt\">\n+ <property role=\"TrG5h\" value=\"getConceptReference\" />\n+ <node concept=\"3Tm1VV\" id=\"iac4jPIpM9\" role=\"1B3o_S\" />\n+ <node concept=\"2AHcQZ\" id=\"iac4jPIpMb\" role=\"2AJF6D\">\n+ <ref role=\"2AI5Lk\" to=\"mhfm:~Nullable\" resolve=\"Nullable\" />\n+ </node>\n+ <node concept=\"3uibUv\" id=\"iac4jPIpMc\" role=\"3clF45\">\n+ <ref role=\"3uigEE\" to=\"jks5:~IConceptReference\" resolve=\"IConceptReference\" />\n+ </node>\n+ <node concept=\"3clFbS\" id=\"iac4jPIpMe\" role=\"3clF47\">\n+ <node concept=\"3clFbF\" id=\"iac4jPIyUi\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"iac4jPIz0A\" role=\"3clFbG\">\n+ <node concept=\"37vLTw\" id=\"iac4jPIyUh\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"28I3pJBWL4h\" resolve=\"node\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"iac4jPIzMC\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"jks5:~INode.getConceptReference()\" resolve=\"getConceptReference\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"2AHcQZ\" id=\"iac4jPIpMf\" role=\"2AJF6D\">\n+ <ref role=\"2AI5Lk\" to=\"wyt6:~Override\" resolve=\"Override\" />\n+ </node>\n+ </node>\n</node>\n<node concept=\"2tJIrI\" id=\"7$7_4Ziil1P\" role=\"jymVt\" />\n<node concept=\"312cEu\" id=\"mtS_g4raHN\" role=\"jymVt\">\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | use latest MPS-extensions version (2) |
426,496 | 01.04.2022 21:31:45 | -7,200 | 891fe2c2f51226afe090641f5374491423d8e869 | use latest MPS-extensions version (3) | [
{
"change_type": "MODIFY",
"old_path": "mps/org.modelix.model.mpsplugin/org.modelix.model.mpsplugin.msd",
"new_path": "mps/org.modelix.model.mpsplugin/org.modelix.model.mpsplugin.msd",
"diff": "<dependency reexport=\"false\">e52a4835-844d-46a1-99f8-c06129db796f(de.q60.mps.shadowmodels.runtime)</dependency>\n<dependency reexport=\"false\">bffdf123-0d7b-471b-a52b-fa3d3a024664(org.modelix.model.metametamodel)</dependency>\n<dependency reexport=\"false\">154f6b0f-97b3-40c8-9754-ebf11391299b(org.modelix.authentication)</dependency>\n+ <dependency reexport=\"false\">8f6725be-608d-433b-98fd-844f816eb05f(jetbrains.mps.ide.make)</dependency>\n+ <dependency reexport=\"false\">a1250a4d-c090-42c3-ad7c-d298a3357dd4(jetbrains.mps.make.runtime)</dependency>\n+ <dependency reexport=\"false\">df9d410f-2ebb-43f7-893a-483a4f085250(jetbrains.mps.smodel.resources)</dependency>\n</dependencies>\n<languageVersions>\n<language slang=\"l:654422bf-e75f-44dc-936d-188890a746ce:de.slisson.mps.reflection\" version=\"0\" />\n<module reference=\"fdaaf35f-8ee3-4c37-b09d-9efaeaaa7a41(jetbrains.mps.core.tool.environment)\" version=\"0\" />\n<module reference=\"bfbdd672-7ff5-403f-af4f-16da5226f34c(jetbrains.mps.findUsages.runtime)\" version=\"0\" />\n<module reference=\"019b622b-0aef-4dd3-86d0-4eef01f3f6bb(jetbrains.mps.ide)\" version=\"0\" />\n+ <module reference=\"8f6725be-608d-433b-98fd-844f816eb05f(jetbrains.mps.ide.make)\" version=\"0\" />\n<module reference=\"8d29d73f-ed99-4652-ae0a-083cdfe53c34(jetbrains.mps.ide.platform)\" version=\"0\" />\n<module reference=\"25092e07-e655-497c-92fb-558a8e3080ed(jetbrains.mps.ide.ui)\" version=\"0\" />\n<module reference=\"ceab5195-25ea-4f22-9b92-103b95ca8c0c(jetbrains.mps.lang.core)\" version=\"0\" />\n"
},
{
"change_type": "MODIFY",
"old_path": "mps/org.modelix.notation.impl.baseLanguage/org.modelix.notation.impl.baseLanguage.mpl",
"new_path": "mps/org.modelix.notation.impl.baseLanguage/org.modelix.notation.impl.baseLanguage.mpl",
"diff": "<dependency reexport=\"false\">db058d09-86d2-48ce-b33c-595801a97e6c(org.modelix.ui.state)</dependency>\n<dependency reexport=\"false\">eb8d1040-bff5-4126-8949-fdd95ef4c502(org.modelix.ui.sm.server)</dependency>\n<dependency reexport=\"false\">0a7577d1-d4e5-431d-98b1-fae38f9aee80(org.modelix.model.repositoryconcepts)</dependency>\n+ <dependency reexport=\"false\">8865b7a8-5271-43d3-884c-6fd1d9cfdd34(MPS.OpenAPI)</dependency>\n+ <dependency reexport=\"false\">95085166-3236-4dd7-bd8e-e753c8d20885(de.q60.mps.incremental.runtime)</dependency>\n</dependencies>\n<languageVersions>\n<language slang=\"l:94b64715-a263-4c36-a138-8da14705ffa7:de.q60.mps.shadowmodels.transformation\" version=\"1\" />\n<language slang=\"l:f3061a53-9226-4cc5-a443-f952ceaf5816:jetbrains.mps.baseLanguage\" version=\"11\" />\n+ <language slang=\"l:774bf8a0-62e5-41e1-af63-f4812e60e48b:jetbrains.mps.baseLanguage.checkedDots\" version=\"0\" />\n<language slang=\"l:443f4c36-fcf5-4eb6-9500-8d06ed259e3e:jetbrains.mps.baseLanguage.classifiers\" version=\"0\" />\n<language slang=\"l:fd392034-7849-419d-9071-12563d152375:jetbrains.mps.baseLanguage.closures\" version=\"0\" />\n<language slang=\"l:83888646-71ce-4f1c-9c53-c54016f6ad4f:jetbrains.mps.baseLanguage.collections\" version=\"1\" />\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | use latest MPS-extensions version (3) |
426,496 | 02.04.2022 12:15:59 | -7,200 | 6a3ba935629105572ff5b6e147e10918b3ca72f4 | UsedModule behavior was implemented in the wrong language | [
{
"change_type": "MODIFY",
"old_path": "mps/org.modelix.model.runtimelang/models/org.modelix.model.runtimelang.behavior.mps",
"new_path": "mps/org.modelix.model.runtimelang/models/org.modelix.model.runtimelang.behavior.mps",
"diff": "<import index=\"tpcu\" ref=\"r:00000000-0000-4000-0000-011c89590282(jetbrains.mps.lang.core.behavior)\" />\n<import index=\"jh6v\" ref=\"r:f2f39a18-fd23-4090-b7f2-ba8da340eec2(org.modelix.model.repositoryconcepts.structure)\" />\n</imports>\n- <registry>\n- <language id=\"af65afd8-f0dd-4942-87d9-63a55f2a9db1\" name=\"jetbrains.mps.lang.behavior\">\n- <concept id=\"1225194240794\" name=\"jetbrains.mps.lang.behavior.structure.ConceptBehavior\" flags=\"ng\" index=\"13h7C7\">\n- <reference id=\"1225194240799\" name=\"concept\" index=\"13h7C2\" />\n- <child id=\"1225194240805\" name=\"method\" index=\"13h7CS\" />\n- <child id=\"1225194240801\" name=\"constructor\" index=\"13h7CW\" />\n- </concept>\n- <concept id=\"1225194413805\" name=\"jetbrains.mps.lang.behavior.structure.ConceptConstructorDeclaration\" flags=\"in\" index=\"13hLZK\" />\n- <concept id=\"1225194472830\" name=\"jetbrains.mps.lang.behavior.structure.ConceptMethodDeclaration\" flags=\"ng\" index=\"13i0hz\">\n- <reference id=\"1225194472831\" name=\"overriddenMethod\" index=\"13i0hy\" />\n- </concept>\n- <concept id=\"1225194691553\" name=\"jetbrains.mps.lang.behavior.structure.ThisNodeExpression\" flags=\"nn\" index=\"13iPFW\" />\n- </language>\n- <language id=\"f3061a53-9226-4cc5-a443-f952ceaf5816\" name=\"jetbrains.mps.baseLanguage\">\n- <concept id=\"1197027756228\" name=\"jetbrains.mps.baseLanguage.structure.DotExpression\" flags=\"nn\" index=\"2OqwBi\">\n- <child id=\"1197027771414\" name=\"operand\" index=\"2Oq$k0\" />\n- <child id=\"1197027833540\" name=\"operation\" index=\"2OqNvi\" />\n- </concept>\n- <concept id=\"1137021947720\" name=\"jetbrains.mps.baseLanguage.structure.ConceptFunction\" flags=\"in\" index=\"2VMwT0\">\n- <child id=\"1137022507850\" name=\"body\" index=\"2VODD2\" />\n- </concept>\n- <concept id=\"1070475926800\" name=\"jetbrains.mps.baseLanguage.structure.StringLiteral\" flags=\"nn\" index=\"Xl_RD\">\n- <property id=\"1070475926801\" name=\"value\" index=\"Xl_RC\" />\n- </concept>\n- <concept id=\"1225271177708\" name=\"jetbrains.mps.baseLanguage.structure.StringType\" flags=\"in\" index=\"17QB3L\" />\n- <concept id=\"1068580123132\" name=\"jetbrains.mps.baseLanguage.structure.BaseMethodDeclaration\" flags=\"ng\" index=\"3clF44\">\n- <child id=\"1068580123133\" name=\"returnType\" index=\"3clF45\" />\n- <child id=\"1068580123135\" name=\"body\" index=\"3clF47\" />\n- </concept>\n- <concept id=\"1068580123155\" name=\"jetbrains.mps.baseLanguage.structure.ExpressionStatement\" flags=\"nn\" index=\"3clFbF\">\n- <child id=\"1068580123156\" name=\"expression\" index=\"3clFbG\" />\n- </concept>\n- <concept id=\"1068580123136\" name=\"jetbrains.mps.baseLanguage.structure.StatementList\" flags=\"sn\" stub=\"5293379017992965193\" index=\"3clFbS\">\n- <child id=\"1068581517665\" name=\"statement\" index=\"3cqZAp\" />\n- </concept>\n- <concept id=\"1068581242875\" name=\"jetbrains.mps.baseLanguage.structure.PlusExpression\" flags=\"nn\" index=\"3cpWs3\" />\n- <concept id=\"1081773326031\" name=\"jetbrains.mps.baseLanguage.structure.BinaryOperation\" flags=\"nn\" index=\"3uHJSO\">\n- <child id=\"1081773367579\" name=\"rightExpression\" index=\"3uHU7w\" />\n- <child id=\"1081773367580\" name=\"leftExpression\" index=\"3uHU7B\" />\n- </concept>\n- <concept id=\"1178549954367\" name=\"jetbrains.mps.baseLanguage.structure.IVisible\" flags=\"ng\" index=\"1B3ioH\">\n- <child id=\"1178549979242\" name=\"visibility\" index=\"1B3o_S\" />\n- </concept>\n- <concept id=\"1146644602865\" name=\"jetbrains.mps.baseLanguage.structure.PublicVisibility\" flags=\"nn\" index=\"3Tm1VV\" />\n- </language>\n- <language id=\"7866978e-a0f0-4cc7-81bc-4d213d9375e1\" name=\"jetbrains.mps.lang.smodel\">\n- <concept id=\"1138056022639\" name=\"jetbrains.mps.lang.smodel.structure.SPropertyAccess\" flags=\"nn\" index=\"3TrcHB\">\n- <reference id=\"1138056395725\" name=\"property\" index=\"3TsBF5\" />\n- </concept>\n- </language>\n- <language id=\"ceab5195-25ea-4f22-9b92-103b95ca8c0c\" name=\"jetbrains.mps.lang.core\">\n- <concept id=\"1169194658468\" name=\"jetbrains.mps.lang.core.structure.INamedConcept\" flags=\"ng\" index=\"TrEIO\">\n- <property id=\"1169194664001\" name=\"name\" index=\"TrG5h\" />\n- </concept>\n- </language>\n- </registry>\n- <node concept=\"13h7C7\" id=\"4$UNf1h8MXw\">\n- <ref role=\"13h7C2\" to=\"jh6v:4$UNf1h8MVy\" resolve=\"UsedModule\" />\n- <node concept=\"13hLZK\" id=\"4$UNf1h8MXx\" role=\"13h7CW\">\n- <node concept=\"3clFbS\" id=\"4$UNf1h8MXy\" role=\"2VODD2\" />\n- </node>\n- <node concept=\"13i0hz\" id=\"4$UNf1h8MZz\" role=\"13h7CS\">\n- <property role=\"TrG5h\" value=\"getPresentation\" />\n- <ref role=\"13i0hy\" to=\"tpcu:hEwIMiw\" resolve=\"getPresentation\" />\n- <node concept=\"3Tm1VV\" id=\"4$UNf1h8MZK\" role=\"1B3o_S\" />\n- <node concept=\"3clFbS\" id=\"4$UNf1h8NSq\" role=\"3clF47\">\n- <node concept=\"3clFbF\" id=\"4$UNf1h8PsF\" role=\"3cqZAp\">\n- <node concept=\"3cpWs3\" id=\"4$UNf1h8Qv1\" role=\"3clFbG\">\n- <node concept=\"Xl_RD\" id=\"4$UNf1h8Qv4\" role=\"3uHU7w\">\n- <property role=\"Xl_RC\" value=\")\" />\n- </node>\n- <node concept=\"3cpWs3\" id=\"4$UNf1h8Q8p\" role=\"3uHU7B\">\n- <node concept=\"3cpWs3\" id=\"4$UNf1h8Q10\" role=\"3uHU7B\">\n- <node concept=\"2OqwBi\" id=\"4$UNf1h8P$v\" role=\"3uHU7B\">\n- <node concept=\"13iPFW\" id=\"4$UNf1h8PsE\" role=\"2Oq$k0\" />\n- <node concept=\"3TrcHB\" id=\"4$UNf1h8PGN\" role=\"2OqNvi\">\n- <ref role=\"3TsBF5\" to=\"jh6v:4$UNf1h8MXr\" resolve=\"id\" />\n- </node>\n- </node>\n- <node concept=\"Xl_RD\" id=\"4$UNf1h8Q13\" role=\"3uHU7w\">\n- <property role=\"Xl_RC\" value=\"(\" />\n- </node>\n- </node>\n- <node concept=\"2OqwBi\" id=\"4$UNf1h8Ql2\" role=\"3uHU7w\">\n- <node concept=\"13iPFW\" id=\"4$UNf1h8Q8D\" role=\"2Oq$k0\" />\n- <node concept=\"3TrcHB\" id=\"4$UNf1h8QtO\" role=\"2OqNvi\">\n- <ref role=\"3TsBF5\" to=\"jh6v:4$UNf1h8MXt\" resolve=\"name\" />\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n- </node>\n- <node concept=\"17QB3L\" id=\"4$UNf1h8NSr\" role=\"3clF45\" />\n- </node>\n- </node>\n+ <registry />\n</model>\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | UsedModule behavior was implemented in the wrong language |
426,496 | 02.04.2022 17:49:00 | -7,200 | 7355e9298380b87aa762e626a45d51176b7cac2a | Tests were not executed as part of the overallbuild | [
{
"change_type": "MODIFY",
"old_path": ".github/workflows/overallbuild.yml",
"new_path": ".github/workflows/overallbuild.yml",
"diff": "@@ -30,4 +30,4 @@ jobs:\n- name: Assemble\nenv:\nGITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n- run: ./gradlew assemble\n+ run: ./gradlew build\n"
},
{
"change_type": "MODIFY",
"old_path": "mps/test.org.modelix.model.mpsplugin/models/[email protected]",
"new_path": "mps/test.org.modelix.model.mpsplugin/models/[email protected]",
"diff": "<concept id=\"1138411891628\" name=\"jetbrains.mps.lang.smodel.structure.SNodeOperation\" flags=\"nn\" index=\"eCIE_\">\n<child id=\"1144104376918\" name=\"parameter\" index=\"1xVPHs\" />\n</concept>\n+ <concept id=\"4693937538533521280\" name=\"jetbrains.mps.lang.smodel.structure.OfConceptOperation\" flags=\"ng\" index=\"v3k3i\">\n+ <child id=\"4693937538533538124\" name=\"requestedConcept\" index=\"v3oSu\" />\n+ </concept>\n<concept id=\"7453996997717780434\" name=\"jetbrains.mps.lang.smodel.structure.Node_GetSConceptOperation\" flags=\"nn\" index=\"2yIwOk\" />\n<concept id=\"8758390115028452779\" name=\"jetbrains.mps.lang.smodel.structure.Node_GetReferencesOperation\" flags=\"nn\" index=\"2z74zc\" />\n<concept id=\"2926695023085807517\" name=\"jetbrains.mps.lang.smodel.structure.Reference_ContainingLinkOperation\" flags=\"nn\" index=\"CsP83\" />\n<concept id=\"1171315804604\" name=\"jetbrains.mps.lang.smodel.structure.Model_RootsOperation\" flags=\"nn\" index=\"2RRcyG\" />\n<concept id=\"4124388153790980106\" name=\"jetbrains.mps.lang.smodel.structure.Reference_GetTargetOperation\" flags=\"nn\" index=\"2ZHEkA\" />\n<concept id=\"1171500988903\" name=\"jetbrains.mps.lang.smodel.structure.Node_GetChildrenOperation\" flags=\"nn\" index=\"32TBzR\" />\n+ <concept id=\"3562215692195599741\" name=\"jetbrains.mps.lang.smodel.structure.SLinkImplicitSelect\" flags=\"nn\" index=\"13MTOL\">\n+ <reference id=\"3562215692195600259\" name=\"link\" index=\"13MTZf\" />\n+ </concept>\n<concept id=\"2644386474302386080\" name=\"jetbrains.mps.lang.smodel.structure.PropertyIdRefExpression\" flags=\"nn\" index=\"355D3s\">\n<reference id=\"2644386474302386081\" name=\"conceptDeclaration\" index=\"355D3t\" />\n<reference id=\"2644386474302386082\" name=\"propertyDeclaration\" index=\"355D3u\" />\n</node>\n</node>\n</node>\n+ <node concept=\"3cpWs8\" id=\"1XRJAqbXLQ4\" role=\"3cqZAp\">\n+ <node concept=\"3cpWsn\" id=\"1XRJAqbXLQ5\" role=\"3cpWs9\">\n+ <property role=\"TrG5h\" value=\"rootNodes\" />\n+ <node concept=\"A3Dl8\" id=\"1XRJAqbXLKZ\" role=\"1tU5fm\">\n+ <node concept=\"3Tqbb2\" id=\"1XRJAqbXTQf\" role=\"A3Ik2\" />\n+ </node>\n+ <node concept=\"2OqwBi\" id=\"1XRJAqbY6Me\" role=\"33vP2m\">\n+ <node concept=\"2OqwBi\" id=\"1XRJAqbY4uE\" role=\"2Oq$k0\">\n+ <node concept=\"2OqwBi\" id=\"1XRJAqbXYJM\" role=\"2Oq$k0\">\n+ <node concept=\"2OqwBi\" id=\"1XRJAqbXLQ7\" role=\"2Oq$k0\">\n+ <node concept=\"37vLTw\" id=\"1XRJAqbXLQ8\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"1yReInPM_G\" resolve=\"allChildren\" />\n+ </node>\n+ <node concept=\"3$u5V9\" id=\"1XRJAqbXLQ9\" role=\"2OqNvi\">\n+ <node concept=\"1bVj0M\" id=\"1XRJAqbXLQa\" role=\"23t8la\">\n+ <node concept=\"3clFbS\" id=\"1XRJAqbXLQb\" role=\"1bW5cS\">\n+ <node concept=\"3cpWs8\" id=\"1XRJAqbXLQc\" role=\"3cqZAp\">\n+ <node concept=\"3cpWsn\" id=\"1XRJAqbXLQd\" role=\"3cpWs9\">\n+ <property role=\"TrG5h\" value=\"n\" />\n+ <node concept=\"3Tqbb2\" id=\"1XRJAqbXLQe\" role=\"1tU5fm\" />\n+ <node concept=\"2YIFZM\" id=\"1XRJAqbXLQf\" role=\"33vP2m\">\n+ <ref role=\"37wK5l\" to=\"xxte:4EhVFrZ6z9$\" resolve=\"wrap\" />\n+ <ref role=\"1Pybhc\" to=\"xxte:4EhVFrZ3AjR\" resolve=\"NodeToSNodeAdapter\" />\n+ <node concept=\"37vLTw\" id=\"1XRJAqbXLQg\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"1XRJAqbXLQj\" resolve=\"it\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbF\" id=\"1XRJAqbXLQh\" role=\"3cqZAp\">\n+ <node concept=\"37vLTw\" id=\"1XRJAqbXLQi\" role=\"3clFbG\">\n+ <ref role=\"3cqZAo\" node=\"1XRJAqbXLQd\" resolve=\"n\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"Rh6nW\" id=\"1XRJAqbXLQj\" role=\"1bW2Oz\">\n+ <property role=\"TrG5h\" value=\"it\" />\n+ <node concept=\"2jxLKc\" id=\"1XRJAqbXLQk\" role=\"1tU5fm\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"v3k3i\" id=\"1XRJAqbY05a\" role=\"2OqNvi\">\n+ <node concept=\"chp4Y\" id=\"1XRJAqbY15I\" role=\"v3oSu\">\n+ <ref role=\"cht4Q\" to=\"jh6v:qmkA5fOskf\" resolve=\"Module\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"13MTOL\" id=\"1XRJAqbY5sZ\" role=\"2OqNvi\">\n+ <ref role=\"13MTZf\" to=\"jh6v:qmkA5fOski\" resolve=\"models\" />\n+ </node>\n+ </node>\n+ <node concept=\"13MTOL\" id=\"1XRJAqbY7KQ\" role=\"2OqNvi\">\n+ <ref role=\"13MTZf\" to=\"jh6v:qmkA5fOskk\" resolve=\"rootNodes\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n<node concept=\"3cpWs8\" id=\"7zuOo8oNn8Q\" role=\"3cqZAp\">\n<node concept=\"3cpWsn\" id=\"7zuOo8oNn8R\" role=\"3cpWs9\">\n<property role=\"TrG5h\" value=\"actual\" />\n<node concept=\"3Tqbb2\" id=\"7zuOo8oYA46\" role=\"1tU5fm\" />\n- <node concept=\"2YIFZM\" id=\"7zuOo8oNnLn\" role=\"33vP2m\">\n- <ref role=\"1Pybhc\" to=\"xxte:4EhVFrZ3AjR\" resolve=\"NodeToSNodeAdapter\" />\n- <ref role=\"37wK5l\" to=\"xxte:4EhVFrZ6z9$\" resolve=\"wrap\" />\n- <node concept=\"2OqwBi\" id=\"1yReInPS6I\" role=\"37wK5m\">\n- <node concept=\"37vLTw\" id=\"1yReInPR25\" role=\"2Oq$k0\">\n- <ref role=\"3cqZAo\" node=\"1yReInPM_G\" resolve=\"allChildren\" />\n- </node>\n- <node concept=\"1uHKPH\" id=\"1yReInPSMk\" role=\"2OqNvi\" />\n+ <node concept=\"2OqwBi\" id=\"1XRJAqbXWCU\" role=\"33vP2m\">\n+ <node concept=\"37vLTw\" id=\"1XRJAqbXVDA\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"1XRJAqbXLQ5\" resolve=\"rootNodes\" />\n</node>\n+ <node concept=\"1uHKPH\" id=\"1XRJAqbXXQd\" role=\"2OqNvi\" />\n</node>\n</node>\n</node>\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Tests were not executed as part of the overallbuild |
426,496 | 04.04.2022 13:17:07 | -7,200 | 174d1daf3a626edba9f7ef1dde4284ddc271f070 | Downloading maven dependencies by the workspace manager failed | [
{
"change_type": "MODIFY",
"old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/MavenDownloader.kt",
"new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/MavenDownloader.kt",
"diff": "@@ -27,6 +27,7 @@ class MavenDownloader(val workspace: Workspace, val workspaceDir: File) {\nif (workspace.mavenRepositories.isNotEmpty()) {\ndownloadFromMaven(coordinates, outputHandler)\n}\n+ deleteFilesForcingOnlineMode()\nreturn copyArtifacts(coordinates, outputHandler)\n}\n@@ -78,4 +79,13 @@ class MavenDownloader(val workspace: Workspace, val workspaceDir: File) {\nprivate fun addPackagingIfMissing(coordinates: String): String {\nreturn if (coordinates.split(\":\").size == 3) coordinates + \":zip\" else coordinates\n}\n+\n+ private fun deleteFilesForcingOnlineMode() {\n+ // Delete all .repositories and.sha1 files to avoid requiring an internet connection\n+ // https://manios.org/2019/08/21/force-maven-offline-execute-goal-dependencies\n+ val mavenHome = File(System.getProperty(\"user.home\")).resolve(\".m2\")\n+ mavenHome.walk()\n+ .filter { it.isFile && (it.extension == \"repositories\" || it.extension == \"sha1\") }\n+ .forEach { it.delete() }\n+ }\n}\n\\ No newline at end of file\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Downloading maven dependencies by the workspace manager failed
(cherry picked from commit 09dc9e04c90ada015a384b3d6fa24effbbf40558) |
426,496 | 04.04.2022 13:17:51 | -7,200 | fedd9cea049c4d4376995bb822007142dfb382a6 | workspace-manager: MPS home was searched twice | [
{
"change_type": "MODIFY",
"old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManager.kt",
"new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManager.kt",
"diff": "@@ -221,7 +221,7 @@ class WorkspaceManager {\n// Modelix and MPS-extensions are required to run the importer\nval additionalFolders = ArrayList<File>()\nif (!modulesMiner.getModules().getModules().containsKey(org_modelix_model_mpsplugin)) {\n- additionalFolders += File(File(\"..\"), \"mps\")\n+ //additionalFolders += File(File(\"..\"), \"mps\")\nadditionalFolders += File(\"/languages/modelix\")\n}\nif (!modulesMiner.getModules().getModules().containsKey(org_modelix_model_api)) {\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | workspace-manager: MPS home was searched twice
(cherry picked from commit 8a8b8c9db2eccd67317738f869a7f992ca3cfe33) |
426,496 | 04.04.2022 13:19:00 | -7,200 | af6c340b77b08001aa4d7662314743536e41ca9b | Duplicate git4idea plugin was found in the Modelix build output folder | [
{
"change_type": "MODIFY",
"old_path": "mps/org.modelix.build/models/org.modelix.build.mps",
"new_path": "mps/org.modelix.build/models/org.modelix.build.mps",
"diff": "<concept id=\"4903714810883702017\" name=\"jetbrains.mps.build.structure.BuildVarRefStringPart\" flags=\"ng\" index=\"3Mxwey\">\n<reference id=\"4903714810883702018\" name=\"macro\" index=\"3Mxwex\" />\n</concept>\n+ <concept id=\"202934866059043946\" name=\"jetbrains.mps.build.structure.BuildLayout_EchoProperties\" flags=\"ng\" index=\"1TblL5\">\n+ <child id=\"202934866059043948\" name=\"fileName\" index=\"1TblL3\" />\n+ </concept>\n</language>\n<language id=\"427a473d-5177-432c-9905-bcbceb71b996\" name=\"jetbrains.mps.build.mps.runner\">\n<concept id=\"4173297143638950526\" name=\"jetbrains.mps.build.mps.runner.structure.BuildSolutionRunnerAspect\" flags=\"ng\" index=\"_awnq\">\n</node>\n</node>\n</node>\n+ <node concept=\"1TblL5\" id=\"5sZaTPjhk26\" role=\"39821P\">\n+ <node concept=\"3_J27D\" id=\"5sZaTPjhk28\" role=\"1TblL3\">\n+ <node concept=\"3Mxwew\" id=\"5sZaTPjhkmb\" role=\"3MwsjC\">\n+ <property role=\"3MwjfP\" value=\".mpsbuild-ignore\" />\n+ </node>\n+ </node>\n+ </node>\n</node>\n<node concept=\"398223\" id=\"29etMtbiOct\" role=\"39821P\">\n<node concept=\"3_J27D\" id=\"29etMtbiOcv\" role=\"Nbhlr\">\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Duplicate git4idea plugin was found in the Modelix build output folder
(cherry picked from commit daa15f1d83f37189a89cb189003ec3d61fc963a2) |
426,496 | 04.04.2022 14:44:02 | -7,200 | ffdf71a3375a4e54c5076debc6200774f07f1877 | A workspace allows to specify a custom the memory limit
Depending on the number of modules in a project a higher memory limit
may be required. | [
{
"change_type": "MODIFY",
"old_path": "instances-manager/Dockerfile",
"new_path": "instances-manager/Dockerfile",
"diff": "FROM openjdk:11\nWORKDIR /usr/ui-proxy\nEXPOSE 33332\n-COPY build/libs/* /instances-manager/\n-COPY build/dependencies/* /instances-manager/\n-CMD [\"java\", \"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005\", \"-XX:MaxRAMPercentage=85\", \"-cp\", \"/instances-manager/*\", \"org.modelix.instancesmanager.Main\"]\n\\ No newline at end of file\n+COPY build/libs/instances-manager-latest-all.jar /instances-manager/\n+CMD [\"java\", \"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005\", \"-XX:MaxRAMPercentage=85\", \"-cp\", \"/instances-manager/instances-manager-latest-all.jar\", \"org.modelix.instancesmanager.Main\"]\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "instances-manager/build.gradle",
"new_path": "instances-manager/build.gradle",
"diff": "plugins {\nid 'java'\n+ id \"com.github.johnrengelman.shadow\" version \"6.1.0\"\n}\ngroup 'org.modelix'\n@@ -18,6 +19,10 @@ repositories {\nmavenCentral()\n}\n+shadowJar {\n+ archiveVersion.set(\"latest\")\n+}\n+\ndependencies {\ntestCompile group: 'junit', name: 'junit', version: '4.12'\ncompile 'io.kubernetes:client-java:8.0.2'\n@@ -37,11 +42,8 @@ dependencies {\ncompile group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '5.8.0.202006091008-r'\ncompile group: 'org.kohsuke', name: 'github-api', version: '1.115'\n-}\n-task copyRuntimeLibs(type: Copy) {\n- into \"$buildDir/dependencies\"\n- from configurations.runtime\n+ implementation(project(path: \":model-client\", configuration: \"jvmRuntimeElements\"))\n}\n-assemble.dependsOn copyRuntimeLibs\n\\ No newline at end of file\n+assemble.dependsOn shadowJar\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "instances-manager/src/main/java/org/modelix/instancesmanager/DeploymentManager.java",
"new_path": "instances-manager/src/main/java/org/modelix/instancesmanager/DeploymentManager.java",
"diff": "*/\npackage org.modelix.instancesmanager;\n+import io.kubernetes.client.custom.Quantity;\nimport io.kubernetes.client.openapi.ApiException;\nimport io.kubernetes.client.openapi.Configuration;\nimport io.kubernetes.client.openapi.apis.AppsV1Api;\n@@ -23,12 +24,15 @@ import io.kubernetes.client.openapi.models.V1EnvVar;\nimport io.kubernetes.client.openapi.models.V1ObjectMeta;\nimport io.kubernetes.client.openapi.models.V1Pod;\nimport io.kubernetes.client.openapi.models.V1PodList;\n+import io.kubernetes.client.openapi.models.V1ResourceRequirements;\nimport io.kubernetes.client.openapi.models.V1Service;\nimport io.kubernetes.client.openapi.models.V1ServiceList;\nimport io.kubernetes.client.util.ClientBuilder;\nimport io.kubernetes.client.util.Yaml;\nimport org.apache.log4j.Logger;\nimport org.eclipse.jetty.server.Request;\n+import org.json.JSONObject;\n+import org.modelix.model.client.RestWebModelClient;\nimport javax.annotation.Nullable;\nimport javax.servlet.http.HttpServletRequest;\n@@ -79,6 +83,7 @@ public class DeploymentManager {\nprivate final AtomicLong deploymentSuffixSequence = new AtomicLong(0xf);\nprivate final Map<String, Assignments> assignments = Collections.synchronizedMap(new HashMap<>());\nprivate final AtomicBoolean dirty = new AtomicBoolean(true);\n+ private RestWebModelClient modelClient = new RestWebModelClient(System.getenv(\"model_server_url\"));\npublic DeploymentManager() {\ntry {\n@@ -290,6 +295,8 @@ public class DeploymentManager {\nif (workspaceHash != null) {\ndeployment.getSpec().getTemplate().getSpec().getContainers().get(0)\n.addEnvItem(new V1EnvVar().name(\"modelix_workspace_hash\").value(workspaceHash));\n+\n+ loadMemoryLimit(workspaceHash, deployment);\n}\nSystem.out.println(\"Creating deployment: \");\n@@ -325,6 +332,23 @@ public class DeploymentManager {\nreturn true;\n}\n+ private void loadMemoryLimit(String workspaceHash, V1Deployment deployment) {\n+ try {\n+ String workspaceSpecString = modelClient.get(workspaceHash);\n+ if (workspaceSpecString == null) return;\n+ JSONObject workspaceSpec = new JSONObject(workspaceSpecString);\n+ V1ResourceRequirements resources = deployment.getSpec().getTemplate().getSpec().getContainers().get(0).getResources();\n+ if (resources == null) return;\n+ Quantity memoryLimit = Quantity.fromString(workspaceSpec.optString(\"memoryLimit\", \"2Gi\"));\n+ Map<String, Quantity> limits = resources.getLimits();\n+ if (limits != null) limits.put(\"memory\", memoryLimit);\n+ Map<String, Quantity> requests = resources.getRequests();\n+ if (requests != null) requests.put(\"memory\", memoryLimit);\n+ } catch (Exception ex) {\n+ LOG.error(\"Failed to load memory limit from workspace \" + workspaceHash, ex);\n+ }\n+ }\n+\nprivate class Assignments {\nprivate final String originalDeploymentName;\nprivate final Map<String, String> userId2deployment = new HashMap<>();\n"
},
{
"change_type": "MODIFY",
"old_path": "kubernetes/common/instances-manager-deployment.yaml",
"new_path": "kubernetes/common/instances-manager-deployment.yaml",
"diff": "@@ -25,6 +25,9 @@ spec:\n- image: modelix/modelix-instances-manager:0.0.72\nimagePullPolicy: IfNotPresent\nname: instances-manager\n+ env:\n+ - name: model_server_url\n+ value: http://model:28101/\nports:\n- containerPort: 33332\n- containerPort: 5005\n"
},
{
"change_type": "MODIFY",
"old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/Workspace.kt",
"new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/Workspace.kt",
"diff": "@@ -26,6 +26,7 @@ import java.util.*\ndata class Workspace(var id: String,\nvar name: String? = null,\nval mpsVersion: String? = null,\n+ val memoryLimit: String = \"2.0Gi\",\nval modelRepositories: List<ModelRepository> = listOf(),\nval gitRepositories: List<GitRepository> = listOf(),\nval mavenRepositories: List<MavenRepository> = listOf(),\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | A workspace allows to specify a custom the memory limit
Depending on the number of modules in a project a higher memory limit
may be required.
(cherry picked from commit 1721cb5f265c32905bc2124d93034a3cfb177257) |
426,496 | 05.04.2022 09:58:50 | -7,200 | f12459cf622a1734bde4ae48cdc38242e8a72e16 | Ensure the correct MPS version is used in the projector image | [
{
"change_type": "MODIFY",
"old_path": "Dockerfile-projector-base",
"new_path": "Dockerfile-projector-base",
"diff": "-FROM modelix/projector-mps:2020.3.5-202202281349\n+# the tag is updated by docker-build-projector-base.sh\n+# if the required version doesn't exist yet, run docker-build-projector-mps.sh\n+FROM modelix/projector-mps:2021.1.4\nUSER root\nCOPY install-plugins.sh /\n"
},
{
"change_type": "MODIFY",
"old_path": "docker-build-projector-base.sh",
"new_path": "docker-build-projector-base.sh",
"diff": "set -e\n+# read variables from mps-version.properties\n+while IFS='=' read -r key value\n+do\n+ echo \"$key=$value\"\n+ eval \"${key}\"=\\${value}\n+done < \"mps-version.properties\"\n+echo \"MPS Version: $mpsVersion\"\n+echo \"MPS Major Version: $mpsMajorVersion\"\n+echo \"MPS Minor Version: $mpsMinorVersion\"\n+\n+sed -i.bak -E \"s/FROM modelix\\/projector-mps:.+/FROM modelix\\/projector-mps:${mpsVersion}/\" Dockerfile-projector-base\n+rm Dockerfile-projector-base.bak\n+\n# patch branding.jar to not show EULA and data sharing agreement at startup\nrm -rf build/branding\nrm -f build/branding.zip\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Ensure the correct MPS version is used in the projector image
(cherry picked from commit 293c93489cc9cea8b9bf3d68f6ced78490044d9a) |
426,496 | 05.04.2022 13:43:40 | -7,200 | 6ecac27f9e50d39fac8cfe651ecd646a05afa8d8 | unnecessary direct dependency from workspace-manager to MPS | [
{
"change_type": "MODIFY",
"old_path": "workspace-manager/build.gradle.kts",
"new_path": "workspace-manager/build.gradle.kts",
"diff": "@@ -23,14 +23,6 @@ tasks.withType<ShadowJar> {\n}\ndependencies {\n- compileOnly(fileTree(\"../artifacts/mps/lib\") {\n- include(\"mps-environment.jar\")\n- include(\"mps-platform.jar\")\n- include(\"mps-core.jar\")\n- include(\"mps-openapi.jar\")\n- include(\"platform-api.jar\")\n- include(\"util.jar\")\n- })\nimplementation(\"io.ktor\", \"ktor-server-core\", ktorVersion)\nimplementation(\"io.ktor\", \"ktor-server-netty\", ktorVersion)\nimplementation(\"ch.qos.logback\", \"logback-classic\", logbackVersion)\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | unnecessary direct dependency from workspace-manager to MPS |
426,496 | 05.04.2022 16:28:40 | -7,200 | 4e3d1873754073d1238e4911c5db32513b18e82f | Use the workspace-client image matching the MPS version configured in the workspace | [
{
"change_type": "MODIFY",
"old_path": "instances-manager/src/main/java/org/modelix/instancesmanager/DeploymentManager.java",
"new_path": "instances-manager/src/main/java/org/modelix/instancesmanager/DeploymentManager.java",
"diff": "@@ -18,6 +18,7 @@ import io.kubernetes.client.openapi.ApiException;\nimport io.kubernetes.client.openapi.Configuration;\nimport io.kubernetes.client.openapi.apis.AppsV1Api;\nimport io.kubernetes.client.openapi.apis.CoreV1Api;\n+import io.kubernetes.client.openapi.models.V1Container;\nimport io.kubernetes.client.openapi.models.V1Deployment;\nimport io.kubernetes.client.openapi.models.V1DeploymentList;\nimport io.kubernetes.client.openapi.models.V1EnvVar;\n@@ -296,7 +297,7 @@ public class DeploymentManager {\ndeployment.getSpec().getTemplate().getSpec().getContainers().get(0)\n.addEnvItem(new V1EnvVar().name(\"modelix_workspace_hash\").value(workspaceHash));\n- loadMemoryLimit(workspaceHash, deployment);\n+ loadWorkspaceSpecificValues(workspaceHash, deployment);\n}\nSystem.out.println(\"Creating deployment: \");\n@@ -332,12 +333,23 @@ public class DeploymentManager {\nreturn true;\n}\n- private void loadMemoryLimit(String workspaceHash, V1Deployment deployment) {\n+ private void loadWorkspaceSpecificValues(String workspaceHash, V1Deployment deployment) {\ntry {\nString workspaceSpecString = modelClient.get(workspaceHash);\nif (workspaceSpecString == null) return;\nJSONObject workspaceSpec = new JSONObject(workspaceSpecString);\n- V1ResourceRequirements resources = deployment.getSpec().getTemplate().getSpec().getContainers().get(0).getResources();\n+ V1Container container = deployment.getSpec().getTemplate().getSpec().getContainers().get(0);\n+\n+ String mpsVersion = workspaceSpec.optString(\"mpsVersion\");\n+ if (mpsVersion != null && mpsVersion.matches(\"20\\\\d\\\\d\\\\.\\\\d\")) {\n+ String image = container.getImage();\n+ if (image != null) {\n+ image = image.replaceFirst(\":20\\\\d\\\\d\\\\.\\\\d\\\\.(\\\\d+)\", \":\" + mpsVersion + \".$1\");\n+ container.setImage(image);\n+ }\n+ }\n+\n+ V1ResourceRequirements resources = container.getResources();\nif (resources == null) return;\nQuantity memoryLimit = Quantity.fromString(workspaceSpec.optString(\"memoryLimit\", \"2Gi\"));\nMap<String, Quantity> limits = resources.getLimits();\n@@ -345,7 +357,7 @@ public class DeploymentManager {\nMap<String, Quantity> requests = resources.getRequests();\nif (requests != null) requests.put(\"memory\", memoryLimit);\n} catch (Exception ex) {\n- LOG.error(\"Failed to load memory limit from workspace \" + workspaceHash, ex);\n+ LOG.error(\"Failed to configure the deployment for the workspace \" + workspaceHash, ex);\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManager.kt",
"new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManager.kt",
"diff": "@@ -105,7 +105,6 @@ class WorkspaceManager {\nfun newWorkspace(): Workspace {\nval workspace = Workspace(\nid = SerializationUtil.longToHex(modelClient.idGenerator.generate()),\n- mpsVersion = \"2020.3.5\",\nmodelRepositories = listOf(ModelRepository(id = \"default\"))\n)\nmodelClient.put(key(workspace.id), Json.encodeToString(workspace))\n@@ -155,6 +154,9 @@ class WorkspaceManager {\n@Synchronized\nfun update(workspace: Workspace): WorkspaceHash {\n//loadCommitHashes(workspace)\n+ require(workspace.mpsVersion == null || workspace.mpsVersion.matches(Regex(\"\"\"20\\d\\d\\.\\d\"\"\"))) {\n+ \"Invalid major MPS version: '${workspace.mpsVersion}'. Examples for valid values: '2020.3', '2021.1', '2021.2'.\"\n+ }\nworkspace.gitRepositories.forEach { it.credentials = it.credentials?.encrypt() }\nval id = workspace.id\nval json = Json.encodeToString(workspace)\n"
},
{
"change_type": "MODIFY",
"old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt",
"new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt",
"diff": "@@ -171,8 +171,8 @@ fun Application.workspaceManagerModule() {\n}\nli {\nb { +\"mpsVersion\" }\n- +\": Currently not used.\"\n- +\" A workspace is always executed with MPS version that is installed in the Modelix cluster.\"\n+ +\": This is experimental.\"\n+ +\" The workspace will be executed using a docker image from a Modelix release for a different MPS version.\"\n}\nli {\nb { +\"modelRepositories\" }\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Use the workspace-client image matching the MPS version configured in the workspace |
426,504 | 06.04.2022 11:35:47 | -7,200 | 1a471c62690b5ab563dc70ff9bd6f8cd1cb31865 | restore not intentional changes | [
{
"change_type": "MODIFY",
"old_path": "build.gradle",
"new_path": "build.gradle",
"diff": "@@ -110,7 +110,7 @@ subprojects {\nif (githubCredentials != null) {\nmaven {\nname = \"GitHubPackages\"\n- url = uri(\"https://maven.pkg.github.com/ftomassetti/modelix\")\n+ url = uri(\"https://maven.pkg.github.com/modelix/modelix\")\nif (githubCredentials != null) {\ncredentials {\nusername = githubCredentials[0]\n"
},
{
"change_type": "MODIFY",
"old_path": "mps/org.modelix.model.mpsplugin/org.modelix.model.mpsplugin.msd",
"new_path": "mps/org.modelix.model.mpsplugin/org.modelix.model.mpsplugin.msd",
"diff": "<module reference=\"a1250a4d-c090-42c3-ad7c-d298a3357dd4(jetbrains.mps.make.runtime)\" version=\"0\" />\n<module reference=\"8fe4c62a-2020-4ff4-8eda-f322a55bdc9f(jetbrains.mps.refactoring.runtime)\" version=\"0\" />\n<module reference=\"9a4afe51-f114-4595-b5df-048ce3c596be(jetbrains.mps.runtime)\" version=\"0\" />\n+ <module reference=\"df9d410f-2ebb-43f7-893a-483a4f085250(jetbrains.mps.smodel.resources)\" version=\"0\" />\n<module reference=\"154f6b0f-97b3-40c8-9754-ebf11391299b(org.modelix.authentication)\" version=\"0\" />\n<module reference=\"acf6d2e2-4f00-4425-b7e9-fbf011feddf1(org.modelix.common)\" version=\"0\" />\n<module reference=\"87f4b21e-a3a5-459e-a54b-408fd9eb7350(org.modelix.lib)\" version=\"0\" />\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | restore not intentional changes |
426,504 | 06.04.2022 12:18:49 | -7,200 | 23d89d3a335289219684fbfd9e716073eb4852fb | using socket for communication between Gradle and MPS | [
{
"change_type": "MODIFY",
"old_path": "gradle-plugin/src/main/java/org/modelix/gradle/model/EnvironmentLoader.java",
"new_path": "gradle-plugin/src/main/java/org/modelix/gradle/model/EnvironmentLoader.java",
"diff": "@@ -37,6 +37,7 @@ public class EnvironmentLoader {\nADDITIONAL_PLUGINS(\"additionalPlugins\"),\nADDITIONAL_PLUGIN_DIRS(\"additionalPluginDirs\"),\nMPS_EXTENSIONS_PATH(\"mpsExtensionsPath\"),\n+ GRADLE_PLUGIN_SOCKET_PORT(\"gradlePluginSocketPort\"),\nMODELIX_PATH(\"modelixPath\"),\nMAKE(\"make\"),\nPROJECT(\"project\");\n"
},
{
"change_type": "MODIFY",
"old_path": "gradle-plugin/src/main/java/org/modelix/gradle/model/ModelPlugin.java",
"new_path": "gradle-plugin/src/main/java/org/modelix/gradle/model/ModelPlugin.java",
"diff": "@@ -10,16 +10,79 @@ import org.gradle.api.tasks.JavaExec;\nimport org.gradle.process.ExecResult;\nimport org.modelix.gradle.model.EnvironmentLoader.Key;\n+import java.io.BufferedReader;\nimport java.io.File;\nimport java.io.IOException;\n+import java.io.InputStreamReader;\n+import java.io.PrintWriter;\n+import java.net.ServerSocket;\n+import java.net.Socket;\nimport java.net.URL;\nimport java.time.Duration;\nimport java.util.Arrays;\nimport java.util.Enumeration;\n+import java.util.LinkedList;\nimport java.util.List;\nimport java.util.jar.Manifest;\nimport java.util.stream.Collectors;\n+import static com.ibm.icu.text.PluralRules.Operand.e;\n+\n+\n+class MyServerSocketThread extends Thread {\n+ private List<String> messagesFromDownloadTask = new LinkedList<String>();\n+ private ServerSocket serverSocket;\n+ private int port;\n+ private PrintWriter out;\n+ private BufferedReader in;\n+ private boolean askedToDie = false;\n+\n+ public MyServerSocketThread() {\n+ super();\n+ try {\n+ ServerSocket serverSocket = new ServerSocket(0);\n+ port = serverSocket.getLocalPort();\n+ } catch (IOException e) {\n+ throw new RuntimeException(\"Unable to start server socket for communication with download task\", e);\n+ }\n+ }\n+\n+ public int getPort() {\n+ return this.port;\n+ }\n+\n+ public boolean succedeed() {\n+ return messagesFromDownloadTask.contains(\"<MODEL EXPORT COMPLETED SUCCESSFULLY>\");\n+ }\n+\n+ public boolean failed() {\n+ return messagesFromDownloadTask.contains(\"<MODEL EXPORT NOT COMPLETED SUCCESSFULLY>\");\n+ }\n+\n+ @Override\n+ public void run() {\n+ try {\n+ Socket clientSocket = serverSocket.accept();\n+ out = new PrintWriter(clientSocket.getOutputStream(), true);\n+ in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));\n+ while (!askedToDie) {\n+ String messageReceived = in.readLine();\n+ System.out.println(\"Received from Download TasK: \" + messageReceived);\n+ if (!askedToDie) {\n+ this.messagesFromDownloadTask.add(messageReceived);\n+ }\n+ }\n+ } catch (IOException e) {\n+ throw new RuntimeException(\"Unable to communicate with client\", e);\n+ }\n+ }\n+\n+ public void pleaseGracefullyDie() {\n+ this.askedToDie = true;\n+ }\n+\n+}\n+\npublic class ModelPlugin implements Plugin<Project> {\n@Override\n@@ -91,7 +154,8 @@ public class ModelPlugin implements Plugin<Project> {\njavaExec.dependsOn(copyMpsTask, copyMpsModelPluginTask);\n}\n- StreamContentCapture sg = StreamContentCapture.go(javaExec, System.out);\n+ MyServerSocketThread serverSocketThread = new MyServerSocketThread();\n+ serverSocketThread.start();\njavaExec.setDescription(\"Export models from modelix model server to MPS files\");\njavaExec.classpath(project.fileTree(new File(mpsLocation, \"lib\")).include(\"**/*.jar\"));\n@@ -103,7 +167,8 @@ public class ModelPlugin implements Plugin<Project> {\nKey.ADDITIONAL_LIBRARIES.getCode(), settings.getAdditionalLibrariesAsString(),\nKey.ADDITIONAL_LIBRARY_DIRS.getCode(), settings.getAdditionalLibraryDirsAsString(),\nKey.ADDITIONAL_PLUGINS.getCode(), settings.getAdditionalPluginsAsString(),\n- Key.ADDITIONAL_PLUGIN_DIRS.getCode(), settings.getAdditionalPluginDirsAsString()\n+ Key.ADDITIONAL_PLUGIN_DIRS.getCode(), settings.getAdditionalPluginDirsAsString(),\n+ Key.GRADLE_PLUGIN_SOCKET_PORT.getCode(), Integer.toString(serverSocketThread.getPort())\n);\nif (settings.getProjectFile() != null) {\njavaExec.args(Key.PROJECT.getCode(), settings.getProjectFile().getAbsolutePath());\n@@ -129,16 +194,20 @@ public class ModelPlugin implements Plugin<Project> {\nSystem.out.println(\" Args : \" + javaExec.getArgs());\nSystem.out.println(\"After execution of export main\");\nExecResult execResult = javaExec.getExecutionResult().get();\n+\n+ serverSocketThread.pleaseGracefullyDie();\n+ // now no one is writing on my collection and I can safely read it\n+\nint exitValue = execResult.getExitValue();\nSystem.out.println(\"Exit value was \" + exitValue);\n- List<String> outputLines = sg.getContent();\n- boolean success = outputLines.contains(\"<MODEL EXPORT COMPLETED SUCCESSFULLY>\");\n- boolean failure = outputLines.contains(\"<MODEL EXPORT NOT COMPLETED SUCCESSFULLY>\");\n- if (failure) {\n+ //List<String> outputLines = sg.getContent();\n+ //boolean success = outputLines.contains(\"<MODEL EXPORT COMPLETED SUCCESSFULLY>\");\n+ //boolean failure = outputLines.contains(\"<MODEL EXPORT NOT COMPLETED SUCCESSFULLY>\");\n+ if (serverSocketThread.failed()) {\nSystem.err.println(\"Execution of ExportMain failed\");\nthrow new RuntimeException();\n}\n- if (!success) {\n+ if (!serverSocketThread.succedeed()) {\nSystem.err.println(\"Execution of ExportMain does not indicate success\");\nthrow new RuntimeException(\"We could not find the output lines indicating successful completion. Lines found: \" + outputLines);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "mps/org.modelix.model.mpsplugin/models/org.modelix.model.mpsplugin.plugin.mps",
"new_path": "mps/org.modelix.model.mpsplugin/models/org.modelix.model.mpsplugin.plugin.mps",
"diff": "<import index=\"z1c5\" ref=\"86441d7a-e194-42da-81a5-2161ec62a379/java:jetbrains.mps.project(MPS.Workbench/)\" />\n<import index=\"1ctc\" ref=\"6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.util.stream(JDK/)\" />\n<import index=\"hvt5\" ref=\"0a2651ab-f212-45c2-a2f0-343e76cbc26b/java:org.modelix.model(org.modelix.model.client/)\" />\n- <import index=\"guwi\" ref=\"6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.io(JDK/)\" implicit=\"true\" />\n+ <import index=\"guwi\" ref=\"6354ebe7-c22a-4a0f-ac54-50b52ab9b065/java:java.io(JDK/)\" />\n<import index=\"71xd\" ref=\"742f6602-5a2f-4313-aa6e-ae1cd4ffdc61/java:jetbrains.mps.ide.tools(MPS.Platform/)\" implicit=\"true\" />\n<import index=\"tprs\" ref=\"r:00000000-0000-4000-0000-011c895904a4(jetbrains.mps.ide.actions)\" implicit=\"true\" />\n<import index=\"tpcu\" ref=\"r:00000000-0000-4000-0000-011c89590282(jetbrains.mps.lang.core.behavior)\" implicit=\"true\" />\n</node>\n</node>\n</node>\n+ <node concept=\"Wx3nA\" id=\"72FvSoAwZtY\" role=\"jymVt\">\n+ <property role=\"TrG5h\" value=\"GRADLE_PLUGIN_SOCKET_PORT\" />\n+ <property role=\"3TUv4t\" value=\"true\" />\n+ <node concept=\"3Tm1VV\" id=\"72FvSoAwZtZ\" role=\"1B3o_S\" />\n+ <node concept=\"17QB3L\" id=\"72FvSoAwZu0\" role=\"1tU5fm\" />\n+ <node concept=\"3cpWs3\" id=\"72FvSoAwZu1\" role=\"33vP2m\">\n+ <node concept=\"Xl_RD\" id=\"72FvSoAwZu2\" role=\"3uHU7w\">\n+ <property role=\"Xl_RC\" value=\"gradlePluginSocketPort\" />\n+ </node>\n+ <node concept=\"37vLTw\" id=\"72FvSoAwZu5\" role=\"3uHU7B\">\n+ <ref role=\"3cqZAo\" node=\"4D52TXxABGO\" resolve=\"PREFIX\" />\n+ </node>\n+ </node>\n+ </node>\n<node concept=\"Wx3nA\" id=\"25JjLrsBYsb\" role=\"jymVt\">\n<property role=\"TrG5h\" value=\"MAKE\" />\n<property role=\"3TUv4t\" value=\"true\" />\n</node>\n</node>\n</node>\n+ <node concept=\"3clFbH\" id=\"72FvSoAx8E9\" role=\"3cqZAp\" />\n+ <node concept=\"3cpWs8\" id=\"72FvSoAx352\" role=\"3cqZAp\">\n+ <node concept=\"3cpWsn\" id=\"72FvSoAx355\" role=\"3cpWs9\">\n+ <property role=\"TrG5h\" value=\"gradleTaskPort\" />\n+ <node concept=\"10Oyi0\" id=\"72FvSoAx350\" role=\"1tU5fm\" />\n+ <node concept=\"2YIFZM\" id=\"72FvSoAx5ri\" role=\"33vP2m\">\n+ <ref role=\"1Pybhc\" to=\"wyt6:~Integer\" resolve=\"Integer\" />\n+ <ref role=\"37wK5l\" to=\"wyt6:~Integer.parseInt(java.lang.String)\" resolve=\"parseInt\" />\n+ <node concept=\"2YIFZM\" id=\"72FvSoAx5xV\" role=\"37wK5m\">\n+ <ref role=\"1Pybhc\" to=\"ia5i:3xX$Vyo038N\" resolve=\"PropertyOrEnv\" />\n+ <ref role=\"37wK5l\" to=\"ia5i:3xX$Vyo0aHz\" resolve=\"get\" />\n+ <node concept=\"10M0yZ\" id=\"72FvSoAx5Wz\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"72FvSoAwZtY\" resolve=\"GRADLE_PLUGIN_SOCKET_PORT\" />\n+ <ref role=\"1PxDUh\" node=\"4D52TXxApUP\" resolve=\"ModelixExportConfiguration\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3cpWs8\" id=\"72FvSoAxcHh\" role=\"3cqZAp\">\n+ <node concept=\"3cpWsn\" id=\"72FvSoAxcHi\" role=\"3cpWs9\">\n+ <property role=\"TrG5h\" value=\"gradleTaskClient\" />\n+ <node concept=\"3uibUv\" id=\"72FvSoAxeK2\" role=\"1tU5fm\">\n+ <ref role=\"3uigEE\" to=\"zf81:~Socket\" resolve=\"Socket\" />\n+ </node>\n+ <node concept=\"2ShNRf\" id=\"72FvSoAxf6f\" role=\"33vP2m\">\n+ <node concept=\"1pGfFk\" id=\"72FvSoAxf0x\" role=\"2ShVmc\">\n+ <ref role=\"37wK5l\" to=\"zf81:~Socket.<init>(java.lang.String,int)\" resolve=\"Socket\" />\n+ <node concept=\"Xl_RD\" id=\"72FvSoAxfht\" role=\"37wK5m\">\n+ <property role=\"Xl_RC\" value=\"127.0.0.1\" />\n+ </node>\n+ <node concept=\"37vLTw\" id=\"72FvSoAxg2I\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"72FvSoAx355\" resolve=\"gradleTaskPort\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3cpWs8\" id=\"72FvSoAxtfH\" role=\"3cqZAp\">\n+ <node concept=\"3cpWsn\" id=\"72FvSoAxtfI\" role=\"3cpWs9\">\n+ <property role=\"TrG5h\" value=\"gradleTaskOut\" />\n+ <node concept=\"3uibUv\" id=\"72FvSoAxtfJ\" role=\"1tU5fm\">\n+ <ref role=\"3uigEE\" to=\"guwi:~PrintWriter\" resolve=\"PrintWriter\" />\n+ </node>\n+ <node concept=\"2ShNRf\" id=\"72FvSoAxmSg\" role=\"33vP2m\">\n+ <node concept=\"1pGfFk\" id=\"72FvSoAxmT8\" role=\"2ShVmc\">\n+ <ref role=\"37wK5l\" to=\"guwi:~PrintWriter.<init>(java.io.OutputStream,boolean)\" resolve=\"PrintWriter\" />\n+ <node concept=\"2OqwBi\" id=\"72FvSoAxn3v\" role=\"37wK5m\">\n+ <node concept=\"37vLTw\" id=\"72FvSoAxnjS\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"72FvSoAxcHi\" resolve=\"gradleTaskClient\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"72FvSoAxn3w\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"zf81:~Socket.getOutputStream()\" resolve=\"getOutputStream\" />\n+ </node>\n+ </node>\n+ <node concept=\"3clFbT\" id=\"72FvSoAxmTa\" role=\"37wK5m\">\n+ <property role=\"3clFbU\" value=\"true\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3cpWs8\" id=\"72FvSoAx$WH\" role=\"3cqZAp\">\n+ <node concept=\"3cpWsn\" id=\"72FvSoAx$WI\" role=\"3cpWs9\">\n+ <property role=\"TrG5h\" value=\"gradleTaskIn\" />\n+ <node concept=\"3uibUv\" id=\"72FvSoAxBui\" role=\"1tU5fm\">\n+ <ref role=\"3uigEE\" to=\"guwi:~BufferedReader\" resolve=\"BufferedReader\" />\n+ </node>\n+ <node concept=\"2ShNRf\" id=\"72FvSoAxBDp\" role=\"33vP2m\">\n+ <node concept=\"1pGfFk\" id=\"72FvSoAxqoy\" role=\"2ShVmc\">\n+ <ref role=\"37wK5l\" to=\"guwi:~BufferedReader.<init>(java.io.Reader)\" resolve=\"BufferedReader\" />\n+ <node concept=\"2ShNRf\" id=\"72FvSoAxqoz\" role=\"37wK5m\">\n+ <node concept=\"1pGfFk\" id=\"72FvSoAxqo$\" role=\"2ShVmc\">\n+ <ref role=\"37wK5l\" to=\"guwi:~InputStreamReader.<init>(java.io.InputStream)\" resolve=\"InputStreamReader\" />\n+ <node concept=\"2OqwBi\" id=\"72FvSoAxEaG\" role=\"37wK5m\">\n+ <node concept=\"37vLTw\" id=\"72FvSoAxEt3\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"72FvSoAxcHi\" resolve=\"gradleTaskClient\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"72FvSoAxEaH\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"zf81:~Socket.getInputStream()\" resolve=\"getInputStream\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbH\" id=\"72FvSoAx6Gj\" role=\"3cqZAp\" />\n<node concept=\"3cpWs8\" id=\"d9jdlYVi9E\" role=\"3cqZAp\">\n<node concept=\"3cpWsn\" id=\"d9jdlYVi9F\" role=\"3cpWs9\">\n<property role=\"TrG5h\" value=\"modelServerConnection\" />\n</node>\n</node>\n</node>\n- <node concept=\"3clFbF\" id=\"5mIc0gCpJt7\" role=\"3cqZAp\">\n- <node concept=\"2OqwBi\" id=\"5mIc0gCpJt8\" role=\"3clFbG\">\n- <node concept=\"10M0yZ\" id=\"5mIc0gCpJt9\" role=\"2Oq$k0\">\n- <ref role=\"1PxDUh\" to=\"wyt6:~System\" resolve=\"System\" />\n- <ref role=\"3cqZAo\" to=\"wyt6:~System.out\" resolve=\"out\" />\n+ <node concept=\"3clFbF\" id=\"72FvSoAxMYG\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"72FvSoAxMYH\" role=\"3clFbG\">\n+ <node concept=\"37vLTw\" id=\"72FvSoAxMYI\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"72FvSoAxtfI\" resolve=\"gradleTaskOut\" />\n</node>\n- <node concept=\"liA8E\" id=\"5mIc0gCpJta\" role=\"2OqNvi\">\n- <ref role=\"37wK5l\" to=\"guwi:~PrintStream.println(java.lang.String)\" resolve=\"println\" />\n- <node concept=\"Xl_RD\" id=\"5mIc0gCpJtb\" role=\"37wK5m\">\n- <property role=\"Xl_RC\" value=\"<MODEL EXPORT NOT COMPLETED SUCCESSFULLY>\" />\n+ <node concept=\"liA8E\" id=\"72FvSoAxMYJ\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"guwi:~PrintWriter.append(java.lang.CharSequence)\" resolve=\"append\" />\n+ <node concept=\"Xl_RD\" id=\"72FvSoAxMYK\" role=\"37wK5m\">\n+ <property role=\"Xl_RC\" value=\"<MODEL EXPORT NOT COMPLETED SUCCESSFULLY>\\n\" />\n</node>\n</node>\n</node>\n</node>\n</node>\n</node>\n- <node concept=\"3clFbF\" id=\"5mIc0gCp$gn\" role=\"3cqZAp\">\n- <node concept=\"2OqwBi\" id=\"5mIc0gCp$go\" role=\"3clFbG\">\n- <node concept=\"10M0yZ\" id=\"5mIc0gCp$gp\" role=\"2Oq$k0\">\n- <ref role=\"1PxDUh\" to=\"wyt6:~System\" resolve=\"System\" />\n- <ref role=\"3cqZAo\" to=\"wyt6:~System.out\" resolve=\"out\" />\n+ <node concept=\"3clFbF\" id=\"72FvSoAxJ7B\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"72FvSoAxJxR\" role=\"3clFbG\">\n+ <node concept=\"37vLTw\" id=\"72FvSoAxJ7_\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"72FvSoAxtfI\" resolve=\"gradleTaskOut\" />\n</node>\n- <node concept=\"liA8E\" id=\"5mIc0gCp$gq\" role=\"2OqNvi\">\n- <ref role=\"37wK5l\" to=\"guwi:~PrintStream.println(java.lang.String)\" resolve=\"println\" />\n- <node concept=\"Xl_RD\" id=\"5mIc0gCp$gr\" role=\"37wK5m\">\n- <property role=\"Xl_RC\" value=\"<MODEL EXPORT COMPLETED SUCCESSFULLY>\" />\n+ <node concept=\"liA8E\" id=\"72FvSoAxKss\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"guwi:~PrintWriter.append(java.lang.CharSequence)\" resolve=\"append\" />\n+ <node concept=\"Xl_RD\" id=\"72FvSoAxLYS\" role=\"37wK5m\">\n+ <property role=\"Xl_RC\" value=\"<MODEL EXPORT COMPLETED SUCCESSFULLY>\\n\" />\n</node>\n</node>\n</node>\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | using socket for communication between Gradle and MPS |
426,496 | 06.04.2022 14:41:31 | -7,200 | bbb2622a522c402f6ca1e687005e8f986e077923 | Moved workspace classes to separate library
To allow deserializing it in the instances-manager | [
{
"change_type": "MODIFY",
"old_path": ".idea/gradle.xml",
"new_path": ".idea/gradle.xml",
"diff": "<option value=\"$PROJECT_DIR$/ui-server\" />\n<option value=\"$PROJECT_DIR$/workspace-client\" />\n<option value=\"$PROJECT_DIR$/workspace-manager\" />\n+ <option value=\"$PROJECT_DIR$/workspaces\" />\n</set>\n</option>\n</GradleProjectSettings>\n"
},
{
"change_type": "MODIFY",
"old_path": "settings.gradle",
"new_path": "settings.gradle",
"diff": "@@ -10,6 +10,7 @@ include 'instances-manager'\ninclude 'gradle-plugin'\ninclude 'manual-tests'\ninclude 'graphql-server'\n+include 'workspaces'\ninclude 'workspace-manager'\ninclude 'workspace-client'\ninclude 'headless-mps'\n"
},
{
"change_type": "MODIFY",
"old_path": "workspace-manager/build.gradle.kts",
"new_path": "workspace-manager/build.gradle.kts",
"diff": "@@ -36,6 +36,7 @@ dependencies {\nimplementation(\"org.jasypt:jasypt:1.9.3\")\nimplementation(project(\":model-client\", configuration = \"jvmRuntimeElements\"))\nimplementation(project(\":headless-mps\"))\n+ implementation(project(\":workspaces\"))\nimplementation(\"org.modelix.mpsbuild:build-tools:1.0.0\")\nimplementation(\"io.ktor\",\"ktor-html-builder\", ktorVersion)\ntestImplementation(\"org.junit.jupiter:junit-jupiter-api:5.6.0\")\n"
},
{
"change_type": "MODIFY",
"old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManager.kt",
"new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManager.kt",
"diff": "@@ -154,8 +154,9 @@ class WorkspaceManager {\n@Synchronized\nfun update(workspace: Workspace): WorkspaceHash {\n//loadCommitHashes(workspace)\n- require(workspace.mpsVersion == null || workspace.mpsVersion.matches(Regex(\"\"\"20\\d\\d\\.\\d\"\"\"))) {\n- \"Invalid major MPS version: '${workspace.mpsVersion}'. Examples for valid values: '2020.3', '2021.1', '2021.2'.\"\n+ val mpsVersion = workspace.mpsVersion\n+ require(mpsVersion == null || mpsVersion.matches(Regex(\"\"\"20\\d\\d\\.\\d\"\"\"))) {\n+ \"Invalid major MPS version: '$mpsVersion'. Examples for valid values: '2020.3', '2021.1', '2021.2'.\"\n}\nworkspace.gitRepositories.forEach { it.credentials = it.credentials?.encrypt() }\nval id = workspace.id\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "workspaces/build.gradle.kts",
"diff": "+plugins {\n+ kotlin(\"jvm\")\n+ kotlin(\"plugin.serialization\")\n+}\n+\n+dependencies {\n+ implementation(\"org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2\")\n+ implementation(\"com.charleskorn.kaml:kaml:0.40.0\")\n+ implementation(\"org.eclipse.jgit:org.eclipse.jgit:5.8.0.202006091008-r\")\n+ implementation(\"org.apache.maven.shared:maven-invoker:3.1.0\")\n+ implementation(\"org.zeroturnaround:zt-zip:1.14\")\n+ implementation(\"org.apache.commons:commons-text:1.9\")\n+ implementation(\"org.jasypt:jasypt:1.9.3\")\n+ implementation(project(\":model-client\", configuration = \"jvmRuntimeElements\"))\n+}\n"
},
{
"change_type": "RENAME",
"old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/Workspace.kt",
"new_path": "workspaces/src/main/kotlin/org/modelix/workspace/manager/Workspace.kt",
"diff": ""
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Moved workspace classes to separate library
To allow deserializing it in the instances-manager |
426,496 | 06.04.2022 16:28:21 | -7,200 | ee275d91456e9d78fcaadfa718a67a1ed45b330f | use the new workspace library in the instances-manager to read a workspace | [
{
"change_type": "MODIFY",
"old_path": "instances-manager/build.gradle",
"new_path": "instances-manager/build.gradle",
"diff": "@@ -45,6 +45,7 @@ dependencies {\ncompile group: 'org.kohsuke', name: 'github-api', version: '1.115'\nimplementation(project(path: \":model-client\", configuration: \"jvmRuntimeElements\"))\n+ implementation(project(path: \":workspaces\"))\n}\nassemble.dependsOn shadowJar\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "instances-manager/src/main/kotlin/org/modelix/instancesmanager/DeploymentManager.kt",
"new_path": "instances-manager/src/main/kotlin/org/modelix/instancesmanager/DeploymentManager.kt",
"diff": "@@ -26,6 +26,8 @@ import org.eclipse.jetty.server.Request\nimport org.json.JSONObject\nimport org.modelix.instancesmanager.DeploymentManager\nimport org.modelix.model.client.RestWebModelClient\n+import org.modelix.workspaces.WorkspaceHash\n+import org.modelix.workspaces.WorkspacePersistence\nimport java.io.IOException\nimport java.util.*\nimport java.util.concurrent.atomic.AtomicBoolean\n@@ -56,7 +58,7 @@ class DeploymentManager {\nprivate val deploymentSuffixSequence = AtomicLong(0xf)\nprivate val assignments = Collections.synchronizedMap(HashMap<String?, Assignments>())\nprivate val dirty = AtomicBoolean(true)\n- private val modelClient = RestWebModelClient(System.getenv(\"model_server_url\"))\n+ private val workspacePersistence = WorkspacePersistence()\nprivate fun getAssignments(originalDeploymentName: String?): Assignments {\nreturn assignments.computeIfAbsent(originalDeploymentName) { originalDeploymentName: String? -> Assignments(originalDeploymentName) }\n}\n@@ -286,10 +288,9 @@ class DeploymentManager {\nprivate fun loadWorkspaceSpecificValues(workspaceHash: String, deployment: V1Deployment) {\ntry {\n- val workspaceSpecString = modelClient[workspaceHash] ?: return\n- val workspaceSpec = JSONObject(workspaceSpecString)\n+ val workspace = workspacePersistence.getWorkspaceForHash(WorkspaceHash(workspaceHash)) ?: return\nval container = deployment.spec!!.template.spec!!.containers[0]\n- val mpsVersion = workspaceSpec.optString(\"mpsVersion\")\n+ val mpsVersion = workspace.mpsVersion\nif (mpsVersion != null && mpsVersion.matches(\"\"\"20\\d\\d\\.\\d\"\"\".toRegex())) {\nvar image = container.image\nif (image != null) {\n@@ -298,7 +299,7 @@ class DeploymentManager {\n}\n}\nval resources = container.resources ?: return\n- val memoryLimit = Quantity.fromString(workspaceSpec.optString(\"memoryLimit\", \"2Gi\"))\n+ val memoryLimit = Quantity.fromString(workspace.memoryLimit)\nval limits = resources.limits\nif (limits != null) limits[\"memory\"] = memoryLimit\nval requests = resources.requests\n"
},
{
"change_type": "MODIFY",
"old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/GitRepositoryManager.kt",
"new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/GitRepositoryManager.kt",
"diff": "@@ -19,6 +19,8 @@ import org.eclipse.jgit.api.TransportCommand\nimport org.eclipse.jgit.errors.RepositoryNotFoundException\nimport org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider\nimport org.modelix.model.persistent.HashUtil\n+import org.modelix.workspaces.Credentials\n+import org.modelix.workspaces.GitRepository\nimport java.io.*\nimport java.lang.IllegalArgumentException\nimport java.util.zip.ZipOutputStream\n"
},
{
"change_type": "MODIFY",
"old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/MavenDownloader.kt",
"new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/MavenDownloader.kt",
"diff": "@@ -17,6 +17,7 @@ import org.apache.commons.io.FileUtils\nimport org.apache.maven.shared.invoker.DefaultInvocationRequest\nimport org.apache.maven.shared.invoker.DefaultInvoker\nimport org.apache.maven.shared.invoker.InvocationOutputHandler\n+import org.modelix.workspaces.Workspace\nimport org.zeroturnaround.zip.ZipUtil\nimport java.io.File\nimport java.util.*\n"
},
{
"change_type": "MODIFY",
"old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceBuildJob.kt",
"new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceBuildJob.kt",
"diff": "*/\npackage org.modelix.workspace.manager\n+import org.modelix.workspaces.Workspace\nimport java.io.File\nclass WorkspaceBuildJob(val workspace: Workspace, val downloadFile: File) {\n"
},
{
"change_type": "MODIFY",
"old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManager.kt",
"new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManager.kt",
"diff": "@@ -22,6 +22,10 @@ import org.modelix.model.persistent.SerializationUtil\nimport org.modelix.buildtools.*\nimport org.modelix.headlessmps.*\nimport org.modelix.model.persistent.HashUtil\n+import org.modelix.workspaces.ModelRepository\n+import org.modelix.workspaces.Workspace\n+import org.modelix.workspaces.WorkspaceHash\n+import org.modelix.workspaces.WorkspacePersistence\nimport org.w3c.dom.Document\nimport java.io.File\nimport java.io.FileOutputStream\n@@ -42,9 +46,8 @@ class WorkspaceManager {\nval org_modelix_model_api = ModuleId(\"cc99dce1-49f3-4392-8dbf-e22ca47bd0af\")\n}\n- private val WORKSPACE_LIST_KEY = \"workspaces\"\nprivate val mpsHome: File = findMpsHome()\n- private val modelClient: RestWebModelClient = RestWebModelClient(getModelServerUrl())\n+ private val workspacePersistence = WorkspacePersistence()\nprivate val directory: File = run {\n// The workspace will contain git repositories. Avoid cloning them into an existing repository.\nval ancestors = mutableListOf(File(\".\").absoluteFile)\n@@ -82,91 +85,12 @@ class WorkspaceManager {\nreturn file\n}\n- private fun getModelServerUrl(): String {\n- return listOf(\"model.server.url\", \"model_server_url\")\n- .flatMap { listOf(System.getProperty(it), System.getenv(it)) }\n- .filterNotNull()\n- .firstOrNull() ?: \"http://localhost:31963/model/\"\n- }\n-\n- @Synchronized\n- fun getWorkspaceIds(): Set<String> {\n- val idString = modelClient.get(WORKSPACE_LIST_KEY)\n- if (idString.isNullOrEmpty()) return setOf()\n- return idString.split(\",\").toSet()\n- }\n-\n- @Synchronized\n- fun setWorkspaceIds(ids: Set<String>) {\n- modelClient.put(WORKSPACE_LIST_KEY, ids.sorted().joinToString(\",\"))\n- }\n-\n- @Synchronized\n- fun newWorkspace(): Workspace {\n- val workspace = Workspace(\n- id = SerializationUtil.longToHex(modelClient.idGenerator.generate()),\n- modelRepositories = listOf(ModelRepository(id = \"default\"))\n- )\n- modelClient.put(key(workspace.id), Json.encodeToString(workspace))\n- setWorkspaceIds(getWorkspaceIds() + workspace.id)\n- return workspace\n- }\n-\n- private fun key(workspaceId: String) = \"workspace-$workspaceId\"\n-\n- fun getWorkspaceForId(id: String): Pair<Workspace, WorkspaceHash>? {\n- require(id.matches(Regex(\"[a-f0-9]{9,16}\"))) { \"Invalid workspace ID: $id\" }\n- return getWorkspaceForIdOrHash(id)\n- }\n-\n- @Synchronized\n- fun getWorkspaceForIdOrHash(idOrHash: String): Pair<Workspace, WorkspaceHash>? {\n- val hash: WorkspaceHash\n- val json: String\n- if (HashUtil.isSha256(idOrHash)) {\n- hash = WorkspaceHash(idOrHash)\n- json = modelClient.get(hash.toString()) ?: return null\n- } else {\n- val id = idOrHash\n- require(id.matches(Regex(\"[a-f0-9]{9,16}\"))) { \"Invalid workspace ID: $id\" }\n-\n- val hashOrJson = modelClient.get(key(id)) ?: return null\n- if (HashUtil.isSha256(hashOrJson)) {\n- hash = WorkspaceHash(hashOrJson)\n- json = modelClient.get(hash.toString()) ?: return null\n- } else {\n- // migrate old entry\n- json = hashOrJson\n- hash = WorkspaceHash(HashUtil.sha256(json))\n- modelClient.put(hash.toString(), json)\n- modelClient.put(key(id), hash.toString())\n- }\n- }\n- return Json.decodeFromString<Workspace>(json) to hash\n- }\n-\n- @Synchronized\n- fun getWorkspaceForHash(hash: WorkspaceHash): Workspace? {\n- val json = modelClient.get(hash.toString()) ?: return null\n- return Json.decodeFromString<Workspace>(json)\n- }\n-\n@Synchronized\nfun update(workspace: Workspace): WorkspaceHash {\n//loadCommitHashes(workspace)\n- val mpsVersion = workspace.mpsVersion\n- require(mpsVersion == null || mpsVersion.matches(Regex(\"\"\"20\\d\\d\\.\\d\"\"\"))) {\n- \"Invalid major MPS version: '$mpsVersion'. Examples for valid values: '2020.3', '2021.1', '2021.2'.\"\n- }\n- workspace.gitRepositories.forEach { it.credentials = it.credentials?.encrypt() }\n- val id = workspace.id\n- val json = Json.encodeToString(workspace)\n- val hash = WorkspaceHash(HashUtil.sha256(json))\n- modelClient.put(hash.toString(), json)\n- modelClient.put(key(id), hash.toString())\n- setWorkspaceIds(getWorkspaceIds() + workspace.id)\n+ val hash = workspacePersistence.update(workspace)\nsynchronized(buildJobs) {\n- buildJobs.remove(id)\n+ buildJobs.remove(workspace.id)\nFileUtils.deleteQuietly(getDownloadFile(hash))\n}\nreturn hash\n@@ -187,7 +111,7 @@ class WorkspaceManager {\nfun getWorkspaceDirectory(workspace: Workspace) = File(directory, workspace.id)\nfun newUploadFolder(): File {\n- val id = SerializationUtil.longToHex(modelClient.idGenerator.generate())\n+ val id = workspacePersistence.generateId()\nval folder = getUploadFolder(id)\nfolder.mkdirs()\nreturn folder\n@@ -266,13 +190,13 @@ class WorkspaceManager {\n}\nfun getDownloadFile(workspaceHash: WorkspaceHash): File {\n- val workspace = getWorkspaceForHash(workspaceHash) ?: throw RuntimeException(\"Workspace not found: $workspaceHash\")\n+ val workspace = workspacePersistence.getWorkspaceForHash(workspaceHash) ?: throw RuntimeException(\"Workspace not found: $workspaceHash\")\nval cleanHash = workspaceHash.toString().replace(\"*\", \"\")\nreturn File(File(getWorkspaceDirectory(workspace), cleanHash), \"workspace.zip\")\n}\nfun buildWorkspaceDownloadFileAsync(workspaceHash: WorkspaceHash): WorkspaceBuildJob {\n- val workspace = getWorkspaceForHash(workspaceHash) ?: throw RuntimeException(\"Workspace not found: $workspaceHash\")\n+ val workspace = workspacePersistence.getWorkspaceForHash(workspaceHash) ?: throw RuntimeException(\"Workspace not found: $workspaceHash\")\nval job: WorkspaceBuildJob\nsynchronized(buildJobs) {\n@@ -357,7 +281,7 @@ class WorkspaceManager {\nargs += envFile.canonicalPath\njvmArgs += \"-Dmodelix.executionMode=MODEL_IMPORT\"\njvmArgs += \"-Dmodelix.import.repositoryId=workspace_${job.workspace.id}\"\n- jvmArgs += \"-Dmodelix.import.serverUrl=${getModelServerUrl()}\"\n+ jvmArgs += \"-Dmodelix.import.serverUrl=${workspacePersistence.getModelServerUrl()}\"\nclasspath.clear()\nclasspath += mpsClassPath\nclasspath += (headlessMpsFolder.listFiles() ?: arrayOf()).map { it.canonicalPath }\n@@ -398,5 +322,10 @@ class WorkspaceManager {\nfile.listFiles()?.forEach { visitFiles(it, visitor) }\n}\n}\n+\n+ fun getWorkspaceIds() = workspacePersistence.getWorkspaceIds()\n+ fun getWorkspaceForId(workspaceId: String) = workspacePersistence.getWorkspaceForId(workspaceId)\n+ fun getWorkspaceForHash(workspaceHash: WorkspaceHash) = workspacePersistence.getWorkspaceForHash(workspaceHash)\n+ fun newWorkspace() = workspacePersistence.newWorkspace()\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt",
"new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt",
"diff": "@@ -30,6 +30,8 @@ import kotlinx.serialization.decodeFromString\nimport kotlinx.serialization.encodeToString\nimport org.apache.commons.io.FileUtils\nimport org.apache.commons.text.StringEscapeUtils\n+import org.modelix.workspaces.Workspace\n+import org.modelix.workspaces.WorkspaceHash\nimport org.zeroturnaround.zip.ZipUtil\nimport java.io.File\n"
},
{
"change_type": "RENAME",
"old_path": "workspaces/src/main/kotlin/org/modelix/workspace/manager/Workspace.kt",
"new_path": "workspaces/src/main/kotlin/org/modelix/workspaces/Workspace.kt",
"diff": "* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n-package org.modelix.workspace.manager\n+package org.modelix.workspaces\nimport kotlinx.serialization.Serializable\nimport org.jasypt.util.text.AES256TextEncryptor\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "workspaces/src/main/kotlin/org/modelix/workspaces/WorkspacePersistence.kt",
"diff": "+/*\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.modelix.workspaces\n+\n+import kotlinx.serialization.decodeFromString\n+import kotlinx.serialization.encodeToString\n+import kotlinx.serialization.json.Json\n+import org.apache.commons.io.FileUtils\n+import org.modelix.model.client.RestWebModelClient\n+import org.modelix.model.persistent.HashUtil\n+import org.modelix.model.persistent.SerializationUtil\n+\n+class WorkspacePersistence {\n+ private val WORKSPACE_LIST_KEY = \"workspaces\"\n+ private val modelClient: RestWebModelClient = RestWebModelClient(getModelServerUrl())\n+\n+ fun generateId(): String = SerializationUtil.longToHex(modelClient.idGenerator.generate())\n+\n+ fun getWorkspaceIds(): Set<String> {\n+ val idString = modelClient.get(WORKSPACE_LIST_KEY)\n+ if (idString.isNullOrEmpty()) return setOf()\n+ return idString.split(\",\").toSet()\n+ }\n+\n+ private fun setWorkspaceIds(ids: Set<String>) {\n+ modelClient.put(WORKSPACE_LIST_KEY, ids.sorted().joinToString(\",\"))\n+ }\n+\n+ @Synchronized\n+ fun newWorkspace(): Workspace {\n+ val workspace = Workspace(\n+ id = generateId(),\n+ modelRepositories = listOf(ModelRepository(id = \"default\"))\n+ )\n+ modelClient.put(key(workspace.id), Json.encodeToString(workspace))\n+ setWorkspaceIds(getWorkspaceIds() + workspace.id)\n+ return workspace\n+ }\n+\n+ private fun key(workspaceId: String) = \"workspace-$workspaceId\"\n+\n+ fun getWorkspaceForId(id: String): Pair<Workspace, WorkspaceHash>? {\n+ require(id.matches(Regex(\"[a-f0-9]{9,16}\"))) { \"Invalid workspace ID: $id\" }\n+ return getWorkspaceForIdOrHash(id)\n+ }\n+\n+ @Synchronized\n+ fun getWorkspaceForIdOrHash(idOrHash: String): Pair<Workspace, WorkspaceHash>? {\n+ val hash: WorkspaceHash\n+ val json: String\n+ if (HashUtil.isSha256(idOrHash)) {\n+ hash = WorkspaceHash(idOrHash)\n+ json = modelClient.get(hash.toString()) ?: return null\n+ } else {\n+ val id = idOrHash\n+ require(id.matches(Regex(\"[a-f0-9]{9,16}\"))) { \"Invalid workspace ID: $id\" }\n+\n+ val hashOrJson = modelClient.get(key(id)) ?: return null\n+ if (HashUtil.isSha256(hashOrJson)) {\n+ hash = WorkspaceHash(hashOrJson)\n+ json = modelClient.get(hash.toString()) ?: return null\n+ } else {\n+ // migrate old entry\n+ json = hashOrJson\n+ hash = WorkspaceHash(HashUtil.sha256(json))\n+ modelClient.put(hash.toString(), json)\n+ modelClient.put(key(id), hash.toString())\n+ }\n+ }\n+ return Json.decodeFromString<Workspace>(json) to hash\n+ }\n+\n+ @Synchronized\n+ fun getWorkspaceForHash(hash: WorkspaceHash): Workspace? {\n+ val json = modelClient.get(hash.toString()) ?: return null\n+ return Json.decodeFromString<Workspace>(json)\n+ }\n+\n+ @Synchronized\n+ fun update(workspace: Workspace): WorkspaceHash {\n+ val mpsVersion = workspace.mpsVersion\n+ require(mpsVersion == null || mpsVersion.matches(Regex(\"\"\"20\\d\\d\\.\\d\"\"\"))) {\n+ \"Invalid major MPS version: '$mpsVersion'. Examples for valid values: '2020.3', '2021.1', '2021.2'.\"\n+ }\n+ workspace.gitRepositories.forEach { it.credentials = it.credentials?.encrypt() }\n+ val id = workspace.id\n+ val json = Json.encodeToString(workspace)\n+ val hash = WorkspaceHash(HashUtil.sha256(json))\n+ modelClient.put(hash.toString(), json)\n+ modelClient.put(key(id), hash.toString())\n+ setWorkspaceIds(getWorkspaceIds() + workspace.id)\n+ return hash\n+ }\n+\n+ fun dispose() {\n+ modelClient.dispose()\n+ }\n+\n+ fun getModelServerUrl(): String {\n+ return listOf(\"model.server.url\", \"model_server_url\")\n+ .flatMap { listOf(System.getProperty(it), System.getenv(it)) }\n+ .filterNotNull()\n+ .firstOrNull() ?: \"http://localhost:31963/model/\"\n+ }\n+}\n\\ No newline at end of file\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | use the new workspace library in the instances-manager to read a workspace |
426,504 | 07.04.2022 09:26:19 | -7,200 | 0e18945b606fe9ffc6902c2e860cf388d2b9d327 | correct assignment of local variable instead of field | [
{
"change_type": "MODIFY",
"old_path": "gradle-plugin/src/main/java/org/modelix/gradle/model/ModelPlugin.java",
"new_path": "gradle-plugin/src/main/java/org/modelix/gradle/model/ModelPlugin.java",
"diff": "@@ -40,7 +40,7 @@ class MyServerSocketThread extends Thread {\npublic MyServerSocketThread() {\nsuper();\ntry {\n- ServerSocket serverSocket = new ServerSocket(0);\n+ serverSocket = new ServerSocket(0);\nport = serverSocket.getLocalPort();\n} catch (IOException e) {\nthrow new RuntimeException(\"Unable to start server socket for communication with download task\", e);\n@@ -67,7 +67,7 @@ class MyServerSocketThread extends Thread {\nin = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));\nwhile (!askedToDie) {\nString messageReceived = in.readLine();\n- System.out.println(\"Received from Download TasK: \" + messageReceived);\n+ System.out.println(\"Received from Download Task: \" + messageReceived);\nif (!askedToDie) {\nthis.messagesFromDownloadTask.add(messageReceived);\n}\n@@ -209,7 +209,7 @@ public class ModelPlugin implements Plugin<Project> {\n}\nif (!serverSocketThread.succedeed()) {\nSystem.err.println(\"Execution of ExportMain does not indicate success\");\n- throw new RuntimeException(\"We could not find the output lines indicating successful completion. Lines found: \" + outputLines);\n+ throw new RuntimeException(\"We did not receive explicit confirmation that the download operation succeeded\");\n}\nif (exitValue != 0) {\nSystem.err.println(\"Execution of ExportMain failed. Exit code: \" + exitValue);\n"
},
{
"change_type": "MODIFY",
"old_path": "mps/org.modelix.model.mpsplugin/models/org.modelix.model.mpsplugin.plugin.mps",
"new_path": "mps/org.modelix.model.mpsplugin/models/org.modelix.model.mpsplugin.plugin.mps",
"diff": "</node>\n</node>\n</node>\n+ <node concept=\"abc8K\" id=\"1ZcsIWIiPbT\" role=\"3cqZAp\">\n+ <node concept=\"Xl_RD\" id=\"1ZcsIWIiPbU\" role=\"abp_N\">\n+ <property role=\"Xl_RC\" value=\"DOWNLOAD TASK WRITING \" />\n+ </node>\n+ <node concept=\"Xl_RD\" id=\"1ZcsIWIiPbV\" role=\"abp_N\">\n+ <property role=\"Xl_RC\" value=\"<MODEL EXPORT NOT COMPLETED SUCCESSFULLY>\\n\" />\n+ </node>\n+ </node>\n<node concept=\"3clFbF\" id=\"72FvSoAxMYG\" role=\"3cqZAp\">\n<node concept=\"2OqwBi\" id=\"72FvSoAxMYH\" role=\"3clFbG\">\n<node concept=\"37vLTw\" id=\"72FvSoAxMYI\" role=\"2Oq$k0\">\n</node>\n</node>\n</node>\n+ <node concept=\"abc8K\" id=\"1ZcsIWIiLPO\" role=\"3cqZAp\">\n+ <node concept=\"Xl_RD\" id=\"1ZcsIWIiNov\" role=\"abp_N\">\n+ <property role=\"Xl_RC\" value=\"DOWNLOAD TASK WRITING \" />\n+ </node>\n+ <node concept=\"Xl_RD\" id=\"1ZcsIWIiO_4\" role=\"abp_N\">\n+ <property role=\"Xl_RC\" value=\"<MODEL EXPORT COMPLETED SUCCESSFULLY>\\n\" />\n+ </node>\n+ </node>\n<node concept=\"3clFbF\" id=\"72FvSoAxJ7B\" role=\"3cqZAp\">\n<node concept=\"2OqwBi\" id=\"72FvSoAxJxR\" role=\"3clFbG\">\n<node concept=\"37vLTw\" id=\"72FvSoAxJ7_\" role=\"2Oq$k0\">\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | correct assignment of local variable instead of field |
426,504 | 07.04.2022 09:41:40 | -7,200 | b8421547ccb54d8308a6fc1e53f45021fbe62194 | adding more logs on socket communication | [
{
"change_type": "MODIFY",
"old_path": "gradle-plugin/src/main/java/org/modelix/gradle/model/ModelPlugin.java",
"new_path": "gradle-plugin/src/main/java/org/modelix/gradle/model/ModelPlugin.java",
"diff": "@@ -55,6 +55,10 @@ class MyServerSocketThread extends Thread {\nreturn messagesFromDownloadTask.contains(\"<MODEL EXPORT COMPLETED SUCCESSFULLY>\");\n}\n+ public List<String> getReceivedMessages() {\n+ return messagesFromDownloadTask;\n+ }\n+\npublic boolean failed() {\nreturn messagesFromDownloadTask.contains(\"<MODEL EXPORT NOT COMPLETED SUCCESSFULLY>\");\n}\n@@ -65,11 +69,12 @@ class MyServerSocketThread extends Thread {\nSocket clientSocket = serverSocket.accept();\nout = new PrintWriter(clientSocket.getOutputStream(), true);\nin = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));\n+ System.out.println(\"MyServerSocketThread is waiting to receive messages\");\nwhile (!askedToDie) {\nString messageReceived = in.readLine();\n- System.out.println(\"Received from Download Task: \" + messageReceived);\n+ System.out.println(\"MyServerSocketThread received from Download Task: \" + messageReceived);\nif (!askedToDie) {\n- this.messagesFromDownloadTask.add(messageReceived);\n+ this.messagesFromDownloadTask.add(messageReceived.trim());\n}\n}\n} catch (IOException e) {\n@@ -209,7 +214,7 @@ public class ModelPlugin implements Plugin<Project> {\n}\nif (!serverSocketThread.succedeed()) {\nSystem.err.println(\"Execution of ExportMain does not indicate success\");\n- throw new RuntimeException(\"We did not receive explicit confirmation that the download operation succeeded\");\n+ throw new RuntimeException(\"We did not receive explicit confirmation that the download operation succeeded. We received this: \" + serverSocketThread.getReceivedMessages());\n}\nif (exitValue != 0) {\nSystem.err.println(\"Execution of ExportMain failed. Exit code: \" + exitValue);\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | adding more logs on socket communication |
426,504 | 07.04.2022 10:19:01 | -7,200 | 3353cf9531ed37e639d3aa65f62c170613e38cec | ensure messages are flushed through the socket | [
{
"change_type": "MODIFY",
"old_path": "gradle-plugin/src/main/java/org/modelix/gradle/model/ModelPlugin.java",
"new_path": "gradle-plugin/src/main/java/org/modelix/gradle/model/ModelPlugin.java",
"diff": "@@ -42,6 +42,7 @@ class MyServerSocketThread extends Thread {\ntry {\nserverSocket = new ServerSocket(0);\nport = serverSocket.getLocalPort();\n+ System.out.println(\"MyServerSocketThread started on port \" + port);\n} catch (IOException e) {\nthrow new RuntimeException(\"Unable to start server socket for communication with download task\", e);\n}\n@@ -66,19 +67,28 @@ class MyServerSocketThread extends Thread {\n@Override\npublic void run() {\ntry {\n+ System.out.println(\"MyServerSocketThread waiting for connection on port \" + port);\nSocket clientSocket = serverSocket.accept();\nout = new PrintWriter(clientSocket.getOutputStream(), true);\nin = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));\nSystem.out.println(\"MyServerSocketThread is waiting to receive messages\");\n- while (!askedToDie) {\n+ boolean eof = false;\n+ while (!askedToDie && !eof) {\nString messageReceived = in.readLine();\n+ if (messageReceived == null) {\n+ eof = true;\n+ System.out.println(\"MyServerSocketThread received from Download Task: null\");\n+ } else {\nSystem.out.println(\"MyServerSocketThread received from Download Task: \" + messageReceived);\nif (!askedToDie) {\nthis.messagesFromDownloadTask.add(messageReceived.trim());\n+ } else {\n+ System.out.println(\"MyServerSocketThread is ignoring the message because asked to die\");\n+ }\n}\n}\n} catch (IOException e) {\n- throw new RuntimeException(\"Unable to communicate with client\", e);\n+ throw new RuntimeException(\"MyServerSocketThread is unable to communicate with client\", e);\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "mps/org.modelix.model.mpsplugin/models/org.modelix.model.mpsplugin.plugin.mps",
"new_path": "mps/org.modelix.model.mpsplugin/models/org.modelix.model.mpsplugin.plugin.mps",
"diff": "</node>\n</node>\n</node>\n+ <node concept=\"3clFbF\" id=\"1ZcsIWIjaGi\" role=\"3cqZAp\">\n+ <node concept=\"2OqwBi\" id=\"1ZcsIWIjaGj\" role=\"3clFbG\">\n+ <node concept=\"10M0yZ\" id=\"1ZcsIWIjaGk\" role=\"2Oq$k0\">\n+ <ref role=\"1PxDUh\" to=\"wyt6:~System\" resolve=\"System\" />\n+ <ref role=\"3cqZAo\" to=\"wyt6:~System.out\" resolve=\"out\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"1ZcsIWIjaGl\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"guwi:~PrintStream.println(java.lang.String)\" resolve=\"println\" />\n+ <node concept=\"3cpWs3\" id=\"1ZcsIWIjdnU\" role=\"37wK5m\">\n+ <node concept=\"37vLTw\" id=\"1ZcsIWIjdCo\" role=\"3uHU7w\">\n+ <ref role=\"3cqZAo\" node=\"72FvSoAx355\" resolve=\"gradleTaskPort\" />\n+ </node>\n+ <node concept=\"Xl_RD\" id=\"1ZcsIWIjaGm\" role=\"3uHU7B\">\n+ <property role=\"Xl_RC\" value=\"Modelix Application Plugin - connecting to gradle task on port \" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n<node concept=\"3cpWs8\" id=\"72FvSoAxcHh\" role=\"3cqZAp\">\n<node concept=\"3cpWsn\" id=\"72FvSoAxcHi\" role=\"3cpWs9\">\n<property role=\"TrG5h\" value=\"gradleTaskClient\" />\n<ref role=\"3cqZAo\" node=\"72FvSoAxtfI\" resolve=\"gradleTaskOut\" />\n</node>\n<node concept=\"liA8E\" id=\"72FvSoAxMYJ\" role=\"2OqNvi\">\n- <ref role=\"37wK5l\" to=\"guwi:~PrintWriter.append(java.lang.CharSequence)\" resolve=\"append\" />\n+ <ref role=\"37wK5l\" to=\"guwi:~PrintWriter.println(java.lang.String)\" resolve=\"println\" />\n<node concept=\"Xl_RD\" id=\"72FvSoAxMYK\" role=\"37wK5m\">\n- <property role=\"Xl_RC\" value=\"<MODEL EXPORT NOT COMPLETED SUCCESSFULLY>\\n\" />\n+ <property role=\"Xl_RC\" value=\"<MODEL EXPORT NOT COMPLETED SUCCESSFULLY>\" />\n</node>\n</node>\n</node>\n<ref role=\"3cqZAo\" node=\"72FvSoAxtfI\" resolve=\"gradleTaskOut\" />\n</node>\n<node concept=\"liA8E\" id=\"72FvSoAxKss\" role=\"2OqNvi\">\n- <ref role=\"37wK5l\" to=\"guwi:~PrintWriter.append(java.lang.CharSequence)\" resolve=\"append\" />\n+ <ref role=\"37wK5l\" to=\"guwi:~PrintWriter.println(java.lang.String)\" resolve=\"println\" />\n<node concept=\"Xl_RD\" id=\"72FvSoAxLYS\" role=\"37wK5m\">\n- <property role=\"Xl_RC\" value=\"<MODEL EXPORT COMPLETED SUCCESSFULLY>\\n\" />\n+ <property role=\"Xl_RC\" value=\"<MODEL EXPORT COMPLETED SUCCESSFULLY>\" />\n</node>\n</node>\n</node>\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | ensure messages are flushed through the socket |
426,504 | 13.04.2022 10:33:50 | -7,200 | 44b21903d0de400cc106576095355016eea721b8 | prevent single key issue in single repository to break down other repos | [
{
"change_type": "MODIFY",
"old_path": "mps/org.modelix.model.mpsplugin/models/org.modelix.model.mpsplugin.plugin.mps",
"new_path": "mps/org.modelix.model.mpsplugin/models/org.modelix.model.mpsplugin.plugin.mps",
"diff": "</node>\n</node>\n</node>\n+ <node concept=\"3J1_TO\" id=\"2oqGJZcDPE$\" role=\"3cqZAp\">\n+ <node concept=\"3uVAMA\" id=\"2oqGJZcDPR3\" role=\"1zxBo5\">\n+ <node concept=\"XOnhg\" id=\"2oqGJZcDPR4\" role=\"1zc67B\">\n+ <property role=\"TrG5h\" value=\"e\" />\n+ <node concept=\"nSUau\" id=\"2oqGJZcDPR5\" role=\"1tU5fm\">\n+ <node concept=\"3uibUv\" id=\"2oqGJZcDR8n\" role=\"nSUat\">\n+ <ref role=\"3uigEE\" to=\"wyt6:~RuntimeException\" resolve=\"RuntimeException\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbS\" id=\"2oqGJZcDPR6\" role=\"1zc67A\">\n+ <node concept=\"3SKdUt\" id=\"2oqGJZcDS0G\" role=\"3cqZAp\">\n+ <node concept=\"1PaTwC\" id=\"2oqGJZcDS0H\" role=\"1aUNEU\">\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDS0I\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"This\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDScS\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"could\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDScW\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"happen\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDSd1\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"because\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDSd7\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"of\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDSde\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"repositories\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDSec\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"in\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDSel\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"invalid\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDSfl\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"state.\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDSgm\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"In\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDSgy\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"this\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDSgJ\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"case\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDSgX\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"let's\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDShu\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"ignore\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDSi0\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"those\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDSiz\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"repositories\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDSj7\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"without\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDSm1\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"preventing\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDSmB\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"usage\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDSmW\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"of\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDSni\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"other\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDSnV\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"repositories\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3cpWs6\" id=\"2oqGJZcDSE$\" role=\"3cqZAp\">\n+ <node concept=\"3clFbT\" id=\"2oqGJZcDSFl\" role=\"3cqZAk\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbS\" id=\"2oqGJZcDPEA\" role=\"1zxBo7\">\n<node concept=\"3cpWs6\" id=\"nP6bhxQmfP\" role=\"3cqZAp\">\n<node concept=\"1Wc70l\" id=\"68ebMUMUdBS\" role=\"3cqZAk\">\n<node concept=\"37vLTw\" id=\"68ebMUMUd7x\" role=\"3uHU7B\">\n</node>\n</node>\n</node>\n+ </node>\n+ </node>\n<node concept=\"sE7Ow\" id=\"1J2iDZz_1Hs\">\n<property role=\"3GE5qa\" value=\"actions.modelserver\" />\n<property role=\"TrG5h\" value=\"Reconnect\" />\n</node>\n</node>\n</node>\n- <node concept=\"3cpWs6\" id=\"68ebMUMXx3P\" role=\"3cqZAp\">\n- <node concept=\"1Wc70l\" id=\"68ebMUMXx3Q\" role=\"3cqZAk\">\n- <node concept=\"37vLTw\" id=\"68ebMUMXx3R\" role=\"3uHU7B\">\n+ <node concept=\"3J1_TO\" id=\"2oqGJZcDT_a\" role=\"3cqZAp\">\n+ <node concept=\"3uVAMA\" id=\"2oqGJZcDT_b\" role=\"1zxBo5\">\n+ <node concept=\"XOnhg\" id=\"2oqGJZcDT_c\" role=\"1zc67B\">\n+ <property role=\"TrG5h\" value=\"e\" />\n+ <node concept=\"nSUau\" id=\"2oqGJZcDT_d\" role=\"1tU5fm\">\n+ <node concept=\"3uibUv\" id=\"2oqGJZcDT_e\" role=\"nSUat\">\n+ <ref role=\"3uigEE\" to=\"wyt6:~RuntimeException\" resolve=\"RuntimeException\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbS\" id=\"2oqGJZcDT_f\" role=\"1zc67A\">\n+ <node concept=\"3SKdUt\" id=\"2oqGJZcDT_g\" role=\"3cqZAp\">\n+ <node concept=\"1PaTwC\" id=\"2oqGJZcDT_h\" role=\"1aUNEU\">\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDT_i\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"This\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDT_j\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"could\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDT_k\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"happen\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDT_l\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"because\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDT_m\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"of\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDT_n\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"repositories\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDT_o\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"in\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDT_p\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"invalid\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDT_q\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"state.\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDT_r\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"In\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDT_s\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"this\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDT_t\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"case\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDT_u\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"let's\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDT_v\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"ignore\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDT_w\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"those\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDT_x\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"repositories\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDT_y\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"without\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDT_z\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"preventing\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDT_$\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"usage\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDT__\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"of\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDT_A\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"other\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDT_B\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"repositories\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3cpWs6\" id=\"2oqGJZcDT_C\" role=\"3cqZAp\">\n+ <node concept=\"3clFbT\" id=\"2oqGJZcDT_D\" role=\"3cqZAk\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbS\" id=\"2oqGJZcDT_E\" role=\"1zxBo7\">\n+ <node concept=\"3cpWs6\" id=\"2oqGJZcDT_F\" role=\"3cqZAp\">\n+ <node concept=\"1Wc70l\" id=\"2oqGJZcDT_G\" role=\"3cqZAk\">\n+ <node concept=\"37vLTw\" id=\"2oqGJZcDT_H\" role=\"3uHU7B\">\n<ref role=\"3cqZAo\" node=\"68ebMUMXwbj\" resolve=\"connected\" />\n</node>\n- <node concept=\"3fqX7Q\" id=\"68ebMUMXx3S\" role=\"3uHU7w\">\n- <node concept=\"2YIFZM\" id=\"68ebMUMXx3T\" role=\"3fr31v\">\n+ <node concept=\"3fqX7Q\" id=\"2oqGJZcDT_I\" role=\"3uHU7w\">\n+ <node concept=\"2YIFZM\" id=\"2oqGJZcDT_J\" role=\"3fr31v\">\n<ref role=\"1Pybhc\" to=\"csg2:i0AVAFXWm5\" resolve=\"ModelCloudImportUtils\" />\n<ref role=\"37wK5l\" to=\"csg2:68ebMUMLrp7\" resolve=\"containsModule\" />\n- <node concept=\"2OqwBi\" id=\"68ebMUMXx3U\" role=\"37wK5m\">\n- <node concept=\"2WthIp\" id=\"68ebMUMXx3V\" role=\"2Oq$k0\" />\n- <node concept=\"2BZ7hE\" id=\"68ebMUMXx3W\" role=\"2OqNvi\">\n+ <node concept=\"2OqwBi\" id=\"2oqGJZcDT_K\" role=\"37wK5m\">\n+ <node concept=\"2WthIp\" id=\"2oqGJZcDT_L\" role=\"2Oq$k0\" />\n+ <node concept=\"2BZ7hE\" id=\"2oqGJZcDT_M\" role=\"2OqNvi\">\n<ref role=\"2WH_rO\" node=\"1xehy3Sk9_8\" resolve=\"treeInRepository\" />\n</node>\n</node>\n- <node concept=\"2OqwBi\" id=\"68ebMUMXx3X\" role=\"37wK5m\">\n- <node concept=\"2WthIp\" id=\"68ebMUMXx3Y\" role=\"2Oq$k0\" />\n- <node concept=\"1DTwFV\" id=\"68ebMUMXx3Z\" role=\"2OqNvi\">\n+ <node concept=\"2OqwBi\" id=\"2oqGJZcDT_N\" role=\"37wK5m\">\n+ <node concept=\"2WthIp\" id=\"2oqGJZcDT_O\" role=\"2Oq$k0\" />\n+ <node concept=\"1DTwFV\" id=\"2oqGJZcDT_P\" role=\"2OqNvi\">\n<ref role=\"2WH_rO\" node=\"e_REOZbrU4\" resolve=\"module\" />\n</node>\n</node>\n</node>\n</node>\n</node>\n+ </node>\n+ </node>\n<node concept=\"sE7Ow\" id=\"729BXr3NNGW\">\n<property role=\"3GE5qa\" value=\"actions.node.module\" />\n<property role=\"TrG5h\" value=\"CheckoutModule\" />\n</node>\n</node>\n</node>\n- <node concept=\"3cpWs6\" id=\"68ebMUMVMwx\" role=\"3cqZAp\">\n- <node concept=\"1Wc70l\" id=\"68ebMUMVMwy\" role=\"3cqZAk\">\n- <node concept=\"37vLTw\" id=\"68ebMUMVMwz\" role=\"3uHU7B\">\n+ <node concept=\"3J1_TO\" id=\"2oqGJZcDUxt\" role=\"3cqZAp\">\n+ <node concept=\"3uVAMA\" id=\"2oqGJZcDUxu\" role=\"1zxBo5\">\n+ <node concept=\"XOnhg\" id=\"2oqGJZcDUxv\" role=\"1zc67B\">\n+ <property role=\"TrG5h\" value=\"e\" />\n+ <node concept=\"nSUau\" id=\"2oqGJZcDUxw\" role=\"1tU5fm\">\n+ <node concept=\"3uibUv\" id=\"2oqGJZcDUxx\" role=\"nSUat\">\n+ <ref role=\"3uigEE\" to=\"wyt6:~RuntimeException\" resolve=\"RuntimeException\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbS\" id=\"2oqGJZcDUxy\" role=\"1zc67A\">\n+ <node concept=\"3SKdUt\" id=\"2oqGJZcDUxz\" role=\"3cqZAp\">\n+ <node concept=\"1PaTwC\" id=\"2oqGJZcDUx$\" role=\"1aUNEU\">\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDUx_\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"This\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDUxA\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"could\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDUxB\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"happen\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDUxC\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"because\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDUxD\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"of\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDUxE\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"repositories\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDUxF\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"in\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDUxG\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"invalid\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDUxH\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"state.\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDUxI\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"In\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDUxJ\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"this\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDUxK\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"case\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDUxL\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"let's\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDUxM\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"ignore\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDUxN\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"those\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDUxO\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"repositories\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDUxP\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"without\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDUxQ\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"preventing\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDUxR\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"usage\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDUxS\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"of\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDUxT\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"other\" />\n+ </node>\n+ <node concept=\"3oM_SD\" id=\"2oqGJZcDUxU\" role=\"1PaTwD\">\n+ <property role=\"3oM_SC\" value=\"repositories\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3cpWs6\" id=\"2oqGJZcDUxV\" role=\"3cqZAp\">\n+ <node concept=\"3clFbT\" id=\"2oqGJZcDUxW\" role=\"3cqZAk\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbS\" id=\"2oqGJZcDUxX\" role=\"1zxBo7\">\n+ <node concept=\"3cpWs6\" id=\"2oqGJZcDUxY\" role=\"3cqZAp\">\n+ <node concept=\"1Wc70l\" id=\"2oqGJZcDUxZ\" role=\"3cqZAk\">\n+ <node concept=\"37vLTw\" id=\"2oqGJZcDUy0\" role=\"3uHU7B\">\n<ref role=\"3cqZAo\" node=\"68ebMUMVMwd\" resolve=\"connected\" />\n</node>\n- <node concept=\"2YIFZM\" id=\"68ebMUMVMw_\" role=\"3uHU7w\">\n+ <node concept=\"2YIFZM\" id=\"2oqGJZcDUy2\" role=\"3uHU7w\">\n<ref role=\"1Pybhc\" to=\"csg2:i0AVAFXWm5\" resolve=\"ModelCloudImportUtils\" />\n<ref role=\"37wK5l\" to=\"csg2:68ebMUMLrp7\" resolve=\"containsModule\" />\n- <node concept=\"2OqwBi\" id=\"68ebMUMVMwA\" role=\"37wK5m\">\n- <node concept=\"2WthIp\" id=\"68ebMUMVMwB\" role=\"2Oq$k0\" />\n- <node concept=\"2BZ7hE\" id=\"68ebMUMVMwC\" role=\"2OqNvi\">\n+ <node concept=\"2OqwBi\" id=\"2oqGJZcDUy3\" role=\"37wK5m\">\n+ <node concept=\"2WthIp\" id=\"2oqGJZcDUy4\" role=\"2Oq$k0\" />\n+ <node concept=\"2BZ7hE\" id=\"2oqGJZcDUy5\" role=\"2OqNvi\">\n<ref role=\"2WH_rO\" node=\"68ebMUMVMvK\" resolve=\"treeInRepository\" />\n</node>\n</node>\n- <node concept=\"2OqwBi\" id=\"68ebMUMVMwD\" role=\"37wK5m\">\n- <node concept=\"2WthIp\" id=\"68ebMUMVMwE\" role=\"2Oq$k0\" />\n- <node concept=\"1DTwFV\" id=\"68ebMUMVMwF\" role=\"2OqNvi\">\n+ <node concept=\"2OqwBi\" id=\"2oqGJZcDUy6\" role=\"37wK5m\">\n+ <node concept=\"2WthIp\" id=\"2oqGJZcDUy7\" role=\"2Oq$k0\" />\n+ <node concept=\"1DTwFV\" id=\"2oqGJZcDUy8\" role=\"2OqNvi\">\n<ref role=\"2WH_rO\" node=\"68ebMUMVMvV\" resolve=\"module\" />\n</node>\n</node>\n</node>\n</node>\n</node>\n+ </node>\n+ </node>\n</model>\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | prevent single key issue in single repository to break down other repos |
426,504 | 13.04.2022 10:52:35 | -7,200 | 392c6ebe2c9c0e4039c45a58da8287dacea8432c | wrapping exception to add informative message | [
{
"change_type": "MODIFY",
"old_path": "mps/org.modelix.model.mpsplugin/models/org.modelix.model.mpsplugin.history.mps",
"new_path": "mps/org.modelix.model.mpsplugin/models/org.modelix.model.mpsplugin.history.mps",
"diff": "</node>\n</node>\n</node>\n+ <node concept=\"3J1_TO\" id=\"4buiP$8ACfx\" role=\"3cqZAp\">\n+ <node concept=\"3uVAMA\" id=\"4buiP$8ADmH\" role=\"1zxBo5\">\n+ <node concept=\"XOnhg\" id=\"4buiP$8ADmI\" role=\"1zc67B\">\n+ <property role=\"TrG5h\" value=\"e\" />\n+ <node concept=\"nSUau\" id=\"4buiP$8ADmJ\" role=\"1tU5fm\">\n+ <node concept=\"3uibUv\" id=\"4buiP$8ADE4\" role=\"nSUat\">\n+ <ref role=\"3uigEE\" to=\"wyt6:~RuntimeException\" resolve=\"RuntimeException\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbS\" id=\"4buiP$8ADmK\" role=\"1zc67A\">\n+ <node concept=\"YS8fn\" id=\"4buiP$8AEkn\" role=\"3cqZAp\">\n+ <node concept=\"2ShNRf\" id=\"4buiP$8AECr\" role=\"YScLw\">\n+ <node concept=\"1pGfFk\" id=\"4buiP$8AJar\" role=\"2ShVmc\">\n+ <ref role=\"37wK5l\" to=\"wyt6:~RuntimeException.<init>(java.lang.String,java.lang.Throwable)\" resolve=\"RuntimeException\" />\n+ <node concept=\"3cpWs3\" id=\"4buiP$8ALtu\" role=\"37wK5m\">\n+ <node concept=\"2OqwBi\" id=\"4buiP$8AMLC\" role=\"3uHU7w\">\n+ <node concept=\"37vLTw\" id=\"4buiP$8AMej\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"6aRQr1X6W4f\" resolve=\"repositoryInfo\" />\n+ </node>\n+ <node concept=\"3TrcHB\" id=\"4buiP$8ANh6\" role=\"2OqNvi\">\n+ <ref role=\"3TsBF5\" to=\"w7di:6aRQr1WVbN6\" resolve=\"id\" />\n+ </node>\n+ </node>\n+ <node concept=\"Xl_RD\" id=\"4buiP$8AKiN\" role=\"3uHU7B\">\n+ <property role=\"Xl_RC\" value=\"Unable to initialize RepositoryTreeNode for repository with id \" />\n+ </node>\n+ </node>\n+ <node concept=\"37vLTw\" id=\"4buiP$8AJRf\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"4buiP$8ADmI\" resolve=\"e\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbS\" id=\"4buiP$8ACfz\" role=\"1zxBo7\">\n<node concept=\"3clFbF\" id=\"6aRQr1WUXnG\" role=\"3cqZAp\">\n<node concept=\"37vLTI\" id=\"6aRQr1WUXnH\" role=\"3clFbG\">\n<node concept=\"37vLTw\" id=\"6aRQr1WUXnI\" role=\"37vLTx\">\n</node>\n</node>\n</node>\n+ </node>\n+ </node>\n<node concept=\"2tJIrI\" id=\"6aRQr1X7nKG\" role=\"jymVt\" />\n<node concept=\"3clFb_\" id=\"2wwX$bJuA33\" role=\"jymVt\">\n<property role=\"TrG5h\" value=\"onRemove\" />\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | wrapping exception to add informative message |
426,496 | 13.04.2022 14:28:42 | -7,200 | 6a182c00b9f76a9769543139ff7b6f6989a5f828 | New subproject for working with git repositories stored on the server | [
{
"change_type": "MODIFY",
"old_path": ".idea/gradle.xml",
"new_path": ".idea/gradle.xml",
"diff": "<option name=\"modules\">\n<set>\n<option value=\"$PROJECT_DIR$\" />\n+ <option value=\"$PROJECT_DIR$/gitui\" />\n<option value=\"$PROJECT_DIR$/gradle-plugin\" />\n<option value=\"$PROJECT_DIR$/graphql-server\" />\n<option value=\"$PROJECT_DIR$/headless-mps\" />\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "gitui/build.gradle.kts",
"diff": "+import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar\n+\n+val ktorVersion = \"1.6.5\"\n+val kotlinCoroutinesVersion = \"1.5.2\"\n+val kotlinVersion = \"1.5.31\"\n+val logbackVersion = \"1.2.1\"\n+\n+plugins {\n+ kotlin(\"jvm\")\n+ kotlin(\"plugin.serialization\")\n+ id(\"application\")\n+ id(\"com.github.johnrengelman.shadow\") version \"6.1.0\"\n+}\n+\n+application {\n+ mainClass.set(\"io.ktor.server.netty.EngineMain\")\n+ mainClassName = \"io.ktor.server.netty.EngineMain\"\n+}\n+\n+tasks.withType<ShadowJar> {\n+ archiveVersion.set(\"latest\")\n+}\n+\n+dependencies {\n+ implementation(\"io.ktor\", \"ktor-server-core\", ktorVersion)\n+ implementation(\"io.ktor\", \"ktor-server-netty\", ktorVersion)\n+ implementation(\"ch.qos.logback\", \"logback-classic\", logbackVersion)\n+ implementation(\"org.jetbrains.kotlinx\", \"kotlinx-coroutines-jdk8\", kotlinCoroutinesVersion)\n+ implementation(\"org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2\")\n+ implementation(\"com.charleskorn.kaml:kaml:0.40.0\")\n+ implementation(\"org.eclipse.jgit:org.eclipse.jgit:5.8.0.202006091008-r\")\n+ implementation(\"org.apache.maven.shared:maven-invoker:3.1.0\")\n+ implementation(\"org.zeroturnaround:zt-zip:1.14\")\n+ implementation(\"org.apache.commons:commons-text:1.9\")\n+ implementation(\"org.jasypt:jasypt:1.9.3\")\n+ implementation(project(\":model-client\", configuration = \"jvmRuntimeElements\"))\n+ implementation(project(\":headless-mps\"))\n+ implementation(project(\":workspaces\"))\n+ implementation(\"org.modelix.mpsbuild:build-tools:1.0.0\")\n+ implementation(\"io.ktor\",\"ktor-html-builder\", ktorVersion)\n+ implementation(\"commons-codec:commons-codec:1.15\")\n+ testImplementation(\"org.junit.jupiter:junit-jupiter-api:5.6.0\")\n+ testRuntimeOnly(\"org.junit.jupiter:junit-jupiter-engine\")\n+}\n+\n+tasks.getByName<Test>(\"test\") {\n+ useJUnitPlatform()\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "gitui/src/main/kotlin/org/modelix/gitui/Application.kt",
"diff": "+/*\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+package org.modelix.gitui\n+\n+fun main(args: Array<String>): Unit = io.ktor.server.netty.EngineMain.main(args)\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "gitui/src/main/kotlin/org/modelix/gitui/GitRepository.kt",
"diff": "+package org.modelix.gitui\n+\n+import org.apache.commons.codec.digest.DigestUtils\n+import org.eclipse.jgit.api.Git\n+import org.eclipse.jgit.lib.Ref\n+import org.eclipse.jgit.revwalk.RevCommit\n+import java.io.File\n+\n+class GitRepository(val folder: File) {\n+ val id = DigestUtils.sha1Hex(folder.absolutePath)\n+ val name: String\n+ get() = folder.name\n+ private val git by lazy { Git.open(folder) }\n+\n+ fun history(): List<RevCommit> {\n+ return git.log().setSkip(0).setMaxCount(20).call().toList()\n+ }\n+\n+ fun branches(): List<Branch> {\n+ return git.branchList().call().map { Branch(it) }\n+ }\n+\n+ inner class Branch(val ref: Ref) {\n+ val shortName: String\n+ get() = ref.name.removePrefix(\"refs/heads/\")\n+ val commitHash: String\n+ get() = ref.objectId.name\n+ }\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "gitui/src/main/kotlin/org/modelix/gitui/GituiModule.kt",
"diff": "+/*\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ * https://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+package org.modelix.gitui\n+\n+import io.ktor.application.Application\n+import io.ktor.application.call\n+import io.ktor.application.install\n+import io.ktor.features.*\n+import io.ktor.html.*\n+import io.ktor.http.*\n+import io.ktor.http.content.*\n+import io.ktor.response.*\n+import io.ktor.routing.*\n+import kotlinx.html.*\n+import java.io.File\n+\n+fun Application.gituiModule() {\n+\n+ install(Routing)\n+\n+ val repositoryFolders = listOf(File(\"/Users/slisson/mps/mps203/modelix\"))\n+ val repositories = repositoryFolders.map { GitRepository(it) }.associateBy { it.id }\n+\n+ routing {\n+ get(\"/\") {\n+ call.respondHtml(HttpStatusCode.OK) {\n+ head {\n+ title(\"Git Repositories\")\n+ }\n+ body {\n+ h1 { text(\"Git Repositories\") }\n+ ul {\n+ repositories.values.forEach { repo ->\n+ li {\n+ a {\n+ href = repo.id\n+ +repo.name\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+\n+ get(\"{repositoryId}\") {\n+ val repositoryId = call.parameters[\"repositoryId\"]\n+ val repo = repositories[repositoryId]\n+ if (repo == null) {\n+ call.respondText(ContentType.Text.Plain, HttpStatusCode.NotFound) { \"Repository $repositoryId not found\" }\n+ return@get\n+ }\n+ call.respondHtml(HttpStatusCode.OK) {\n+ head {\n+ title(\"Git Repository: ${repo.name}\")\n+ script {\n+ src = \"static/gitui.js\"\n+ }\n+ }\n+ body {\n+ h1 { +\"Branches\" }\n+ div {\n+ button {\n+ id = \"showDiffButton\"\n+ onClick = \"openBranchDiff()\"\n+ disabled = true\n+ +\"Show Diff\"\n+ }\n+ }\n+ repo.branches().forEach { branch ->\n+ div {\n+ checkBoxInput {\n+ onClick = \"\"\"branchCheckboxClick(this, \"${branch.shortName}\", \"${branch.commitHash}\")\"\"\"\n+ value = branch.commitHash\n+ classes = setOf(\"branchCheckbox\")\n+ +\"${branch.shortName}: ${branch.commitHash}\"\n+ }\n+ }\n+ }\n+/*\n+ h1 { +\"Commits\" }\n+ table {\n+ thead {\n+ tr {\n+ th { +\"ID\" }\n+ th { +\"Author\" }\n+ th { +\"Committer\" }\n+ th { +\"Message\" }\n+ }\n+ }\n+ tbody {\n+ repo.history().forEach { commit ->\n+ tr {\n+ td { +commit.id.name.toString() }\n+ td {\n+ +commit.authorIdent.name.toString()\n+ br { }\n+ +commit.authorIdent.`when`.toString()\n+ }\n+ td {\n+ +commit.committerIdent.name.toString()\n+ br { }\n+ +commit.committerIdent.`when`.toString()\n+ }\n+ td {\n+ pre {\n+ +commit.fullMessage.toString()\n+ }\n+ }\n+ }\n+ }\n+ }\n+ }\n+ */\n+ }\n+ }\n+ }\n+\n+ get(\"/health\") {\n+ call.respondText(\"healthy\", ContentType.Text.Plain, HttpStatusCode.OK)\n+ }\n+\n+ static(\"static\") {\n+ resources(\"static\")\n+ }\n+ }\n+\n+ install(CORS) {\n+ anyHost()\n+ header(HttpHeaders.ContentType)\n+ method(HttpMethod.Options)\n+ method(HttpMethod.Get)\n+ method(HttpMethod.Put)\n+ method(HttpMethod.Post)\n+ }\n+}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "gitui/src/main/resources/application.conf",
"diff": "+ktor {\n+ deployment {\n+ port = 28105\n+ }\n+ application {\n+ modules = [\n+ org.modelix.gitui.GituiModuleKt.gituiModule\n+ ]\n+ }\n+}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "gitui/src/main/resources/logback.xml",
"diff": "+<configuration>\n+ <appender name=\"STDOUT\" class=\"ch.qos.logback.core.ConsoleAppender\">\n+ <encoder>\n+ <pattern>%d{YYYY-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>\n+ </encoder>\n+ </appender>\n+ <root level=\"trace\">\n+ <appender-ref ref=\"STDOUT\"/>\n+ </root>\n+ <logger name=\"org.eclipse.jetty\" level=\"INFO\"/>\n+ <logger name=\"io.netty\" level=\"INFO\"/>\n+ <logger name=\"graphql\" level=\"INFO\"/>\n+ <logger name=\"notprivacysafe.graphql\" level=\"INFO\"/>\n+</configuration>\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "gitui/src/main/resources/static/gitui.js",
"diff": "+\n+let lastCheckedBranch = null;\n+function branchCheckboxClick(checkbox, branchName, commitHash) {\n+ if (checkbox.checked) {\n+ let checkedCheckboxes = getCheckedBranchCheckboxes()\n+ if (checkedCheckboxes.length > 2) {\n+ for (let checkedCheckbox of checkedCheckboxes) {\n+ if (lastCheckedBranch !== null && lastCheckedBranch[0] === checkedCheckbox) continue;\n+ if (checkedCheckbox === checkbox) continue;\n+ checkedCheckbox.checked = false;\n+ }\n+ }\n+ lastCheckedBranch = [checkbox, branchName, commitHash];\n+ }\n+\n+ document.getElementById(\"showDiffButton\").disabled = getCheckedBranchCheckboxes().length < 2\n+}\n+\n+function getCheckedBranchCheckboxes() {\n+ let checkboxes = Array.from(document.getElementsByClassName(\"branchCheckbox\"));\n+ return checkboxes.filter(e => e.checked);\n+}\n+\n+function openBranchDiff() {\n+ let checkboxes = getCheckedBranchCheckboxes();\n+ if (checkboxes.length < 2) return;\n+ let commitHashes = checkboxes.map(e => e.value);\n+ window.open(\"diff/\" + commitHashes[0] + \"/\" + commitHashes[1] + \"/\", \"_blank\");\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "settings.gradle",
"new_path": "settings.gradle",
"diff": "@@ -14,3 +14,4 @@ include 'workspaces'\ninclude 'workspace-manager'\ninclude 'workspace-client'\ninclude 'headless-mps'\n+include 'gitui'\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | New subproject for working with git repositories stored on the server |
426,496 | 22.04.2022 13:34:00 | -7,200 | 3825b5db2089b7c1677f86f105ef325a63f635cc | Allow to choose which version is the left and which one is the right side of the diff | [
{
"change_type": "MODIFY",
"old_path": "gitui/src/main/kotlin/org/modelix/gitui/Gitui.kt",
"new_path": "gitui/src/main/kotlin/org/modelix/gitui/Gitui.kt",
"diff": "@@ -112,18 +112,24 @@ private suspend fun PipelineContext<Unit, ApplicationCall>.repoPage(repo: GitRep\n} else {\nonClick = \"\"\"openBranchDiff(\"$mpsInstanceUrl\")\"\"\"\n}\n- disabled = true\n+\"Show Diff\"\n}\n}\nrepo.branches().forEach { branch ->\ndiv {\n- checkBoxInput {\n- onClick = \"\"\"branchCheckboxClick(this, \"${branch.shortName}\", \"${branch.commitHash}\")\"\"\"\n+ radioInput {\n+ name = \"left\"\n+ //onClick = \"\"\"branchCheckboxClick(this, \"${branch.shortName}\", \"${branch.commitHash}\")\"\"\"\nvalue = branch.commitHash\n- classes = setOf(\"branchCheckbox\")\n- +\"${branch.shortName}: ${branch.commitHash}\"\n+ classes = setOf(\"branchRadio\")\n}\n+ radioInput {\n+ name = \"right\"\n+ //onClick = \"\"\"branchCheckboxClick(this, \"${branch.shortName}\", \"${branch.commitHash}\")\"\"\"\n+ value = branch.commitHash\n+ classes = setOf(\"branchRadio\")\n+ }\n+ +branch.shortName\n}\n}\n/*\n"
},
{
"change_type": "MODIFY",
"old_path": "gitui/src/main/resources/static/gitui.js",
"new_path": "gitui/src/main/resources/static/gitui.js",
"diff": "-let lastCheckedBranch = null;\n-function branchCheckboxClick(checkbox, branchName, commitHash) {\n- if (checkbox.checked) {\n- let checkedCheckboxes = getCheckedBranchCheckboxes()\n- if (checkedCheckboxes.length > 2) {\n- for (let checkedCheckbox of checkedCheckboxes) {\n- if (lastCheckedBranch !== null && lastCheckedBranch[0] === checkedCheckbox) continue;\n- if (checkedCheckbox === checkbox) continue;\n- checkedCheckbox.checked = false;\n- }\n- }\n- lastCheckedBranch = [checkbox, branchName, commitHash];\n- }\n-\n- document.getElementById(\"showDiffButton\").disabled = getCheckedBranchCheckboxes().length < 2\n-}\n-\n-function getCheckedBranchCheckboxes() {\n- let checkboxes = Array.from(document.getElementsByClassName(\"branchCheckbox\"));\n+function getCheckedBranchRadioButtons() {\n+ let checkboxes = Array.from(document.getElementsByClassName(\"branchRadio\"));\nreturn checkboxes.filter(e => e.checked);\n}\nfunction openBranchDiff(mpsInstanceUrl) {\n- let checkboxes = getCheckedBranchCheckboxes();\n- if (checkboxes.length < 2) return;\n- let commitHashes = checkboxes.map(e => e.value);\n+ let radioButtons = getCheckedBranchRadioButtons();\n+ let leftHashes = radioButtons.filter(e => e.name === \"left\").map(e => e.value);\n+ let rightHashes = radioButtons.filter(e => e.name === \"right\").map(e => e.value);\n+ if (leftHashes.length === 0 || rightHashes.length === 0) {\n+ alert(\"Choose a left and right side for the diff first.\");\n+ return;\n+ }\nif (mpsInstanceUrl === null || mpsInstanceUrl === undefined) mpsInstanceUrl = \"\";\nif (!mpsInstanceUrl.endsWith(\"/\")) mpsInstanceUrl += \"/\";\n- window.open(mpsInstanceUrl + \"diff/\" + commitHashes[0] + \"/\" + commitHashes[1] + \"/\", \"_blank\");\n+ window.open(mpsInstanceUrl + \"diff/\" + leftHashes[0] + \"/\" + rightHashes[0] + \"/\", \"_blank\");\n}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Allow to choose which version is the left and which one is the right side of the diff |
426,496 | 22.04.2022 13:46:48 | -7,200 | c488766f01781d42672293908ade8e54040a9236 | Diff URL was wrong | [
{
"change_type": "MODIFY",
"old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt",
"new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt",
"diff": "@@ -537,7 +537,7 @@ fun Application.workspaceManagerModule() {\nrepoManager.updateRepo()\n}\ncall.attributes.put(GIT_REPO_DIR_ATTRIBUTE_KEY, repoManager.repoDirectory)\n- call.attributes.put(MPS_INSTANCE_URL_ATTRIBUTE_KEY, \"../../../../workspace-${workspace.id}-$workspaceHash/ide/\")\n+ call.attributes.put(MPS_INSTANCE_URL_ATTRIBUTE_KEY, \"../../../../workspace-${workspace.id}-$workspaceHash/\")\n}\ngitui()\n}\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Diff URL was wrong |
426,496 | 22.04.2022 22:50:25 | -7,200 | 939946c1b0772641c5f926ef47bda1f731f60eaa | Styles for the shadow models based editor were broken | [
{
"change_type": "MODIFY",
"old_path": "ui-client/src/styles/base.scss",
"new_path": "ui-client/src/styles/base.scss",
"diff": "@@ -173,5 +173,4 @@ header {\n}\n@import \"header\";\n-@import \"sm\";\n@import \"NewRootNode\";\n"
},
{
"change_type": "MODIFY",
"old_path": "ui-client/src/styles/dark-theme.scss",
"new_path": "ui-client/src/styles/dark-theme.scss",
"diff": "@import \"base\";\n+@import \"sm-dark\";\nbody {\nbackground-color: #212121;\n"
},
{
"change_type": "MODIFY",
"old_path": "ui-client/src/styles/light-theme.scss",
"new_path": "ui-client/src/styles/light-theme.scss",
"diff": "@import \"base\";\n+@import \"sm-light\";\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "ui-client/src/styles/sm-dark.scss",
"diff": "+@import \"sm\";\n+\n+.smviewer {\n+ border: 1px solid #555;\n+\n+ &.connected {\n+ background-color: #424242;\n+ }\n+\n+ .sideTransformCell {\n+ background-color: #636363;\n+ border: 1px solid #7f7f7f;\n+ }\n+\n+ .placeholderText {\n+ color: #656565;\n+ }\n+\n+ .caret {\n+ border-color: #fff;\n+ }\n+\n+ .selection {\n+ border: 1px solid #aaa;\n+ background-color: rgba(255, 255, 255, 0.2);\n+ }\n+\n+ .ccmenu {\n+ background-color: #2a2a2a;\n+ border: 1px solid #888;\n+\n+ .ccSelectedEntry {\n+ background-color: #707070;\n+ }\n+ }\n+\n+ th, td {\n+ border: 1px solid #fff;\n+ }\n+}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "ui-client/src/styles/sm-light.scss",
"diff": "+@import \"sm\";\n+\n+.smviewer {\n+ color: #101010;\n+\n+ &.connected {\n+ background-color: #eee;\n+ }\n+\n+ .sideTransformCell {\n+ background-color: #636363;\n+ border: 1px solid #7f7f7f;\n+ position: absolute;\n+ }\n+\n+ .placeholderText {\n+ color: #c8c8c8;\n+ }\n+\n+ .caret {\n+ border-color: #000;\n+ }\n+\n+ .selection {\n+ border: 1px solid #aaa;\n+ background-color: rgba(255, 255, 255, 0.2);\n+ }\n+\n+ .ccmenu {\n+ background-color: #c8c8c8;\n+ border: 1px solid #888;\n+\n+ .ccSelectedEntry {\n+ background-color: #707070;\n+ }\n+ }\n+\n+ th, td {\n+ border: 1px solid #fff;\n+ }\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "ui-client/src/styles/sm.scss",
"new_path": "ui-client/src/styles/sm.scss",
"diff": "@@ -29,10 +29,6 @@ a:active {\npadding: 3px 6px;\nbackground-color: red;\n- &.connected {\n- background-color: #424242;\n- }\n-\n.relativeLayer {\nposition: absolute;\nleft: 0;\n@@ -46,18 +42,13 @@ a:active {\n}\n.sideTransformCell {\n- background-color: #636363;\n- border: 1px solid #7f7f7f;\n+ border-width: 1px;\n+ border-style: solid;\nposition: absolute;\n}\n- .placeholderText {\n- color: #656565;\n- }\n-\n.caret {\nposition: absolute;\n- border-color: #fff;\nborder-left: 2px solid;\nwidth: 3px;\nheight: 20px;\n@@ -81,23 +72,21 @@ a:active {\n}\n.selection {\n- border: 1px solid #aaa;\n+ border-width: 1px;\n+ border-style: solid;\nposition: absolute;\n- background-color: rgba(255, 255, 255, 0.2);\n}\n.ccmenu {\nposition: absolute;\n- background-color: #2a2a2a;\n- background-color: #2a2a2a;\n- border: 1px solid #888;\n+ border-width: 1px;\n+ border-style: solid;\noverflow-y: scroll;\nmax-height: 200px;\nwhite-space: nowrap;\nbox-shadow: 5px 5px 40px 0 rgba(0,0,0,0.5);\n.ccSelectedEntry {\n- background-color: #707070;\npadding: 0;\n}\n@@ -131,18 +120,8 @@ a:active {\n}\nth, td {\n- border: 1px solid #fff;\n+ border-width: 1px;\n+ border-style: solid;\npadding: 3px 6px;\n}\n}\n-\n-:focus .caret, .caret.foreign {\n- display: block;\n-}\n-\n-@keyframes blinker {\n- from { opacity: 100%; }\n- 49% { opacity: 100%; }\n- 50% { opacity: 40%; }\n- to { opacity: 40%; }\n-}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "ui-client/webpack/module.js",
"new_path": "ui-client/webpack/module.js",
"diff": "'use strict';\n+const MiniCssExtractPlugin = require(\"mini-css-extract-plugin\");\n+\nmodule.exports = {\nrules: [\n{\n@@ -15,7 +17,8 @@ module.exports = {\ntest: /\\.s[ac]ss$/,\nuse: [\n// Creates `style` nodes from JS strings\n- \"style-loader\",\n+ //\"style-loader\",\n+ MiniCssExtractPlugin.loader, // extract css into files\n// Translates CSS into CommonJS\n\"css-loader\",\n// Compiles Sass to CSS\n"
},
{
"change_type": "MODIFY",
"old_path": "ui-client/webpack/plugins.js",
"new_path": "ui-client/webpack/plugins.js",
"diff": "@@ -17,7 +17,7 @@ module.exports = [\n}),\nnew MiniCssExtractPlugin({\n- filename: '[name].css',\n- chunkFilename: '[id].css'\n+ filename: 'css/[name].css',\n+ chunkFilename: 'css/[id].css'\n})\n];\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Styles for the shadow models based editor were broken |
426,496 | 24.04.2022 10:05:35 | -7,200 | 5a441aa94bcee08fcd10a010cf6848421b4921d2 | HTML editor: Fixed missing transaction during selection handling | [
{
"change_type": "MODIFY",
"old_path": "mps/org.modelix.model.mpsplugin/models/org.modelix.model.mpsplugin.mps",
"new_path": "mps/org.modelix.model.mpsplugin/models/org.modelix.model.mpsplugin.mps",
"diff": "</node>\n</node>\n</node>\n+ <node concept=\"3eNFk2\" id=\"kpjtU4Dbws\" role=\"3eNLev\">\n+ <node concept=\"2ZW3vV\" id=\"kpjtU4Dbwt\" role=\"3eO9$A\">\n+ <node concept=\"3uibUv\" id=\"kpjtU4DNCY\" role=\"2ZW6by\">\n+ <ref role=\"3uigEE\" to=\"xxte:5gTrVpGjuLg\" resolve=\"SNodeToNodeAdapter\" />\n+ </node>\n+ <node concept=\"37vLTw\" id=\"kpjtU4Dbwv\" role=\"2ZW6bz\">\n+ <ref role=\"3cqZAo\" node=\"6gw1ikeWpSf\" resolve=\"obj\" />\n+ </node>\n+ </node>\n+ <node concept=\"3clFbS\" id=\"kpjtU4Dbww\" role=\"3eOfB_\">\n+ <node concept=\"3cpWs6\" id=\"kpjtU4Dbwx\" role=\"3cqZAp\">\n+ <node concept=\"1rXfSq\" id=\"kpjtU4Dbwy\" role=\"3cqZAk\">\n+ <ref role=\"37wK5l\" node=\"6gw1ikeWpRr\" resolve=\"extractArea\" />\n+ <node concept=\"2OqwBi\" id=\"kpjtU4DV2W\" role=\"37wK5m\">\n+ <node concept=\"1eOMI4\" id=\"kpjtU4DV2X\" role=\"2Oq$k0\">\n+ <node concept=\"10QFUN\" id=\"kpjtU4DV2Y\" role=\"1eOMHV\">\n+ <node concept=\"37vLTw\" id=\"kpjtU4DV2Z\" role=\"10QFUP\">\n+ <ref role=\"3cqZAo\" node=\"6gw1ikeWpSf\" resolve=\"obj\" />\n+ </node>\n+ <node concept=\"3uibUv\" id=\"kpjtU4DV30\" role=\"10QFUM\">\n+ <ref role=\"3uigEE\" to=\"xxte:5gTrVpGjuLg\" resolve=\"SNodeToNodeAdapter\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"liA8E\" id=\"kpjtU4DV31\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"xxte:4EhVFrZhIFH\" resolve=\"getWrapped\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n<node concept=\"3eNFk2\" id=\"6gw1ikeWpRP\" role=\"3eNLev\">\n<node concept=\"2ZW3vV\" id=\"6gw1ikeWpRQ\" role=\"3eO9$A\">\n<node concept=\"3uibUv\" id=\"6gw1ikeWrku\" role=\"2ZW6by\">\n"
},
{
"change_type": "MODIFY",
"old_path": "mps/org.modelix.ui.sm.dom/models/org.modelix.ui.sm.dom.structure.mps",
"new_path": "mps/org.modelix.ui.sm.dom/models/org.modelix.ui.sm.dom.structure.mps",
"diff": "<property role=\"EcuMT\" value=\"9002232898239389238\" />\n<property role=\"3GE5qa\" value=\"dom.htmlElement\" />\n<property role=\"TrG5h\" value=\"HTMLTableColElement\" />\n- <property role=\"34LRSv\" value=\"col\" />\n+ <property role=\"34LRSv\" value=\"td\" />\n<ref role=\"1TJDcQ\" node=\"7NImM04RGAQ\" resolve=\"HTMLElement\" />\n</node>\n<node concept=\"1TIwiD\" id=\"7NImM04TdSR\">\n"
},
{
"change_type": "MODIFY",
"old_path": "mps/org.modelix.ui.sm.server/models/org.modelix.ui.sm.server.pf.mps",
"new_path": "mps/org.modelix.ui.sm.server/models/org.modelix.ui.sm.server.pf.mps",
"diff": "<import index=\"w1kc\" ref=\"6ed54515-acc8-4d1e-a16c-9fd6cfe951ea/java:jetbrains.mps.smodel(MPS.Core/)\" />\n<import index=\"qvpu\" ref=\"cc99dce1-49f3-4392-8dbf-e22ca47bd0af/java:org.modelix.model.area(org.modelix.model.api/)\" />\n<import index=\"xxte\" ref=\"r:a79f28f8-6055-40c6-bc5e-47a42a3b97e8(org.modelix.model.mpsadapters.mps)\" />\n+ <import index=\"csg2\" ref=\"r:b0cc4f86-cf49-4ffc-b138-1f9973329ce1(org.modelix.model.mpsplugin)\" />\n<import index=\"jks5\" ref=\"cc99dce1-49f3-4392-8dbf-e22ca47bd0af/java:org.modelix.model.api(org.modelix.model.api/)\" implicit=\"true\" />\n<import index=\"v1cj\" ref=\"r:2c4bc58b-9da3-4f5f-8ea2-32f043278ab7(org.modelix.ui.sm.behavior)\" implicit=\"true\" />\n<import index=\"c17a\" ref=\"8865b7a8-5271-43d3-884c-6fd1d9cfdd34/java:org.jetbrains.mps.openapi.language(MPS.OpenAPI/)\" implicit=\"true\" />\n<child id=\"1068580123134\" name=\"parameter\" index=\"3clF46\" />\n<child id=\"1068580123135\" name=\"body\" index=\"3clF47\" />\n</concept>\n+ <concept id=\"1068580123165\" name=\"jetbrains.mps.baseLanguage.structure.InstanceMethodDeclaration\" flags=\"ig\" index=\"3clFb_\" />\n<concept id=\"1068580123152\" name=\"jetbrains.mps.baseLanguage.structure.EqualsExpression\" flags=\"nn\" index=\"3clFbC\" />\n<concept id=\"1068580123155\" name=\"jetbrains.mps.baseLanguage.structure.ExpressionStatement\" flags=\"nn\" index=\"3clFbF\">\n<child id=\"1068580123156\" name=\"expression\" index=\"3clFbG\" />\n<reference id=\"1068499141037\" name=\"baseMethodDeclaration\" index=\"37wK5l\" />\n<child id=\"1068499141038\" name=\"actualArgument\" index=\"37wK5m\" />\n</concept>\n+ <concept id=\"1212685548494\" name=\"jetbrains.mps.baseLanguage.structure.ClassCreator\" flags=\"nn\" index=\"1pGfFk\" />\n<concept id=\"1107461130800\" name=\"jetbrains.mps.baseLanguage.structure.Classifier\" flags=\"ng\" index=\"3pOWGL\">\n<child id=\"5375687026011219971\" name=\"member\" index=\"jymVt\" unordered=\"true\" />\n</concept>\n<concept id=\"1153944233411\" name=\"jetbrains.mps.baseLanguage.collections.structure.ForEachVariableReference\" flags=\"nn\" index=\"2GrUjf\">\n<reference id=\"1153944258490\" name=\"variable\" index=\"2Gs0qQ\" />\n</concept>\n+ <concept id=\"1237721394592\" name=\"jetbrains.mps.baseLanguage.collections.structure.AbstractContainerCreator\" flags=\"nn\" index=\"HWqM0\">\n+ <child id=\"1237721435808\" name=\"initValue\" index=\"HW$Y0\" />\n+ <child id=\"1237721435807\" name=\"elementType\" index=\"HW$YZ\" />\n+ </concept>\n<concept id=\"1203518072036\" name=\"jetbrains.mps.baseLanguage.collections.structure.SmartClosureParameterDeclaration\" flags=\"ig\" index=\"Rh6nW\" />\n<concept id=\"1205679737078\" name=\"jetbrains.mps.baseLanguage.collections.structure.SortOperation\" flags=\"nn\" index=\"2S7cBI\">\n<child id=\"1205679832066\" name=\"ascending\" index=\"2S7zOq\" />\n</concept>\n+ <concept id=\"1160600644654\" name=\"jetbrains.mps.baseLanguage.collections.structure.ListCreatorWithInit\" flags=\"nn\" index=\"Tc6Ow\" />\n<concept id=\"1178286324487\" name=\"jetbrains.mps.baseLanguage.collections.structure.SortDirection\" flags=\"nn\" index=\"1nlBCl\" />\n<concept id=\"1240687580870\" name=\"jetbrains.mps.baseLanguage.collections.structure.JoinOperation\" flags=\"nn\" index=\"3uJxvA\">\n<child id=\"1240687658305\" name=\"delimiter\" index=\"3uJOhx\" />\n</node>\n</node>\n</node>\n+ <node concept=\"3clFbH\" id=\"6rcGC6EyRLv\" role=\"3cqZAp\" />\n<node concept=\"3cpWs8\" id=\"57jJhouWXA\" role=\"3cqZAp\">\n<node concept=\"3cpWsn\" id=\"57jJhouWXB\" role=\"3cpWs9\">\n<property role=\"TrG5h\" value=\"viewerState\" />\n<node concept=\"3Tqbb2\" id=\"57jJhouWM5\" role=\"1tU5fm\">\n<ref role=\"ehGHo\" to=\"j481:AkkmJBMaEy\" resolve=\"ViewerState\" />\n</node>\n- <node concept=\"10Nm6u\" id=\"6rcGC6EzHfQ\" role=\"33vP2m\" />\n+ <node concept=\"2OqwBi\" id=\"cK1kRHxanR\" role=\"33vP2m\">\n+ <node concept=\"3kvyP4\" id=\"cK1kRHx8YU\" role=\"2Oq$k0\">\n+ <ref role=\"3kvyN1\" node=\"2TbqVtHt$qR\" resolve=\"o\" />\n+ </node>\n+ <node concept=\"2OwXpG\" id=\"cK1kRHxbRn\" role=\"2OqNvi\">\n+ <ref role=\"2Oxat5\" node=\"cK1kRHwQcL\" resolve=\"viewerState\" />\n+ </node>\n+ </node>\n</node>\n</node>\n+ <node concept=\"3clFbJ\" id=\"cK1kRHxedH\" role=\"3cqZAp\">\n+ <node concept=\"3clFbS\" id=\"cK1kRHxedJ\" role=\"3clFbx\">\n<node concept=\"3clFbF\" id=\"6rcGC6EyS_u\" role=\"3cqZAp\">\n<node concept=\"2YIFZM\" id=\"6rcGC6EyS_w\" role=\"3clFbG\">\n<ref role=\"37wK5l\" to=\"qsto:6gw1ikf12gp\" resolve=\"readOnStateRoots\" />\n</node>\n</node>\n</node>\n- <node concept=\"3clFbH\" id=\"6rcGC6EyRLv\" role=\"3cqZAp\" />\n+ </node>\n+ <node concept=\"3clFbC\" id=\"cK1kRHxfjJ\" role=\"3clFbw\">\n+ <node concept=\"10Nm6u\" id=\"cK1kRHxfpu\" role=\"3uHU7w\" />\n+ <node concept=\"37vLTw\" id=\"cK1kRHxfa3\" role=\"3uHU7B\">\n+ <ref role=\"3cqZAo\" node=\"57jJhouWXB\" resolve=\"viewerState\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbH\" id=\"cK1kRHxxGJ\" role=\"3cqZAp\" />\n<node concept=\"3cpWs8\" id=\"57jJhorHED\" role=\"3cqZAp\">\n<node concept=\"3cpWsn\" id=\"57jJhorHEE\" role=\"3cpWs9\">\n<property role=\"TrG5h\" value=\"viewer\" />\n<node concept=\"3Tqbb2\" id=\"57jJhorHE3\" role=\"1tU5fm\">\n<ref role=\"ehGHo\" to=\"j481:7vWAzuEMeQA\" resolve=\"Viewer\" />\n</node>\n- <node concept=\"2YIFZM\" id=\"57jJhorHEF\" role=\"33vP2m\">\n+ <node concept=\"2OqwBi\" id=\"cK1kRHxlvw\" role=\"33vP2m\">\n+ <node concept=\"3kvyP4\" id=\"cK1kRHxkCP\" role=\"2Oq$k0\">\n+ <ref role=\"3kvyN1\" node=\"2TbqVtHt$qR\" resolve=\"o\" />\n+ </node>\n+ <node concept=\"2OwXpG\" id=\"cK1kRHxmvV\" role=\"2OqNvi\">\n+ <ref role=\"2Oxat5\" node=\"cK1kRHwRXR\" resolve=\"viewer\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbJ\" id=\"cK1kRHxoRq\" role=\"3cqZAp\">\n+ <node concept=\"3clFbS\" id=\"cK1kRHxoRs\" role=\"3clFbx\">\n+ <node concept=\"3clFbF\" id=\"cK1kRHxihl\" role=\"3cqZAp\">\n+ <node concept=\"37vLTI\" id=\"cK1kRHxihn\" role=\"3clFbG\">\n+ <node concept=\"2YIFZM\" id=\"57jJhorHEF\" role=\"37vLTx\">\n<ref role=\"1Pybhc\" to=\"2qs1:6kYN8GakajA\" resolve=\"InteractionSession\" />\n<ref role=\"37wK5l\" to=\"2qs1:6rcGC6ExX9V\" resolve=\"getTransformedViewer\" />\n<node concept=\"2OqwBi\" id=\"57jJhorHEG\" role=\"37wK5m\">\n<ref role=\"3cqZAo\" node=\"57jJhouWXB\" resolve=\"viewerState\" />\n</node>\n</node>\n+ <node concept=\"37vLTw\" id=\"cK1kRHxihr\" role=\"37vLTJ\">\n+ <ref role=\"3cqZAo\" node=\"57jJhorHEE\" resolve=\"viewer\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbC\" id=\"cK1kRHxpYy\" role=\"3clFbw\">\n+ <node concept=\"10Nm6u\" id=\"cK1kRHxq49\" role=\"3uHU7w\" />\n+ <node concept=\"37vLTw\" id=\"cK1kRHxpOY\" role=\"3uHU7B\">\n+ <ref role=\"3cqZAo\" node=\"57jJhorHEE\" resolve=\"viewer\" />\n+ </node>\n</node>\n</node>\n<node concept=\"3cpWs8\" id=\"57jJhorIKu\" role=\"3cqZAp\">\n</node>\n</node>\n<node concept=\"3clFbH\" id=\"57jJhorEat\" role=\"3cqZAp\" />\n+ <node concept=\"3clFbF\" id=\"cK1kRHzYPN\" role=\"3cqZAp\">\n+ <node concept=\"2YIFZM\" id=\"cK1kRH$0Jd\" role=\"3clFbG\">\n+ <ref role=\"37wK5l\" to=\"csg2:694yVfgp24a\" resolve=\"runReadOnNodes\" />\n+ <ref role=\"1Pybhc\" to=\"csg2:694yVfgo$uu\" resolve=\"TransactionUtil\" />\n+ <node concept=\"2ShNRf\" id=\"cK1kRH$132\" role=\"37wK5m\">\n+ <node concept=\"Tc6Ow\" id=\"cK1kRH$1u3\" role=\"2ShVmc\">\n+ <node concept=\"3uibUv\" id=\"cK1kRH$b36\" role=\"HW$YZ\">\n+ <ref role=\"3uigEE\" to=\"wyt6:~Object\" resolve=\"Object\" />\n+ </node>\n+ <node concept=\"37vLTw\" id=\"cK1kRH$0Kt\" role=\"HW$Y0\">\n+ <ref role=\"3cqZAo\" node=\"57jJhouWXB\" resolve=\"viewerState\" />\n+ </node>\n+ <node concept=\"37vLTw\" id=\"cK1kRH$0Pc\" role=\"HW$Y0\">\n+ <ref role=\"3cqZAo\" node=\"57jJhorHEE\" resolve=\"viewer\" />\n+ </node>\n+ <node concept=\"37vLTw\" id=\"cK1kRH$0T8\" role=\"HW$Y0\">\n+ <ref role=\"3cqZAo\" node=\"57jJhorIKv\" resolve=\"html\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"1bVj0M\" id=\"cK1kRH$2wb\" role=\"37wK5m\">\n+ <node concept=\"3clFbS\" id=\"cK1kRH$2wd\" role=\"1bW5cS\">\n<node concept=\"3clFbF\" id=\"57jJhorD__\" role=\"3cqZAp\">\n<node concept=\"2OqwBi\" id=\"57jJhorDIH\" role=\"3clFbG\">\n<node concept=\"37vLTw\" id=\"57jJhorD_z\" role=\"2Oq$k0\">\n</node>\n</node>\n</node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n<node concept=\"3cpWs6\" id=\"57jJhorCG5\" role=\"3cqZAp\">\n<node concept=\"37vLTw\" id=\"57jJhorCGp\" role=\"3cqZAk\">\n<ref role=\"3cqZAo\" node=\"57jJhorBn5\" resolve=\"ee\" />\n<node concept=\"3Tm1VV\" id=\"6$M6y1eYF8O\" role=\"1B3o_S\" />\n<node concept=\"3Tqbb2\" id=\"57jJhorD4G\" role=\"1tU5fm\" />\n</node>\n+ <node concept=\"312cEg\" id=\"cK1kRHwQcL\" role=\"jymVt\">\n+ <property role=\"TrG5h\" value=\"viewerState\" />\n+ <property role=\"3TUv4t\" value=\"true\" />\n+ <node concept=\"3Tm1VV\" id=\"cK1kRHwQhL\" role=\"1B3o_S\" />\n+ <node concept=\"3Tqbb2\" id=\"cK1kRHwQfr\" role=\"1tU5fm\">\n+ <ref role=\"ehGHo\" to=\"j481:AkkmJBMaEy\" resolve=\"ViewerState\" />\n+ </node>\n+ </node>\n+ <node concept=\"312cEg\" id=\"cK1kRHwRXR\" role=\"jymVt\">\n+ <property role=\"TrG5h\" value=\"viewer\" />\n+ <property role=\"3TUv4t\" value=\"true\" />\n+ <node concept=\"3Tm1VV\" id=\"cK1kRHwS1v\" role=\"1B3o_S\" />\n+ <node concept=\"3Tqbb2\" id=\"cK1kRHwS10\" role=\"1tU5fm\">\n+ <ref role=\"ehGHo\" to=\"j481:7vWAzuEMeQA\" resolve=\"Viewer\" />\n+ </node>\n+ </node>\n<node concept=\"312cEg\" id=\"2CK1QGRy_sK\" role=\"jymVt\">\n<property role=\"TrG5h\" value=\"context\" />\n<property role=\"3TUv4t\" value=\"true\" />\n</node>\n</node>\n</node>\n+ <node concept=\"3clFbF\" id=\"cK1kRHwQnI\" role=\"3cqZAp\">\n+ <node concept=\"37vLTI\" id=\"cK1kRHwQLb\" role=\"3clFbG\">\n+ <node concept=\"37vLTw\" id=\"cK1kRHwQNk\" role=\"37vLTx\">\n+ <ref role=\"3cqZAo\" node=\"cK1kRHwQ1e\" resolve=\"viewerState\" />\n+ </node>\n+ <node concept=\"2OqwBi\" id=\"cK1kRHwQx7\" role=\"37vLTJ\">\n+ <node concept=\"Xjq3P\" id=\"cK1kRHwQnG\" role=\"2Oq$k0\" />\n+ <node concept=\"2OwXpG\" id=\"cK1kRHwQBY\" role=\"2OqNvi\">\n+ <ref role=\"2Oxat5\" node=\"cK1kRHwQcL\" resolve=\"viewerState\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbF\" id=\"cK1kRHwS7g\" role=\"3cqZAp\">\n+ <node concept=\"37vLTI\" id=\"cK1kRHwSxO\" role=\"3clFbG\">\n+ <node concept=\"37vLTw\" id=\"cK1kRHwSz5\" role=\"37vLTx\">\n+ <ref role=\"3cqZAo\" node=\"cK1kRHwRNA\" resolve=\"viewer\" />\n+ </node>\n+ <node concept=\"2OqwBi\" id=\"cK1kRHwSh5\" role=\"37vLTJ\">\n+ <node concept=\"Xjq3P\" id=\"cK1kRHwS7e\" role=\"2Oq$k0\" />\n+ <node concept=\"2OwXpG\" id=\"cK1kRHwSoB\" role=\"2OqNvi\">\n+ <ref role=\"2Oxat5\" node=\"cK1kRHwRXR\" resolve=\"viewer\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n<node concept=\"3clFbF\" id=\"2CK1QGRy_Ka\" role=\"3cqZAp\">\n<node concept=\"37vLTI\" id=\"2CK1QGRyA68\" role=\"3clFbG\">\n<node concept=\"37vLTw\" id=\"2CK1QGRyAj3\" role=\"37vLTx\">\n<property role=\"TrG5h\" value=\"rootNode\" />\n<node concept=\"3Tqbb2\" id=\"57jJhorD28\" role=\"1tU5fm\" />\n</node>\n+ <node concept=\"37vLTG\" id=\"cK1kRHwQ1e\" role=\"3clF46\">\n+ <property role=\"TrG5h\" value=\"viewerState\" />\n+ <node concept=\"3Tqbb2\" id=\"cK1kRHwQ6z\" role=\"1tU5fm\">\n+ <ref role=\"ehGHo\" to=\"j481:AkkmJBMaEy\" resolve=\"ViewerState\" />\n+ </node>\n+ </node>\n+ <node concept=\"37vLTG\" id=\"cK1kRHwRNA\" role=\"3clF46\">\n+ <property role=\"TrG5h\" value=\"viewer\" />\n+ <node concept=\"3Tqbb2\" id=\"cK1kRHwRSb\" role=\"1tU5fm\">\n+ <ref role=\"ehGHo\" to=\"j481:7vWAzuEMeQA\" resolve=\"Viewer\" />\n+ </node>\n+ </node>\n<node concept=\"37vLTG\" id=\"2CK1QGRy_yi\" role=\"3clF46\">\n<property role=\"TrG5h\" value=\"context\" />\n<node concept=\"3uibUv\" id=\"2CK1QGRy_D3\" role=\"1tU5fm\">\n</node>\n</node>\n<node concept=\"2tJIrI\" id=\"57jJhorCSg\" role=\"jymVt\" />\n+ <node concept=\"3clFb_\" id=\"cK1kRHwUEH\" role=\"jymVt\">\n+ <property role=\"TrG5h\" value=\"withTraceContext\" />\n+ <node concept=\"37vLTG\" id=\"cK1kRHwUS9\" role=\"3clF46\">\n+ <property role=\"TrG5h\" value=\"context\" />\n+ <node concept=\"3uibUv\" id=\"cK1kRHwUUe\" role=\"1tU5fm\">\n+ <ref role=\"3uigEE\" to=\"2uyn:41QOk3IAAeD\" resolve=\"ITraceBuilderContext\" />\n+ </node>\n+ </node>\n+ <node concept=\"3uibUv\" id=\"cK1kRHwUUU\" role=\"3clF45\">\n+ <ref role=\"3uigEE\" node=\"2TbqVtHtzck\" resolve=\"WebCellExplorerRoot\" />\n+ </node>\n+ <node concept=\"3Tm1VV\" id=\"cK1kRHwUEK\" role=\"1B3o_S\" />\n+ <node concept=\"3clFbS\" id=\"cK1kRHwUEL\" role=\"3clF47\">\n+ <node concept=\"3clFbF\" id=\"cK1kRHwUZx\" role=\"3cqZAp\">\n+ <node concept=\"2ShNRf\" id=\"cK1kRHwUZv\" role=\"3clFbG\">\n+ <node concept=\"1pGfFk\" id=\"cK1kRHwVmY\" role=\"2ShVmc\">\n+ <ref role=\"37wK5l\" node=\"2Vy1$4McibA\" resolve=\"WebCellExplorerRoot\" />\n+ <node concept=\"37vLTw\" id=\"cK1kRHwVol\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"2Vy1$4Mci68\" resolve=\"engine\" />\n+ </node>\n+ <node concept=\"37vLTw\" id=\"cK1kRHwVra\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"6$M6y1eYEZ8\" resolve=\"rootNode\" />\n+ </node>\n+ <node concept=\"37vLTw\" id=\"cK1kRHwVuP\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"cK1kRHwQcL\" resolve=\"viewerState\" />\n+ </node>\n+ <node concept=\"37vLTw\" id=\"cK1kRHwVxc\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"cK1kRHwRXR\" resolve=\"viewer\" />\n+ </node>\n+ <node concept=\"37vLTw\" id=\"cK1kRHwV_u\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"cK1kRHwUS9\" resolve=\"context\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n<node concept=\"3Tm1VV\" id=\"2TbqVtHtzcl\" role=\"1B3o_S\" />\n</node>\n</model>\n"
},
{
"change_type": "MODIFY",
"old_path": "mps/org.modelix.ui.sm.server/models/org.modelix.ui.sm.server.plugin.mps",
"new_path": "mps/org.modelix.ui.sm.server/models/org.modelix.ui.sm.server.plugin.mps",
"diff": "<import index=\"2k9e\" ref=\"6ed54515-acc8-4d1e-a16c-9fd6cfe951ea/java:jetbrains.mps.smodel.adapter.structure(MPS.Core/)\" />\n<import index=\"3d38\" ref=\"r:bc160b50-5a4e-4f99-ba07-a7b7116dab7a(de.q60.mps.incremental.util)\" implicit=\"true\" />\n<import index=\"ioq2\" ref=\"r:d5a75d6a-e56f-4c12-a58e-3acb971cef19(org.modelix.ui.state.behavior)\" implicit=\"true\" />\n+ <import index=\"tprs\" ref=\"r:00000000-0000-4000-0000-011c895904a4(jetbrains.mps.ide.actions)\" implicit=\"true\" />\n</imports>\n<registry>\n<language id=\"28f9e497-3b42-4291-aeba-0a1039153ab1\" name=\"jetbrains.mps.lang.plugin\">\n+ <concept id=\"1207145163717\" name=\"jetbrains.mps.lang.plugin.structure.ElementListContents\" flags=\"ng\" index=\"ftmFs\">\n+ <child id=\"1207145201301\" name=\"reference\" index=\"ftvYc\" />\n+ </concept>\n<concept id=\"1203071646776\" name=\"jetbrains.mps.lang.plugin.structure.ActionDeclaration\" flags=\"ng\" index=\"sE7Ow\">\n<property id=\"1205250923097\" name=\"caption\" index=\"2uzpH1\" />\n<child id=\"1203083461638\" name=\"executeFunction\" index=\"tncku\" />\n<child id=\"1217413222820\" name=\"parameter\" index=\"1NuT2Z\" />\n</concept>\n<concept id=\"1203083511112\" name=\"jetbrains.mps.lang.plugin.structure.ExecuteBlock\" flags=\"in\" index=\"tnohg\" />\n+ <concept id=\"1203087890642\" name=\"jetbrains.mps.lang.plugin.structure.ActionGroupDeclaration\" flags=\"ng\" index=\"tC5Ba\">\n+ <child id=\"1204991552650\" name=\"modifier\" index=\"2f5YQi\" />\n+ <child id=\"1207145245948\" name=\"contents\" index=\"ftER_\" />\n+ </concept>\n+ <concept id=\"1203088046679\" name=\"jetbrains.mps.lang.plugin.structure.ActionInstance\" flags=\"ng\" index=\"tCFHf\">\n+ <reference id=\"1203088061055\" name=\"action\" index=\"tCJdB\" />\n+ </concept>\n+ <concept id=\"1203092361741\" name=\"jetbrains.mps.lang.plugin.structure.ModificationStatement\" flags=\"lg\" index=\"tT9cl\">\n+ <reference id=\"1203092736097\" name=\"modifiedGroup\" index=\"tU$_T\" />\n+ </concept>\n<concept id=\"1205679047295\" name=\"jetbrains.mps.lang.plugin.structure.ActionParameterDeclaration\" flags=\"ig\" index=\"2S4$dB\" />\n<concept id=\"1206092561075\" name=\"jetbrains.mps.lang.plugin.structure.ActionParameterReferenceOperation\" flags=\"nn\" index=\"3gHZIF\" />\n<concept id=\"5538333046911348654\" name=\"jetbrains.mps.lang.plugin.structure.RequiredCondition\" flags=\"ng\" index=\"1oajcY\" />\n<node concept=\"312cEu\" id=\"6kYN8GakajA\">\n<property role=\"TrG5h\" value=\"InteractionSession\" />\n<node concept=\"2tJIrI\" id=\"6kYN8Gakarz\" role=\"jymVt\" />\n+ <node concept=\"Wx3nA\" id=\"cK1kRHx0u4\" role=\"jymVt\">\n+ <property role=\"TrG5h\" value=\"lastExplorerRoot\" />\n+ <node concept=\"3uibUv\" id=\"cK1kRHwMxS\" role=\"1tU5fm\">\n+ <ref role=\"3uigEE\" to=\"e9hv:2TbqVtHtzck\" resolve=\"WebCellExplorerRoot\" />\n+ </node>\n+ <node concept=\"3Tm1VV\" id=\"cK1kRHwMIu\" role=\"1B3o_S\" />\n+ </node>\n+ <node concept=\"2tJIrI\" id=\"cK1kRHwKZy\" role=\"jymVt\" />\n<node concept=\"312cEg\" id=\"7vWAzuERV2W\" role=\"jymVt\">\n<property role=\"TrG5h\" value=\"rootNode\" />\n<node concept=\"3Tm6S6\" id=\"7vWAzuERV2X\" role=\"1B3o_S\" />\n</node>\n</node>\n<node concept=\"3clFbS\" id=\"czMm1HvJip\" role=\"1bW5cS\">\n+ <node concept=\"3clFbF\" id=\"cK1kRH$x_Y\" role=\"3cqZAp\">\n+ <node concept=\"2YIFZM\" id=\"cK1kRH$yh8\" role=\"3clFbG\">\n+ <ref role=\"37wK5l\" to=\"csg2:6gw1ikeZo0y\" resolve=\"runReadOnNode\" />\n+ <ref role=\"1Pybhc\" to=\"csg2:694yVfgo$uu\" resolve=\"TransactionUtil\" />\n+ <node concept=\"37vLTw\" id=\"cK1kRH$yGb\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"7vWAzuERV2W\" resolve=\"rootNode\" />\n+ </node>\n+ <node concept=\"1bVj0M\" id=\"cK1kRH$ztI\" role=\"37wK5m\">\n+ <node concept=\"3clFbS\" id=\"cK1kRH$ztK\" role=\"1bW5cS\">\n<node concept=\"3cpWs8\" id=\"czMm1HvJiy\" role=\"3cqZAp\">\n<node concept=\"3cpWsn\" id=\"czMm1HvJiz\" role=\"3cpWs9\">\n<property role=\"TrG5h\" value=\"viewerState\" />\n<node concept=\"3GX2aA\" id=\"czMm1HvJiX\" role=\"2OqNvi\" />\n</node>\n</node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n<node concept=\"3cpWs6\" id=\"czMm1HvJiY\" role=\"3cqZAp\">\n<node concept=\"10M0yZ\" id=\"czMm1HvJiZ\" role=\"3cqZAk\">\n<ref role=\"3cqZAo\" to=\"v18h:~Unit.INSTANCE\" resolve=\"INSTANCE\" />\n</node>\n</node>\n</node>\n+ <node concept=\"3clFbF\" id=\"cK1kRHwNOk\" role=\"3cqZAp\">\n+ <node concept=\"37vLTI\" id=\"cK1kRHwOdX\" role=\"3clFbG\">\n+ <node concept=\"2ShNRf\" id=\"cK1kRHwOHr\" role=\"37vLTx\">\n+ <node concept=\"1pGfFk\" id=\"cK1kRHwOt8\" role=\"2ShVmc\">\n+ <ref role=\"37wK5l\" to=\"e9hv:2Vy1$4McibA\" resolve=\"WebCellExplorerRoot\" />\n+ <node concept=\"37vLTw\" id=\"cK1kRHwOY7\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"2TbqVtHnlEl\" resolve=\"engine\" />\n+ </node>\n+ <node concept=\"37vLTw\" id=\"cK1kRHwPot\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"2TbqVtHntpC\" resolve=\"rootNode\" />\n+ </node>\n+ <node concept=\"37vLTw\" id=\"cK1kRHwREE\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"3xm_oe3rQPz\" resolve=\"viewerState\" />\n+ </node>\n+ <node concept=\"37vLTw\" id=\"cK1kRHwTvq\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"6rcGC6ExywP\" resolve=\"transformed\" />\n+ </node>\n+ <node concept=\"10Nm6u\" id=\"cK1kRHwTPI\" role=\"37wK5m\" />\n+ </node>\n+ </node>\n+ <node concept=\"37vLTw\" id=\"cK1kRHwNOi\" role=\"37vLTJ\">\n+ <ref role=\"3cqZAo\" node=\"cK1kRHx0u4\" resolve=\"lastExplorerRoot\" />\n+ </node>\n+ </node>\n+ </node>\n<node concept=\"3cpWs6\" id=\"3xm_oe3rQPQ\" role=\"3cqZAp\">\n<node concept=\"3clFbT\" id=\"3xm_oe3rQPR\" role=\"3cqZAk\" />\n</node>\n<property role=\"2uzpH1\" value=\"Web Cell Explorer\" />\n<node concept=\"tnohg\" id=\"2TbqVtHk$L1\" role=\"tncku\">\n<node concept=\"3clFbS\" id=\"2TbqVtHk$L2\" role=\"2VODD2\">\n+ <node concept=\"3cpWs8\" id=\"cK1kRHx1uU\" role=\"3cqZAp\">\n+ <node concept=\"3cpWsn\" id=\"cK1kRHx1uV\" role=\"3cpWs9\">\n+ <property role=\"TrG5h\" value=\"explorerRoot\" />\n+ <node concept=\"3uibUv\" id=\"cK1kRHx1qd\" role=\"1tU5fm\">\n+ <ref role=\"3uigEE\" to=\"e9hv:2TbqVtHtzck\" resolve=\"WebCellExplorerRoot\" />\n+ </node>\n+ <node concept=\"10M0yZ\" id=\"cK1kRHx1uW\" role=\"33vP2m\">\n+ <ref role=\"3cqZAo\" node=\"cK1kRHx0u4\" resolve=\"lastExplorerRoot\" />\n+ <ref role=\"1PxDUh\" node=\"6kYN8GakajA\" resolve=\"InteractionSession\" />\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbJ\" id=\"cK1kRHx1Hh\" role=\"3cqZAp\">\n+ <node concept=\"3clFbS\" id=\"cK1kRHx1Hj\" role=\"3clFbx\">\n<node concept=\"3cpWs8\" id=\"2TbqVtHnPmm\" role=\"3cqZAp\">\n<node concept=\"3cpWsn\" id=\"2TbqVtHnPmn\" role=\"3cpWs9\">\n<property role=\"TrG5h\" value=\"engine\" />\n</node>\n</node>\n</node>\n+ <node concept=\"3clFbF\" id=\"cK1kRHx2eb\" role=\"3cqZAp\">\n+ <node concept=\"37vLTI\" id=\"cK1kRHx2zu\" role=\"3clFbG\">\n+ <node concept=\"37vLTw\" id=\"cK1kRHx2e9\" role=\"37vLTJ\">\n+ <ref role=\"3cqZAo\" node=\"cK1kRHx1uV\" resolve=\"explorerRoot\" />\n+ </node>\n+ <node concept=\"2ShNRf\" id=\"cK1kRHx2$8\" role=\"37vLTx\">\n+ <node concept=\"1pGfFk\" id=\"cK1kRHx2$9\" role=\"2ShVmc\">\n+ <ref role=\"37wK5l\" to=\"e9hv:2Vy1$4McibA\" resolve=\"WebCellExplorerRoot\" />\n+ <node concept=\"37vLTw\" id=\"cK1kRHx2$a\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"2TbqVtHnPmn\" resolve=\"engine\" />\n+ </node>\n+ <node concept=\"2OqwBi\" id=\"cK1kRHx2$b\" role=\"37wK5m\">\n+ <node concept=\"2WthIp\" id=\"cK1kRHx2$c\" role=\"2Oq$k0\" />\n+ <node concept=\"3gHZIF\" id=\"cK1kRHx2$d\" role=\"2OqNvi\">\n+ <ref role=\"2WH_rO\" node=\"2TbqVtHnAdC\" resolve=\"node\" />\n+ </node>\n+ </node>\n+ <node concept=\"10Nm6u\" id=\"cK1kRHx2R_\" role=\"37wK5m\" />\n+ <node concept=\"10Nm6u\" id=\"cK1kRHx2Vg\" role=\"37wK5m\" />\n+ <node concept=\"37vLTw\" id=\"cK1kRHx2$e\" role=\"37wK5m\">\n+ <ref role=\"3cqZAo\" node=\"2CK1QGREN10\" resolve=\"context\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"3clFbC\" id=\"cK1kRHx204\" role=\"3clFbw\">\n+ <node concept=\"10Nm6u\" id=\"cK1kRHx268\" role=\"3uHU7w\" />\n+ <node concept=\"37vLTw\" id=\"cK1kRHx1O2\" role=\"3uHU7B\">\n+ <ref role=\"3cqZAo\" node=\"cK1kRHx1uV\" resolve=\"explorerRoot\" />\n+ </node>\n+ </node>\n+ <node concept=\"9aQIb\" id=\"cK1kRHx2YU\" role=\"9aQIa\">\n+ <node concept=\"3clFbS\" id=\"cK1kRHx2YV\" role=\"9aQI4\">\n+ <node concept=\"3clFbF\" id=\"cK1kRHwZV8\" role=\"3cqZAp\">\n+ <node concept=\"37vLTI\" id=\"cK1kRHx3fI\" role=\"3clFbG\">\n+ <node concept=\"2OqwBi\" id=\"cK1kRHx3vW\" role=\"37vLTx\">\n+ <node concept=\"37vLTw\" id=\"cK1kRHx3pQ\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"cK1kRHx1uV\" resolve=\"explorerRoot\" />\n+ </node>\n+ <node concept=\"liA8E\" id=\"cK1kRHx3Il\" role=\"2OqNvi\">\n+ <ref role=\"37wK5l\" to=\"e9hv:cK1kRHwUEH\" resolve=\"withTraceContext\" />\n+ <node concept=\"2ShNRf\" id=\"cK1kRHx3Jj\" role=\"37wK5m\">\n+ <node concept=\"1pGfFk\" id=\"cK1kRHx6bO\" role=\"2ShVmc\">\n+ <ref role=\"37wK5l\" to=\"j81n:2TbqVtHo4a3\" resolve=\"TraceBuilderContext\" />\n+ <node concept=\"2OqwBi\" id=\"cK1kRHx6mQ\" role=\"37wK5m\">\n+ <node concept=\"37vLTw\" id=\"cK1kRHx6f5\" role=\"2Oq$k0\">\n+ <ref role=\"3cqZAo\" node=\"cK1kRHx1uV\" resolve=\"explorerRoot\" />\n+ </node>\n+ <node concept=\"2OwXpG\" id=\"cK1kRHx6DK\" role=\"2OqNvi\">\n+ <ref role=\"2Oxat5\" to=\"e9hv:2Vy1$4Mci68\" resolve=\"engine\" />\n+ </node>\n+ </node>\n+ <node concept=\"2OqwBi\" id=\"cK1kRHx6In\" role=\"37wK5m\">\n+ <node concept=\"2WthIp\" id=\"cK1kRHx6Iq\" role=\"2Oq$k0\" />\n+ <node concept=\"1DTwFV\" id=\"cK1kRHx6Is\" role=\"2OqNvi\">\n+ <ref role=\"2WH_rO\" node=\"2TbqVtHkEwU\" resolve=\"project\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ <node concept=\"37vLTw\" id=\"cK1kRHx1uX\" role=\"37vLTJ\">\n+ <ref role=\"3cqZAo\" node=\"cK1kRHx1uV\" resolve=\"explorerRoot\" />\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n+ </node>\n<node concept=\"3clFbF\" id=\"2TbqVtHkFpg\" role=\"3cqZAp\">\n<node concept=\"2OqwBi\" id=\"2TbqVtHkF$v\" role=\"3clFbG\">\n<node concept=\"2OqwBi\" id=\"2TbqVtHkFpi\" role=\"2Oq$k0\">\n</node>\n<node concept=\"2XshWL\" id=\"2TbqVtHkFMr\" role=\"2OqNvi\">\n<ref role=\"2WH_rO\" to=\"nw4f:7POzUCriZua\" resolve=\"loadTrace\" />\n- <node concept=\"2ShNRf\" id=\"2TbqVtHnSBx\" role=\"2XxRq1\">\n- <node concept=\"1pGfFk\" id=\"2TbqVtHnSBy\" role=\"2ShVmc\">\n- <ref role=\"37wK5l\" to=\"e9hv:2Vy1$4McibA\" resolve=\"WebCellExplorerRoot\" />\n- <node concept=\"37vLTw\" id=\"2TbqVtHnSBz\" role=\"37wK5m\">\n- <ref role=\"3cqZAo\" node=\"2TbqVtHnPmn\" resolve=\"engine\" />\n- </node>\n- <node concept=\"2OqwBi\" id=\"57jJhoveFU\" role=\"37wK5m\">\n- <node concept=\"2WthIp\" id=\"57jJhoveFX\" role=\"2Oq$k0\" />\n- <node concept=\"3gHZIF\" id=\"57jJhoveFZ\" role=\"2OqNvi\">\n- <ref role=\"2WH_rO\" node=\"2TbqVtHnAdC\" resolve=\"node\" />\n- </node>\n- </node>\n- <node concept=\"37vLTw\" id=\"2TbqVtHnSB_\" role=\"37wK5m\">\n- <ref role=\"3cqZAo\" node=\"2CK1QGREN10\" resolve=\"context\" />\n- </node>\n- </node>\n+ <node concept=\"37vLTw\" id=\"cK1kRHx73K\" role=\"2XxRq1\">\n+ <ref role=\"3cqZAo\" node=\"cK1kRHx1uV\" resolve=\"explorerRoot\" />\n</node>\n<node concept=\"Xl_RD\" id=\"2TbqVtHkG2i\" role=\"2XxRq1\">\n<property role=\"Xl_RC\" value=\"Web View Models\" />\n</node>\n</node>\n</node>\n+ <node concept=\"tC5Ba\" id=\"cK1kRHuFNp\">\n+ <property role=\"TrG5h\" value=\"WebCellExplorerGroup\" />\n+ <node concept=\"ftmFs\" id=\"cK1kRHuFO$\" role=\"ftER_\">\n+ <node concept=\"tCFHf\" id=\"cK1kRHuFPJ\" role=\"ftvYc\">\n+ <ref role=\"tCJdB\" node=\"2TbqVtHk$L0\" resolve=\"WebCellExplorer\" />\n+ </node>\n+ </node>\n+ <node concept=\"tT9cl\" id=\"cK1kRHuFQU\" role=\"2f5YQi\">\n+ <ref role=\"tU$_T\" to=\"tprs:1GlxrIveqTo\" resolve=\"DebugActions\" />\n+ </node>\n+ </node>\n</model>\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | HTML editor: Fixed missing transaction during selection handling |
426,496 | 25.04.2022 10:40:20 | -7,200 | fdf56577fc68da03937bcef2790c2d97a6f3a892 | Button for deleting uploads | [
{
"change_type": "MODIFY",
"old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManager.kt",
"new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManager.kt",
"diff": "@@ -123,6 +123,13 @@ class WorkspaceManager {\nfun getUploadFolder(id: String) = File(getUploadsFolder(), id)\n+ fun deleteUpload(id: String) {\n+ val folder = getUploadFolder(id)\n+ if (folder.exists()) {\n+ folder.deleteRecursively()\n+ }\n+ }\n+\nprivate fun buildWorkspaceDownloadFile(job: WorkspaceBuildJob): File {\nval workspace = job.workspace\nval downloadFile = job.downloadFile\n"
},
{
"change_type": "MODIFY",
"old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt",
"new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt",
"diff": "@@ -309,6 +309,20 @@ fun Application.workspaceManagerModule() {\n}\n}\n}\n+ td {\n+ form {\n+ action = \"./delete-upload\"\n+ method = FormMethod.post\n+ hiddenInput {\n+ name = \"uploadId\"\n+ value = upload.key\n+ }\n+ submitInput {\n+ style = \"background-color: red\"\n+ value = \"Delete\"\n+ }\n+ }\n+ }\n}\n}\n}\n@@ -516,6 +530,17 @@ fun Application.workspaceManagerModule() {\ncall.respondRedirect(\"./edit\")\n}\n+ post(\"{workspaceId}/delete-upload\") {\n+ val uploadId = call.receiveParameters()[\"uploadId\"]!!\n+ val allWorkspaces = manager.getWorkspaceIds().mapNotNull { manager.getWorkspaceForId(it)?.first }\n+ for (workspace in allWorkspaces.filter { it.uploads.contains(uploadId) }) {\n+ workspace.uploads -= uploadId\n+ manager.update(workspace)\n+ }\n+ manager.deleteUpload(uploadId)\n+ call.respondRedirect(\"./edit\")\n+ }\n+\nroute(\"{workspaceId}/git/{repoIndex}/\") {\nintercept(ApplicationCallPipeline.Call) {\nval workspaceId = call.parameters[\"workspaceId\"]!!\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Button for deleting uploads |
426,496 | 25.04.2022 10:56:10 | -7,200 | e66182b7648dc90fe8515041837fe61d13d56d27 | Button for deleting workspaces | [
{
"change_type": "MODIFY",
"old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManager.kt",
"new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManager.kt",
"diff": "@@ -334,5 +334,6 @@ class WorkspaceManager {\nfun getWorkspaceForId(workspaceId: String) = workspacePersistence.getWorkspaceForId(workspaceId)\nfun getWorkspaceForHash(workspaceHash: WorkspaceHash) = workspacePersistence.getWorkspaceForHash(workspaceHash)\nfun newWorkspace() = workspacePersistence.newWorkspace()\n+ fun removeWorkspace(workspaceId: String) = workspacePersistence.removeWorkspace(workspaceId)\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt",
"new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt",
"diff": "@@ -55,15 +55,29 @@ fun Application.workspaceManagerModule() {\n+\"A workspace allows to deploy an MPS project and all of its dependencies to Modelix and edit it in the browser.\"\n+\"Solutions are synchronized with the model server and between all MPS instances.\"\n}\n- ul {\n+ table {\nmanager.getWorkspaceIds().forEach { workspaceId ->\nval workspace = manager.getWorkspaceForId(workspaceId)?.first\n- li {\n+ tr {\n+ td {\na {\nhref = \"$workspaceId/edit\"\ntext((workspace?.name ?: \"<no name>\") + \" ($workspaceId)\")\n}\n}\n+ td {\n+ postForm(\"./remove-workspace\") {\n+ style = \"display: inline-block\"\n+ hiddenInput {\n+ name = \"workspaceId\"\n+ value = workspaceId\n+ }\n+ submitInput {\n+ value = \"Remove\"\n+ }\n+ }\n+ }\n+ }\n}\n}\nform {\n@@ -541,6 +555,12 @@ fun Application.workspaceManagerModule() {\ncall.respondRedirect(\"./edit\")\n}\n+ post(\"remove-workspace\") {\n+ val workspaceId = call.receiveParameters()[\"workspaceId\"]!!\n+ manager.removeWorkspace(workspaceId)\n+ call.respondRedirect(\".\")\n+ }\n+\nroute(\"{workspaceId}/git/{repoIndex}/\") {\nintercept(ApplicationCallPipeline.Call) {\nval workspaceId = call.parameters[\"workspaceId\"]!!\n"
},
{
"change_type": "MODIFY",
"old_path": "workspaces/src/main/kotlin/org/modelix/workspaces/WorkspacePersistence.kt",
"new_path": "workspaces/src/main/kotlin/org/modelix/workspaces/WorkspacePersistence.kt",
"diff": "@@ -48,6 +48,11 @@ class WorkspacePersistence {\nreturn workspace\n}\n+ @Synchronized\n+ fun removeWorkspace(workspaceId: String) {\n+ setWorkspaceIds(getWorkspaceIds() - workspaceId)\n+ }\n+\nprivate fun key(workspaceId: String) = \"workspace-$workspaceId\"\nfun getWorkspaceForId(id: String): Pair<Workspace, WorkspaceHash>? {\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Button for deleting workspaces |
426,496 | 25.04.2022 11:29:25 | -7,200 | 1a07c04d5453d82aeeeb3c486dc7e58356a16791 | Show links to open the UI on the workspace list page
Avoids navigating to the edit page first. | [
{
"change_type": "MODIFY",
"old_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt",
"new_path": "workspace-manager/src/main/kotlin/org/modelix/workspace/manager/WorkspaceManagerModule.kt",
"diff": "@@ -48,6 +48,17 @@ fun Application.workspaceManagerModule() {\ncall.respondHtml(HttpStatusCode.OK) {\nhead {\ntitle(\"Workspaces\")\n+ style {\n+ +\"\"\"\n+ table {\n+ border-collapse: collapse;\n+ }\n+ td {\n+ border: 1px solid #888;\n+ padding: 3px 12px;\n+ }\n+ \"\"\".trimIndent()\n+ }\n}\nbody {\nh1 { text(\"Workspaces\") }\n@@ -56,8 +67,9 @@ fun Application.workspaceManagerModule() {\n+\" Solutions are synchronized with the model server and between all MPS instances.\"\n}\ntable {\n- manager.getWorkspaceIds().forEach { workspaceId ->\n- val workspace = manager.getWorkspaceForId(workspaceId)?.first\n+ manager.getWorkspaceIds().mapNotNull { manager.getWorkspaceForId(it) }.forEach { workspaceAndHash ->\n+ val (workspace, workspaceHash) = workspaceAndHash\n+ val workspaceId = workspace.id\ntr {\ntd {\na {\n@@ -65,6 +77,27 @@ fun Application.workspaceManagerModule() {\ntext((workspace?.name ?: \"<no name>\") + \" ($workspaceId)\")\n}\n}\n+ td {\n+ a {\n+ href = \"../workspace-${workspace.id}-$workspaceHash/project\"\n+ text(\"Open Web Interface\")\n+ }\n+ }\n+ td {\n+ a {\n+ href = \"../workspace-${workspace.id}-$workspaceHash/ide/\"\n+ text(\"Open MPS\")\n+ }\n+ }\n+ td {\n+ workspace.gitRepositories.forEachIndexed { index, gitRepository ->\n+ a {\n+ href = \"$workspaceId/git/$index/\"\n+ val suffix = if (gitRepository.name.isNullOrEmpty()) \"\" else \" (${gitRepository.name})\"\n+ text(\"Git History\" + suffix)\n+ }\n+ }\n+ }\ntd {\npostForm(\"./remove-workspace\") {\nstyle = \"display: inline-block\"\n@@ -79,7 +112,9 @@ fun Application.workspaceManagerModule() {\n}\n}\n}\n- }\n+ tr {\n+ td {\n+ colSpan = \"5\"\nform {\naction = \"new\"\nmethod = FormMethod.post\n@@ -91,6 +126,9 @@ fun Application.workspaceManagerModule() {\n}\n}\n}\n+ }\n+ }\n+ }\npost(\"new\") {\nval workspace = manager.newWorkspace()\n"
}
]
| Kotlin | Apache License 2.0 | modelix/modelix | Show links to open the UI on the workspace list page
Avoids navigating to the edit page first. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.