From 79b1fb882b9b8125c4465a0db214fa6a437fc240 Mon Sep 17 00:00:00 2001 From: Alexander Pann Date: Tue, 10 Sep 2024 08:51:09 +0200 Subject: [PATCH] restore the old build script --- build.gradle | 587 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 440 insertions(+), 147 deletions(-) diff --git a/build.gradle b/build.gradle index ece5ebd..ce06638 100644 --- a/build.gradle +++ b/build.gradle @@ -1,109 +1,104 @@ -import de.itemis.mps.gradle.* -import de.itemis.mps.gradle.downloadJBR.* -import de.itemis.mps.gradle.tasks.* - plugins { id 'de.itemis.mps.gradle.common' version '1.28.0.+' - id 'download-jbr' version '1.28.0.+' - id 'base' + id "com.github.breadmoirai.github-release" version "2.5.2" id 'maven-publish' - id 'co.riiid.gradle' version '0.4.2' - - id 'de.itemis.mps.gradle.launcher' version '2.2.0.+' + id 'base' + id 'de.itemis.mps.gradle.launcher' version '2.4.2.+' } -ext.jbrVers = '17.0.6-b653.34' +import de.itemis.mps.gradle.* +import de.itemis.mps.gradle.tasks.MpsMigrate +import de.itemis.mps.gradle.tasks.Remigrate +import de.itemis.mps.gradle.downloadJBR.DownloadJbrForPlatform +import groovy.xml.XmlSlurper + +import java.time.LocalDateTime + +apply plugin: 'download-jbr' downloadJbr { - jbrVersion = jbrVers + jbrVersion = '17.0.8.1-b1000.32' } // detect if we are in a CI build -if (System.env.CI != null && System.env.CI.toBoolean()) { - // is this github +if (project.hasProperty("forceCI")) { ext.ciBuild = true } else { - // on teamcity we are in a CI build - ext.ciBuild = project.hasProperty("teamcity") -} - -// Detect jdk location, required to start ant with tools.jar on classpath otherwise javac and tests will fail -String jdk_home - -if (ext.has('java11_home')) { - jdk_home = ext.get('java11_home') -} else if (System.getenv('JB_JAVA11_HOME') != null) { - jdk_home = System.getenv('JB_JAVA11_HOME') -} else { - def expected = JavaVersion.VERSION_11 - if (JavaVersion.current() != expected) { - throw new GradleException("This build script requires Java 11 but you are currently using ${JavaVersion.current()}.\nWhat you can do:\n" - + " * Use project property java11_home to point to the Java 11 JDK.\n" - + " * Use environment variable JB_JAVA11_HOME to point to the Java 11 JDK\n" - + " * Run Gradle using Java 11") + //on teamcity we are in a CI build + if (project.hasProperty("teamcity") && !project.hasProperty('mpsHomeDir')) { + ext.ciBuild = true + } else { + ext.ciBuild = false } - jdk_home = System.getProperty('java.home') } -// Check JDK location -if (!new File(jdk_home, "lib").exists()) { - throw new GradleException("Unable to locate JDK home folder. Detected folder is: $jdk_home") +// Default repository credentials +if (!project.hasProperty('nexusUsername')) { + ext.nexusUsername = '' + ext.nexusPassword = '' } - -logger.info 'Using JDK at {}', jdk_home - -ext.jdk_home = jdk_home - -ext.dependencyRepositories = [ - 'https://maven.pkg.github.com/mbeddr/*', - 'https://artifacts.itemis.cloud/repository/maven-mps/' -] +logger.info 'Repository username: {}', project.nexusUsername // Dependency versions -ext.mpsVersion = '2022.3.2' -// Project versions -ext.major = '2022' -ext.minor = '3' +// major version, e.g. '2021.1', '2021.2' +ext.mpsMajor = '2023.2' +// optional minor/bugfix number (not added to the final build version) +ext.mpsMinor = '1' +// e.g. Beta, EAP, RC +ext.mpsReleaseType = '' + +def appendOpt = { str,pre -> !str.isEmpty() ? "${pre}${str}" : "" } +ext.mpsVersion = "$mpsMajor" + appendOpt(mpsMinor, '.') + appendOpt(mpsReleaseType, '-') if (ciBuild) { String branch = GitBasedVersioning.gitBranch - def buildNumber = System.env.GITHUB_RUN_NUMBER != null ? System.env.GITHUB_RUN_NUMBER.toInteger() : System.env.BUILD_NUMBER.toInteger() - if (branch.startsWith("maintenance") || branch.startsWith("mps")) { - version = "$major.$minor.$buildNumber.${GitBasedVersioning.gitShortCommitHash}" + + def buildMajor = mpsMajor.split("\\.").first() + def buildMinor = mpsMajor.split("\\.").last() + def buildNumber = System.env.BUILD_NUMBER.toInteger() + if (branch.matches(/(maintenance|mps)[\/-](mps)?\d+(\.\d+)*/)) { + version = "$buildMajor.$buildMinor.$buildNumber.${GitBasedVersioning.gitShortCommitHash}" } else { - version = GitBasedVersioning.getVersionWithCount(major, minor, buildNumber) + def isSnapshot = !(branch.equals("master")) + version = GitBasedVersioning.getVersionWithCount(buildMajor, buildMinor, buildNumber) + (isSnapshot ? "-SNAPSHOT" : "") } println "##teamcity[buildNumber '${version}']" } else { - println "Local build detected, version will be SNAPSHOT" - version = "$major.$minor-SNAPSHOT" + version = ext.mpsMajor + appendOpt(ext.mpsMinor , '.') + "-SNAPSHOT" + println "Local build detected, version will be $version" +} + +def userHome = System.properties['user.home'] +def mpsPluginsDirPattern +if (System.properties['os.name'].toLowerCase().contains('mac')) { + mpsPluginsDirPattern = "$userHome/Library/Application Support/%s" +} else { + mpsPluginsDirPattern = "$userHome/.%s/config/plugins" +} + +if (project.hasProperty("MPS_PATHS_SELECTOR")) { + ext.mpsPluginsDir = sprintf(mpsPluginsDirPattern, project.getProperty("MPS_PATHS_SELECTOR")) +} else { + ext.mpsPluginsDir = sprintf(mpsPluginsDirPattern, "MPS$mpsMajor") } +ext.releaseRepository = 'https://artifacts.itemis.cloud/repository/maven-mps-releases/' +ext.snapshotRepository = 'https://artifacts.itemis.cloud/repository/maven-mps-snapshots/' +ext.publishingRepository = version.toString().endsWith("-SNAPSHOT") ? snapshotRepository : releaseRepository + + configurations { mps - languageLibs - // includes also junit tasks support - antLib } dependencies { mps "com.jetbrains:mps:$mpsVersion" - antLib "org.apache.ant:ant-junit:1.10.6" } repositories { - for (repoUrl in project.dependencyRepositories) { - maven { - url repoUrl - credentials { - username = project.findProperty("github_username") ?: System.getenv("GITHUB_ACTOR") - password = project.findProperty("github_token") ?: System.getenv("GITHUB_TOKEN") - } - } - } - mavenCentral() + maven { url 'https://artifacts.itemis.cloud/repository/maven-mps/' } } ext.skipResolveMps = project.hasProperty('mpsHomeDir') @@ -117,7 +112,7 @@ if (project.skipResolveMps) { } } } else { - task resolveMps(type: Sync) { + task resolveMps(type: Copy) { dependsOn configurations.mps from { configurations.mps.resolve().collect { zipTree(it) } @@ -126,93 +121,331 @@ if (project.skipResolveMps) { } } -// tools needed for compiler support in ant calls -ext.buildScriptClasspath = project.configurations.antLib.fileCollection { true } + - project.files("$project.jdk_home/lib/tools.jar") +// -------- Model API ---------------------- -def artifactsDir = file("$buildDir/artifacts") -def dependenciesDir = file("$buildDir/dependencies") +configurations { + modelApi +} + +dependencies { + def modelixCoreVersion = "2.1.9" + modelApi("org.modelix:model-api:$modelixCoreVersion") +} +task copyModelApi() { + dependsOn configurations.modelApi + doLast { + // copy transitive dependencies without version in the file name + // otherwise each new version would require a change of the MPS solution + def libFolder = file("$projectDir/code/model-api/org.modelix.model.api/lib") + libFolder.deleteDir() + libFolder.mkdir() + def versionsFile = file("$libFolder/versions.txt") + for (final def artifact in configurations.modelApi.resolvedConfiguration.resolvedArtifacts) { + // these libs are part of MPS + if ( + artifact.moduleVersion.id.name.startsWith("log4j") + || artifact.moduleVersion.id.name.startsWith("annotations") + || artifact.moduleVersion.id.name.startsWith("slf4j-api") + + ) { + versionsFile.append("already part of mps: " + artifact.file.name + "\n") + continue + } + + def sourceFile = java.nio.file.Path.of(artifact.file.absolutePath) + def targetFile = java.nio.file.Path.of(libFolder.absolutePath).resolve(artifact.moduleVersion.id.name + "." + artifact.extension) + java.nio.file.Files.copy(sourceFile, targetFile) + versionsFile.append(artifact.file.name + "\n") + } + } +} + +// ----------------------------------------- + + +configurations { + ant_lib + diagram_lib { + exclude(group: 'com.google.guava') + attributes.attribute(Attribute.of('org.gradle.jvm.environment', String), 'standard-jvm') + } + batik { + exclude(group: 'xml-apis') + exclude(group: 'commons-io') + exclude(group: 'commons-logging') + } +} + +dependencies { + ant_lib "org.apache.ant:ant-junit:1.10.14" + + def elkVersion = "0.9.1" + diagram_lib ("org.eclipse.elk:org.eclipse.elk.alg.common:$elkVersion") + diagram_lib ("org.eclipse.elk:org.eclipse.elk.alg.layered:$elkVersion") + diagram_lib ("org.eclipse.elk:org.eclipse.elk.alg.mrtree:$elkVersion") + diagram_lib ("org.eclipse.elk:org.eclipse.elk.alg.radial:$elkVersion") + diagram_lib ("org.eclipse.elk:org.eclipse.elk.alg.force:$elkVersion") + diagram_lib ("org.eclipse.elk:org.eclipse.elk.alg.disco:$elkVersion") + diagram_lib ("org.eclipse.elk:org.eclipse.elk.alg.rectpacking:$elkVersion") + diagram_lib ("org.eclipse.elk:org.eclipse.elk.alg.spore:$elkVersion") + diagram_lib ("org.eclipse.elk:org.eclipse.elk.alg.topdownpacking:$elkVersion") + diagram_lib ("org.eclipse.elk:org.eclipse.elk.core:$elkVersion") + diagram_lib ("org.eclipse.elk:org.eclipse.elk.graph:$elkVersion") + diagram_lib ("org.eclipse.emf:org.eclipse.emf.common:2.30.0") + diagram_lib ("org.eclipse.emf:org.eclipse.emf.ecore:2.36.0") + diagram_lib ("org.eclipse.emf:org.eclipse.emf.ecore.xmi:2.37.0") + + batik ("org.apache.xmlgraphics:batik-svggen:1.17") + batik ("org.apache.xmlgraphics:batik-dom:1.17") +} + + +ext.buildScriptClasspath = project.configurations.ant_lib.fileCollection({ + true +}) + +def artifactsDir = new File(rootDir, 'artifacts') + + +ext.mps_home = '-Dmps.home=' + mpsHomeDir.getAbsolutePath() +ext.build_dir = '-Dbuild.dir=' + file(rootProject.projectDir.absolutePath).getAbsolutePath() +ext.artifacts_dir = '-Dartifacts.root=' + artifactsDir +ext.pluginVersion = "-DversionNumber=" + version +ext.buildDate = "-DbuildDate=" + new Date().toString() +ext.extensions_home = '-Dextensions.home=' + rootDir // ___________________ utilities ___________________ +File scriptFile(String relativePath) { + new File("$rootDir/build/generated/$relativePath") +} -def defaultScriptArgs = [ - 'mps.home' : mpsHomeDir, - 'mps_home' : mpsHomeDir, - 'build.jna.library.path' : new File(mpsHomeDir, "lib/jna/${System.getProperty('os.arch')}"), - 'com.mbeddr.logicalview.checks.home' : rootDir, - 'build.dir' : buildDir, - 'version' : version, - 'build.date' : new Date(), -] +def defaultScriptArgs = [mps_home, build_dir, artifacts_dir, ext.buildDate, ext.pluginVersion, + '-Dbuild.jna.library.path=' + new File(mpsHomeDir, 'lib/jna/' + System.getProperty('os.arch'))] + +afterEvaluate { + project.ext["itemis.mps.gradle.ant.defaultJavaExecutable"] = tasks.getByName('downloadJbr').javaExecutable + def jdk_home = null + if (ext.has('java17_home')) { + jdk_home = ext.get('java17_home') + } else if (System.getenv('JB_JAVA17_HOME') != null) { + jdk_home = System.getenv('JB_JAVA17_HOME') + } + if(jdk_home != null) { + if (!new File(jdk_home, "lib").exists()) { + throw new GradleException("Unable to locate JDK home folder. Detected folder is: $jdk_home") + } else { + ext["itemis.mps.gradle.ant.defaultJavaExecutable"] = new File(jdk_home, 'bin/java') + } + } +} // enables https://github.com/mbeddr/mps-gradle-plugin#providing-global-defaults -task configureJava { - dependsOn "downloadJbr" +ext["itemis.mps.gradle.ant.defaultScriptArgs"] = defaultScriptArgs +ext["itemis.mps.gradle.ant.defaultScriptClasspath"] = buildScriptClasspath + +task resolved_diagram_dependencies(type: Copy) { + from configurations.diagram_lib + into file('code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/lib') + + // Strip version numbers from file names + rename { filename -> + def ra = configurations.diagram_lib.resolvedConfiguration.resolvedArtifacts.find { ResolvedArtifact ra -> ra.file.name == filename } + String finalName + if (ra.classifier != null) { + finalName = "${ra.name}-${ra.classifier}.${ra.extension}" + } else { + finalName = "${ra.name}.${ra.extension}" + } + return finalName + } +} + +task resolved_batik_dependencies(type: Sync) { + from configurations.batik + into file('code/batik/solutions/lib') + + // Strip version numbers from file names + rename { filename -> + def ra = configurations.batik.resolvedConfiguration.resolvedArtifacts.find { ResolvedArtifact ra -> ra.file.name == filename } + String finalName + if (ra.classifier != null) { + finalName = "${ra.name}-${ra.classifier}.${ra.extension}" + } else { + finalName = "${ra.name}.${ra.extension}" + } + return finalName + } +} + +tasks.register('build_allScripts', BuildLanguages) { + dependsOn 'downloadJbr', resolveMps, copyModelApi, resolved_diagram_dependencies, resolved_batik_dependencies + script "$rootDir/scripts/build.xml" +} + +task copyChangelog(type: Copy) { + from "$rootDir/code/solutions/de.itemis.mps.extensions.changelog/source_gen/de/itemis/mps/extensions/changelog" + into "$rootDir" + include "*.md" +} + +task build_languages(type: BuildLanguages, dependsOn: [build_allScripts]) { + script scriptFile('languages/build.xml') +} + +task build_tests(type: BuildLanguages, dependsOn: build_languages) { + description "Will execute all tests from command line" + script scriptFile('tests/build.xml') +} + +task failOnTestError() { + description 'evaluate junit result and fail on error' + doLast { + + def juniXml = file('TESTS-TestSuites.xml') + if(juniXml.exists()){ + def junitResult = new XmlSlurper().parse(juniXml) + def failures = junitResult.'**'.findAll { it.name() == 'failure' } + def errors = junitResult.'**'.findAll { it.name() == 'error' } + + if (failures || errors) { + def amount = failures.size() + errors.size() + throw new GradleException(amount + " JUnit tests failed. Check the test report for details.") + } + } + } +} + +task run_tests(type: TestLanguages, dependsOn: build_tests) { + description "Will execute all tests from command line" + script scriptFile('tests/build.xml') + targets 'check' doLast { - project.ext["itemis.mps.gradle.ant.defaultScriptArgs"] = defaultScriptArgs.collect { "-D$it.key=$it.value".toString() } - project.ext["itemis.mps.gradle.ant.defaultScriptClasspath"] = buildScriptClasspath - project.ext["itemis.mps.gradle.ant.defaultJavaExecutable"] = tasks.getByName("downloadJbr").javaExecutable - println project.findProperty("itemis.mps.gradle.ant.defaultJavaExecutable") + ant.taskdef(name: 'junitreport', + classname: 'org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator', + classpath: configurations.junitAnt.asPath) + ant.junitreport { + fileset(dir: "$buildDir", includes: '**/TEST*.xml') + report(format: 'frames', todir: "$buildDir/junitreport") + } + ant.echo("JUnit report placed into $buildDir/junitreport/index.html") } } -// All MPS tasks depend on configureJava and resolveMps -tasks.withType(RunAntScript).configureEach { - dependsOn(configureJava, resolveMps) +run_tests.configure { finalizedBy failOnTestError } + +task install_nativelibs(type: Copy, dependsOn: build_languages) { + from "$rootDir/artifacts/de.itemis.mps.extensions/" + include "de.itemis.mps.nativelibs.loader/" + into "$mpsPluginsDir" +} + + +task install(dependsOn: install_nativelibs) { + description "Install the required plugins into the MPS plugin repository" + group "Build Setup" + doFirst { + // check parent gradle file for definition of the variables + println "Installing required mbeddr plugins to '$mpsPluginsDir'" + if (!project.hasProperty("MPS_PATHS_SELECTOR")) { + println "To change 'MPS<>' part, pass MPS_PATHS_SELECTOR property to gradle with -PMPS_PATHS_SELECTOR=" + println "The path selector only contains the the actual selector for instance \"MPS2017.3\" not the full qualifies path to the user plugin directory." + } + } } -File scriptFile(String name) { - file("$buildDir/scripts/$name") +// + +// Ant task support +repositories { + mavenCentral() +} +configurations { + junitAnt +} +dependencies { + junitAnt 'junit:junit:4.13.2' + junitAnt('org.apache.ant:ant-junit:1.10.14') { + transitive = false + } + junitAnt('org.apache.ant:ant-junit4:1.10.14') { + transitive = false + } } -def build_project = tasks.register('build_project', BuildLanguages) { - script scriptFile('build.xml') +task packageAllScripts(type: Zip, dependsOn: run_tests) { + archiveBaseName = 'de.itemis.mps.extensions.allScripts' + from artifactsDir + include 'de.itemis.mps.extensions.allScripts/**' } -task package_project(type: Zip, dependsOn: build_project) { - archiveBaseName = 'com.mbeddr.logicalview.checks' +task packageExtensions(type: Zip, dependsOn: run_tests) { + archiveBaseName = 'de.itemis.mps.extensions' from artifactsDir - include 'com.mbeddr.logicalview.checks/**' + include 'de.itemis.mps.extensions/**' + //remove workaround which is required for mbeddr.platform build + exclude 'de.itemis.mps.extensions/MPS.ThirdParty.jar' } -assemble.dependsOn(tasks.withType(BuildLanguages)) +task cleanMps(type: Delete) { + delete fileTree(dir: projectDir, include: ["**/classes_gen/**", "**/source_gen/**", "**/source_gen.caches/**", "tmp/**", "artifacts/**"]) +} -publishing { - repositories { - maven { - name = "GitHubPackages" - url = uri("https://maven.pkg.github.com/mbeddr/mps-logical-view-checks") - credentials { - username = project.findProperty("github_username") ?: System.getenv("GITHUB_ACTOR") - password = project.findProperty("github_token") ?: System.getenv("GITHUB_TOKEN") +clean.dependsOn cleanMps +assemble.dependsOn packageExtensions + +allprojects { + apply plugin: 'maven-publish' + publishing { + repositories { + if (rootProject.hasProperty("artifacts.itemis.cloud.user") && rootProject.hasProperty("artifacts.itemis.cloud.pw")) { + maven { + name = "itemisCloud" + url = project.publishingRepository + credentials { + username = rootProject.findProperty("artifacts.itemis.cloud.user") + password = rootProject.findProperty("artifacts.itemis.cloud.pw") + } + } } - } - if (project.hasProperty("artifacts.itemis.cloud.user") && project.hasProperty("artifacts.itemis.cloud.pw")) { - maven { - name = "ItemisNexus" - url = uri("https://artifacts.itemis.cloud/repository/maven-mps-releases") + if (rootProject.hasProperty("gpr.token")) { + maven { + name = "GitHubPackages" + url = "https://maven.pkg.github.com/JetBrains/MPS-extensions" credentials { - username = project.findProperty("artifacts.itemis.cloud.user") - password = project.findProperty("artifacts.itemis.cloud.pw") + username = rootProject.findProperty("gpr.user") + password = rootProject.findProperty("gpr.token") } + } } } } +} +def additionalPomInfo = { + licenses { + // official SPDX identifier + // see https://spdx.org/licenses/ for list + license { + name = "Apache-2.0" + url = "http://www.apache.org/licenses/LICENSE-2.0.txt" + comments = "A business-friendly OSS license" + distribution = "repo" + } + } + organization { + name = "JetBrains s.r.o" + url = "https://www.jetbrains.com" + } +} +publishing { publications { - MPSLogicalViewChecks(MavenPublication) { - groupId 'com.mbeddr' - artifactId 'logical-view-checks' - artifact package_project + extensions(MavenPublication) { + groupId 'de.itemis.mps' + artifactId 'extensions' + artifact packageExtensions + //Pom.withProvidedDep pom, configurations.mps pom.withXml { def dependenciesNode = asNode().appendNode('dependencies') - configurations.languageLibs.resolvedConfiguration.firstLevelModuleDependencies.each { - def dependencyNode = dependenciesNode.appendNode('dependency') - dependencyNode.appendNode('groupId', it.moduleGroup) - dependencyNode.appendNode('artifactId', it.moduleName) - dependencyNode.appendNode('version', it.moduleVersion) - dependencyNode.appendNode('type', it.moduleArtifacts[0].type) - } configurations.mps.resolvedConfiguration.firstLevelModuleDependencies.each { def dependencyNode = dependenciesNode.appendNode('dependency') dependencyNode.appendNode('groupId', it.moduleGroup) @@ -222,48 +455,108 @@ publishing { dependencyNode.appendNode('scope', 'provided') } } + pom additionalPomInfo } } } -task cleanMps(type: Delete) { - delete fileTree(dir: projectDir, include: ["**/classes_gen/**", "**/source_gen/**", "**/source_gen.caches/**", "tmp/**"]) +task pipInstall(type: Exec) { + inputs.file("requirements.txt") + commandLine "python3", "-m", "pip", "install", "-r", "requirements.txt" } -clean.dependsOn cleanMps +task previewDocs(type: Exec, dependsOn: pipInstall) { + commandLine "mkdocs", "serve" +} + +task deployDocs(type: Exec, dependsOn: pipInstall) { + commandLine "mkdocs", "gh-deploy", "--clean", "-r", "gh-pages", "--force" +} + +defaultTasks 'build_languages' +task test(dependsOn: run_tests) + +build_languages.mustRunAfter clean + +task rebuild(dependsOn:[clean, build_languages]) + +def releaseNotes +def releaseName +def releaseTagName -defaultTasks 'build' +if (rootProject.hasProperty("nightly_build")) { + releaseName = 'Nightly Build ' + version + releaseTagName = 'nightly-' + version + releaseNotes = """Automated Nightly build from ${LocalDateTime.now() as String}.""" +} else { + releaseNotes = rootProject.findProperty("releaseNotes") + releaseTagName = 'release-' + version + releaseName = version +} -task rebuild(dependsOn:[clean, build_project]) -ext.mpsPluginRoots = ['mps-build', 'mps-console', 'mps-trove', 'mps-modelchecker'] - .collect { new File(mpsHomeDir, "plugins/$it") } -ext.jbrJavaLauncher = tasks.named('downloadJbr', DownloadJbrForPlatform).flatMap { it.javaLauncher } +githubRelease { + owner = 'jetbrains' + repo = 'MPS-extensions' + token = rootProject.findProperty("github.token") ?: "empty" + tagName = releaseTagName + targetCommitish = GitBasedVersioning.getGitCommitHash() + body = releaseNotes + prerelease = rootProject.hasProperty("nightly_build") + releaseAssets = packageExtensions.outputs.files.files.collect {it.path} + dryRun = false +} + +tasks.named('githubRelease').configure { + dependsOn packageExtensions +} + +configurations { + rerunMigrationsBackend +} + +dependencies { + rerunMigrationsBackend("de.itemis.mps.build-backends:rerun-migrations:0.0.3.+") +} + +def usedPluginRoots = [ + new File(mpsHomeDir, 'plugins/mps-build'), + new File(mpsHomeDir, 'plugins/mps-console'), + new File(mpsHomeDir, 'plugins/mps-tooltips'), + new File(mpsHomeDir, 'plugins/mps-vcs'), + new File(mpsHomeDir, 'plugins/mps-git4idea'), + new File(mpsHomeDir, 'plugins/mps-httpsupport'), +] tasks.register('migrate', MpsMigrate) { - dependsOn(resolveMps, 'downloadJbr', 'build_project') + dependsOn(resolveMps, 'downloadJbr', 'build_languages', 'build_tests') + javaLauncher = tasks.named('downloadJbr', DownloadJbrForPlatform).flatMap { it.javaLauncher } + + haltOnPrecheckFailure = true + haltOnDependencyError = true - javaLauncher = jbrJavaLauncher mpsHome = mpsHomeDir - folderMacros.put('com.mbeddr.logicalview.checks.home', layout.projectDirectory) + projectDirectories.from('code') - pluginRoots.from(mpsPluginRoots) - haltOnPrecheckFailure = true - haltOnDependencyError = true + pluginRoots.from(usedPluginRoots) + + maxHeapSize = '4G' } tasks.register('remigrate', Remigrate) { - dependsOn(resolveMps, 'downloadJbr') mustRunAfter('migrate') + mustRunAfter('build_languages', 'build_tests') + + dependsOn(resolveMps, 'downloadJbr') - // Technically we don't need to _depend_ on build_all_languages because we can opt to rerun only migrations that - // come from MPS. - mustRunAfter('build_project') + javaLauncher = tasks.named('downloadJbr', DownloadJbrForPlatform).flatMap { it.javaLauncher } - javaLauncher = jbrJavaLauncher mpsHome = mpsHomeDir - folderMacros.put('com.mbeddr.logicalview.checks.home', layout.projectDirectory) projectDirectories.from('code') - pluginRoots.from(mpsPluginRoots) + pluginRoots.from(usedPluginRoots) + maxHeapSize = '4G' + + // diagram migration from version 0 is currently not rerunnable, although it claims to be + excludeModuleMigration("de.itemis.mps.editor.diagram", 0) } \ No newline at end of file