3.0.0: task-type interfaces, Gradle 9, drop legacy plugins#177
Draft
sergej-koscejev wants to merge 44 commits into
Draft
3.0.0: task-type interfaces, Gradle 9, drop legacy plugins#177sergej-koscejev wants to merge 44 commits into
sergej-koscejev wants to merge 44 commits into
Conversation
…load-jbr) Remove GenerateMpsProjectPlugin, ModelcheckMpsProjectPlugin, RunMigrationsMpsProjectPlugin, DownloadJbrProjectPlugin, FakeBuildNumberTask, BasePluginExtensions, and all related code. These are replaced by direct use of the @Incubating task types (MpsGenerate, MpsCheck, etc.). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Keep ErrorMessages.noMpsProjectIn() instead of inlining the message. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
MpsTask provides mpsHome and javaLauncher for any task that touches an MPS installation. MpsProjectTask adds mpsVersion, projectLocation, pluginRoots, folderMacros, and logLevel for tasks that operate on MPS projects. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Also remove javaLauncher from MpsTask interface to avoid inherited platform declaration clash with JavaExec.getJavaLauncher() (Kotlin sees the Java method's type argument as platform-nullable, conflicting with the non-null Kotlin property declaration). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Change pluginRoots from SetProperty<Directory> to ConfigurableFileCollection. Remove varMacros. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Change pluginRoots from SetProperty<Directory> to ConfigurableFileCollection. Replace macros: MapProperty<String, String> with folderMacros: MapProperty<String, Directory>. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add projectLocation from interface. Rename projectDirectories to projectLocations (mutually exclusive with projectLocation). Remove javaExecutable in favor of javaLauncher from MpsTask. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Declared as a function (fun getJavaLauncher()) rather than a Kotlin property to avoid a platform declarations clash with JavaExec.getJavaLauncher(). JavaExec-based tasks satisfy the interface automatically; DefaultTask-based tasks (MpsMigrate) override the function explicitly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add projectLocation from interface. Rename projectDirectories to projectLocations (mutually exclusive with projectLocation). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add mpsHome and javaLauncher. Derive Ant classpath from mpsHome when scriptClasspath is not set. Pass mps.home and mps_home as Ant properties. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ration Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove old plugin docs (generate, modelcheck, download-jbr). Update task docs to reflect renamed/removed properties and new MpsTask interface on RunAntScript. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace prop.set(value) with prop = value in build scripts and test build script strings where the Gradle Kotlin DSL supports it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move mpsVersion from MpsProjectTask up to MpsTask so it is available on all MPS tasks. Add Gradle task annotations (@internal, @input, @classpath, @Console, @nested) to interface properties and update doc comment examples to use property assignment syntax. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
We don't need it
Root becomes a thin aggregator. The plugin's sources, api file, docs, CHANGELOG, README, and build.gradle.kts move under mps-gradle-plugin/. Root build.gradle.kts is gone; setTeamCityBuildNumber and dependency locking live on the subproject now. Maven coordinates (de.itemis.mps:mps-gradle-plugin) are unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ed build Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Remigrate always requires a JDK 11 toolchain (its MpsBackendBuilder sets javaLauncher from mpsVersion), but the test's settings.gradle.kts did not apply the foojay-resolver-convention plugin. It relied on sibling Mps*TaskTest runs to provision JDK 11 into the shared TestKit Gradle home. Under parallel test execution, Remigrate could start before any foojay-enabled sibling finished provisioning and then fail with "Toolchain download repositories have not been configured."
Pins in Kotlin test files (foojay-resolver-convention plugin, com.jetbrains:mps distribution) are covered via customManagers so they track upstream releases alongside the main build. forkProcessing is enabled since this repo is a fork. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drops CreateDmg, BundleMacosJdk (with their bundled shell/perl scripts and docs), plus DownloadJbrForPlatform and its helper ToolchainSpecFactory. macOS installer building is no longer in scope for this plugin; JBR toolchain resolution is better served by specificlanguages/mps-gradle-plugin's jbr-toolchain subproject. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The task only opened the JetBrains download page in a browser and did not pull its weight. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Gradle 9 enforces plugin validation rules as errors: every task type must declare cacheability and all @InputFile[s] properties must carry a normalization strategy. Applies @DisableCachingByDefault to the Ant runners and XML generator, and @PathSensitive to their file inputs. JavaExec became abstract in Gradle 9, so Remigrate is converted to an abstract class whose properties Gradle instantiates automatically, following the same pattern as MpsExecute. The @Inject constructor and manual objectFactory.property() initialization are dropped; conventions move into an init block. Since Gradle 9 mandates JDK 17, consumers must also use 17; the explicit kotlin("jvm") plugin and kotlin-stdlib dependency are dropped (kotlin-dsl provides both), the apiVersion = 1.7 pin is dropped, and targetCompatibility moves to 17 across both subbuilds. The Java 11 leg is removed from the CI matrix (still downloaded as a side-install to run MPS 2021.x-based tests). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two issues prevented the custom regex managers from working: 1. config:recommended sets ignorePaths including **/test/**, so Renovate silently skipped every file under src/test/kotlin. The ignorePaths list is cleared since none of the presets' entries correspond to paths that exist in this repository. 2. com.jetbrains:mps is not on Maven Central but on artifacts.itemis.cloud; the registryUrlTemplate now points there. Verified locally with renovate --platform=local: both the foojay plugin lookup and the MPS lookup resolve and produce update branches. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
All integration tests that spin up an MPS instance now read their version from support.MPS_VERSION instead of hardcoding it in-line. This folds five call sites (three different versions: 2021.3.2, 2021.3.3, 2021.3.4) into one. Settling on 2021.3.4 for consistency; migration tests that previously pinned 2021.3.2 now share the same version as the rest. The Renovate custom manager for com.jetbrains:mps is narrowed to the new TestVersions.kt file and matches the const val, so updates go through a single well-named PR rather than several per-file ones. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2025.1 no longer accepts arbitrary objects as log messages. Add explicit toString() calls. Remove Java 11 provisioning in the GitHub workflow.
Same treatment as MPS_VERSION: five call sites in the generated settings scripts now read from support.FOOJAY_RESOLVER_CONVENTION_VERSION, and the Renovate custom manager is narrowed to match the const val in TestVersions.kt so updates land as one PR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The api subproject now holds two plain Java 17 interfaces instead of Kotlin ones. Drops kotlin-dsl, the binary-compatibility-validator (which requires Kotlin), and the Kotlin compileOnly/stdlib wiring; adds compileOnly(gradleApi()). Kotlin does not allow `override val x: T` to override a Java `getX(): T` method, so every subclass in mps-gradle-plugin that implemented MpsTask / MpsProjectTask members is converted to `abstract override fun getX()`. This goes hand in hand with the abstract-property pattern Gradle's managed types support: the objectFactory.property() boilerplate in the property declarations is dropped and conventions move to init blocks. MpsMigrate extends DefaultTask (which doesn't expose objectFactory/providerFactory), so it gets abstract @Inject getters for those instead of a constructor. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There isn't much reason left to run the build on several JDKs since the JDK only affects what Gradle uses. The tasks use the appropriate JBR for the current MPS version. Also update the versions of used GitHub actions.
Drop the -SNAPSHOT suffix and add an initial CHANGELOG for the newly extracted mps-gradle-plugin-api module. Also fill in the remaining 3.0.0 changelog notes in mps-gradle-plugin (Gradle 9 / Java 17 bump, api published as a separate artifact). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Point users at the specificlanguages jbr-toolchain Gradle plugin instead of implying a replacement task inside this plugin. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
pluginRoots, folderMacros, and logLevel apply to all MPS tasks, not just project-scoped ones. Hoisting them onto MpsTask leaves MpsProjectTask as the narrow "also has a projectLocation" marker. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Drop the standalone executable property in favor of javaLauncher from MpsTask. The defaultJavaExecutable extended-property fallback is kept. - Use the inherited logLevel property to derive -Dmps.ant.log instead of task.logging.level. - Assume mpsHome is always present; mpsHome.get() will surface a clear Gradle error if a consumer forgets to set it. Centralize the MpsTask.logLevel convention in the common plugin via tasks.withType<MpsTask>(), and remove the duplicated convention from each task's init block. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- script, targets, scriptArgs, scriptClasspath, and incremental become Property/ListProperty/ConfigurableFileCollection. Users assign with set/from/addAll instead of direct field assignment. - scriptClasspath gets a convention pointing at mpsHome's lib jars, so the manual fallback chain in build() goes away. - Remove the itemis.mps.gradle.ant.defaultScriptArgs, itemis.mps.gradle.ant.defaultScriptClasspath, and itemis.mps.gradle.ant.defaultJavaExecutable extended-property escape hatches along with the includeDefaultArgs/includeDefaultClasspath flags. Project-wide defaults belong in tasks.withType configureEach. - Drop the targets(vararg) helper; targets.set(listOf(...)) does the same thing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- script becomes a RegularFileProperty annotated as @InputFile, so Gradle auto-wires dependencies from upstream tasks that generate it and tracks the script contents for up-to-date checks. - workingDirectory becomes a DirectoryProperty defaulting to the root project directory. The task action no longer touches project at execution time, playing nicer with the configuration cache. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The incremental flag muted the clean target and added -Dmps.generator.skipUnmodifiedModels=true. Consumers that need that behavior can configure scriptArgs and targets themselves. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…erties note Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 23, 2026
sergej-koscejev
added a commit
that referenced
this pull request
Apr 24, 2026
Moves the mps-gradle-plugin and git-based-versioning build configurations from the TeamCity UI into .teamcity/settings.kts. Master only runs the Build step; publishing to artifacts.itemis.cloud happens from v1.x, matching today's UI-managed behavior (the legacy config has a branch-conditional publish step that only runs for v1.x). Once PR #177 lands, this is where selective on-demand publishing will be wired up. The pom.xml matches the layout used by mbeddr/publish-mps-prereleases; `mvn teamcity-configs:generate` resolves against https://mps.builds.itemis.cloud/app/dsl-plugins-repository and produces XML that matches the current UI-managed configs semantically. Applying this on the server requires the new `Mbeddr_Tooling_MpsGradlePlugin` subproject to switch its versioned-settings mode from `useParentProjectSettings` to "Synchronization enabled" against the existing VCS root, with "Use settings from the branch being built" turned on. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
nkoester
approved these changes
Apr 24, 2026
nkoester
left a comment
Member
There was a problem hiding this comment.
I've reviewed the changes in this PR. Sergej and I had a call on March 23rd to discuss the context, and we've covered all the
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Targets 3.0.0. Grouped:
New task-type interfaces
MpsTask(mpsHome,mpsVersion,javaLauncher,pluginRoots,folderMacros,logLevel) andMpsProjectTask(extendsMpsTask, addsprojectLocation) implemented by all MPS task types includingRunAntScript. Both interfaces supporttasks.withTypebulk configuration.de.itemis.mps:mps-gradle-plugin-api:1.0.0artifact(new
:mps-gradle-plugin-apiincluded build).de.itemis.mps.gradle.commonplugin sets theMpsTask.logLevelconvention to
gradle.startParameter.logLevel.Platform bump
RunAntScriptscript,targets,scriptArgs,scriptClasspathconverted to lazyGradle properties.
scriptis aRegularFilePropertyannotated@InputFile,so wiring
script.set(otherTask.flatMap { ... })establishes the taskdependency automatically.
workingDirectory: DirectoryProperty(default: root project directory).mpsHome; the Ant classpath defaults tolib/ant/lib/*.jarand
lib/*.jarundermpsHome.mps.homeandmps_homeare passed asAnt properties.
javaLauncherandlogLevel;-Dmps.ant.logis derivedfrom
logLevel.executable,incremental,includeDefaultArgs,includeDefaultClasspath, and theitemis.mps.gradle.ant.defaultScriptArgs/
defaultScriptClasspath/defaultJavaExecutableextended properties.Use
tasks.withType<RunAntScript>().configureEach { ... }to shareconfiguration.
Removed
generate-models,modelcheck,run-migrations— use thetask types (
MpsGenerate,MpsCheck,MpsMigrate,Remigrate) directly.download-jbrplugin,DownloadJbrForPlatformtask, and thedownloadJBRpackage — use the
com.specificlanguages.jbr-toolchainplugin to download the JetBrains Runtime.
CreateDmgandBundleMacosJdktasks — building macOS installers is nolonger in scope for this plugin.
GetMpsInBrowsertask — only opened the JetBrains download page in abrowser.
Other breaking API changes
MpsCheck,MpsExecute:pluginRootsis nowConfigurableFileCollection(was
SetProperty<Directory>).MpsCheck,MpsExecute:macros/varMacrosreplaced withfolderMacros: MapProperty<String, Directory>.MpsMigrate,Remigrate:projectDirectoriesrenamed toprojectLocations.MpsMigrate:javaExecutableremoved in favor ofjavaLauncherfromMpsTask.Repository layout
:mps-gradle-pluginsubproject (included build).:mps-gradle-plugin-apiincluded build.buildandpublishToMavenLocaltasks acrossincluded builds.
Full notes in
mps-gradle-plugin/CHANGELOG.mdunder3.0.0 (Unreleased).