Skip to content

3.0.0: task-type interfaces, Gradle 9, drop legacy plugins#177

Draft
sergej-koscejev wants to merge 44 commits into
mbeddr:masterfrom
sergej-koscejev:master
Draft

3.0.0: task-type interfaces, Gradle 9, drop legacy plugins#177
sergej-koscejev wants to merge 44 commits into
mbeddr:masterfrom
sergej-koscejev:master

Conversation

@sergej-koscejev

Copy link
Copy Markdown
Member

Summary

Targets 3.0.0. Grouped:

New task-type interfaces

  • MpsTask (mpsHome, mpsVersion, javaLauncher, pluginRoots,
    folderMacros, logLevel) and MpsProjectTask (extends MpsTask, adds
    projectLocation) implemented by all MPS task types including
    RunAntScript. Both interfaces support tasks.withType bulk configuration.
  • Published as a separate de.itemis.mps:mps-gradle-plugin-api:1.0.0 artifact
    (new :mps-gradle-plugin-api included build).
  • The de.itemis.mps.gradle.common plugin sets the MpsTask.logLevel
    convention to gradle.startParameter.logLevel.

Platform bump

  • Requires Gradle 9 and Java 17 (previously Gradle 8 and Java 11).

RunAntScript

  • script, targets, scriptArgs, scriptClasspath converted to lazy
    Gradle properties. script is a RegularFileProperty annotated @InputFile,
    so wiring script.set(otherTask.flatMap { ... }) establishes the task
    dependency automatically.
  • Added workingDirectory: DirectoryProperty (default: root project directory).
  • Now requires mpsHome; the Ant classpath defaults to lib/ant/lib/*.jar
    and lib/*.jar under mpsHome. mps.home and mps_home are passed as
    Ant properties.
  • Uses inherited javaLauncher and logLevel; -Dmps.ant.log is derived
    from logLevel.
  • Removed executable, incremental, includeDefaultArgs,
    includeDefaultClasspath, and the itemis.mps.gradle.ant.defaultScriptArgs
    / defaultScriptClasspath / defaultJavaExecutable extended properties.
    Use tasks.withType<RunAntScript>().configureEach { ... } to share
    configuration.

Removed

  • Old plugins generate-models, modelcheck, run-migrations — use the
    task types (MpsGenerate, MpsCheck, MpsMigrate, Remigrate) directly.
  • download-jbr plugin, DownloadJbrForPlatform task, and the downloadJBR
    package — use the
    com.specificlanguages.jbr-toolchain
    plugin to download the JetBrains Runtime.
  • CreateDmg and BundleMacosJdk tasks — building macOS installers is no
    longer in scope for this plugin.
  • GetMpsInBrowser task — only opened the JetBrains download page in a
    browser.

Other breaking API changes

  • MpsCheck, MpsExecute: pluginRoots is now ConfigurableFileCollection
    (was SetProperty<Directory>).
  • MpsCheck, MpsExecute: macros / varMacros replaced with
    folderMacros: MapProperty<String, Directory>.
  • MpsMigrate, Remigrate: projectDirectories renamed to projectLocations.
  • MpsMigrate: javaExecutable removed in favor of javaLauncher from
    MpsTask.

Repository layout

  • Plugin moved to :mps-gradle-plugin subproject (included build).
  • New :mps-gradle-plugin-api included build.
  • Root project has aggregating build and publishToMavenLocal tasks across
    included builds.

Full notes in mps-gradle-plugin/CHANGELOG.md under 3.0.0 (Unreleased).

sergej-koscejev and others added 30 commits April 22, 2026 15:11
…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>
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>
sergej-koscejev and others added 14 commits April 22, 2026 20:01
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>
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 nkoester self-requested a review April 24, 2026 13:08

@nkoester nkoester left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 $3.0$-related updates. Thanks for your work! LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants