diff --git a/CHANGELOG.md b/CHANGELOG.md index ededa044..e0a33518 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 1.19.1 + +### Fixed + +- `generate` and `checkmodels` tasks now support MPS 2022.2 and above by adding the necessary `--add-opens` JVM + arguments (using `mps-build-backends/launcher`). + ## 1.19 ### Added diff --git a/build.gradle.kts b/build.gradle.kts index aff93f49..df2573a6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -24,23 +24,31 @@ plugins { id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.13.2" } -val versionMajor = 1 -val versionMinor = 19 +val baseVersion = "1.19.1" group = "de.itemis.mps" -var currentBranch:String? = "" -currentBranch = GitBasedVersioning.getGitBranch() +val currentBranch : String? = GitBasedVersioning.getGitBranch() version = if (!project.hasProperty("useSnapshot") && (project.hasProperty("forceCI") || project.hasProperty("teamcity")) ) { - GitBasedVersioning.getVersion( - // Publish releases from v1.x branch without v1.x prefix - if (currentBranch == "v1.x") "HEAD" else currentBranch, - versionMajor.toString(), versionMinor.toString()) + val prefix = when (currentBranch) { + null, "", "v1.x", "HEAD", "master", "main" -> "" + else -> "$currentBranch." + } + + val suffix = ".${GitBasedVersioning.getGitCommitCount()}.${GitBasedVersioning.getGitShortCommitHash()}" + + prefix + baseVersion + suffix } else { - "$versionMajor.$versionMinor-SNAPSHOT" + "$baseVersion-SNAPSHOT" +} + +tasks.register("printVersion") { + doLast { + println("Version: $version") + } } val mpsConfiguration = configurations.create("mps") diff --git a/gradle.lockfile b/gradle.lockfile index 5ae9763d..75b155f3 100644 --- a/gradle.lockfile +++ b/gradle.lockfile @@ -1,7 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. -de.itemis.mps.build-backends:launcher:1.0.0.55.b7ebac5=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +de.itemis.mps.build-backends:launcher:1.0.0.56.8c05881=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath junit:junit:4.13.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath net.java.dev.jna:jna:5.6.0=kotlinCompilerClasspath,kotlinKlibCommonizerClasspath net.swiftzer.semver:semver:1.1.2=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath diff --git a/src/main/kotlin/de/itemis/mps/gradle/generate/Plugin.kt b/src/main/kotlin/de/itemis/mps/gradle/generate/Plugin.kt index aeea17cb..eacb8d07 100644 --- a/src/main/kotlin/de/itemis/mps/gradle/generate/Plugin.kt +++ b/src/main/kotlin/de/itemis/mps/gradle/generate/Plugin.kt @@ -1,6 +1,7 @@ package de.itemis.mps.gradle.generate import de.itemis.mps.gradle.* +import de.itemis.mps.gradle.launcher.MpsBackendLauncher import org.gradle.api.GradleException import org.gradle.api.Plugin import org.gradle.api.Project @@ -8,6 +9,7 @@ import org.gradle.api.artifacts.Configuration import org.gradle.api.model.ObjectFactory import org.gradle.api.tasks.Copy import org.gradle.api.tasks.JavaExec +import org.gradle.kotlin.dsl.newInstance import org.gradle.process.CommandLineArgumentProvider import java.io.File @@ -64,6 +66,8 @@ open class GenerateMpsProjectPlugin : Plugin { } generate.configure { + val backendLauncher: MpsBackendLauncher = project.objects.newInstance(MpsBackendLauncher::class) + backendLauncher.configureJavaForMpsVersion(this, mpsLocation, mpsVersion) dependsOn(fake) argumentProviders.add(argsFromBaseExtension(extension)) diff --git a/src/main/kotlin/de/itemis/mps/gradle/modelcheck/Plugin.kt b/src/main/kotlin/de/itemis/mps/gradle/modelcheck/Plugin.kt index 0b1049f5..df2173be 100644 --- a/src/main/kotlin/de/itemis/mps/gradle/modelcheck/Plugin.kt +++ b/src/main/kotlin/de/itemis/mps/gradle/modelcheck/Plugin.kt @@ -1,6 +1,7 @@ package de.itemis.mps.gradle.modelcheck import de.itemis.mps.gradle.* +import de.itemis.mps.gradle.launcher.MpsBackendLauncher import org.gradle.api.GradleException import org.gradle.api.Plugin import org.gradle.api.Project @@ -8,8 +9,10 @@ import org.gradle.api.artifacts.Configuration import org.gradle.api.model.ObjectFactory import org.gradle.api.tasks.Copy import org.gradle.api.tasks.JavaExec +import org.gradle.kotlin.dsl.newInstance import org.gradle.process.CommandLineArgumentProvider import java.io.File +import javax.inject.Inject open class ModelCheckPluginExtensions(objectFactory: ObjectFactory) : BasePluginExtensions(objectFactory) { var models: List = emptyList() @@ -49,6 +52,8 @@ open class ModelcheckMpsProjectPlugin : Plugin { } checkmodels.configure { + val backendLauncher: MpsBackendLauncher = project.objects.newInstance(MpsBackendLauncher::class) + backendLauncher.configureJavaForMpsVersion(this, mpsLocation, mpsVersion) dependsOn(resolveMps) argumentProviders.add(argsFromBaseExtension(extension))