Skip to content

feat(mps-gradle-plugin)!: make setup resolve only external dependencies - #59

Open
sergej-koscejev wants to merge 3 commits into
masterfrom
setup-external-only
Open

sergej-koscejev wants to merge 3 commits into
masterfrom
setup-external-only

Conversation

@sergej-koscejev

@sergej-koscejev sergej-koscejev commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

setup only resolves external libraries now. Other projects of the build are expected to be in the MPS project as source project libraries, so setup doesn't build them. The Ant builds use the other projects' artifacts directories directly instead of extracting their zips.

 setup
-  resolveMpsLibraries        # all libraries -> build/dependencies, builds :b:zip
+  resolveMpsLibraries        # external libraries only (incl. those of :b) -> build/dependencies
+  :b:setup                   # each direct project dependency in api / testImplementation
   resolveBundledDependencies

 generate<Name> / assemble<Name> / check<Name>     (Ant)
+  :b:assemble<Published>     # via the artifactDirectories variant of :b
+  -Dartifacts.<dir name>=<dir>  for published main builds of other projects (transitive)
+                                and all main builds of this project
:b apiElements
  primary variant:   zip                    (published, unchanged)
  secondary variant: artifactDirectories    artifactType=directory, build/artifacts/<name> of published main builds,
                                            built by assemble<Name>; only visible inside the build

MPS-generated Ant scripts read the location of a dependency build project X from artifacts.X, so build models need no extra macros, as long as the directory name matches the build project name (the usual build/artifacts/<name>).

  • Project dependencies and included builds count as internal. setup of included builds isn't wired; users add it by hand if needed.
  • Bundled dependencies, generateBuildScripts, other RunAnt tasks and mbeddr tasks are unchanged.
  • Version bumped to 3.0.0-SNAPSHOT; README and changelog updated.

Evidence

ProjectDependenciesTest: :a (build main) → api(project(":b")) (build bLibs) → api("com.example:ext:1.0@zip")

:a:setup
  :b:setup runs; :b:assembleBLibs and :b:zip don't
  only ext extracted into a/build/dependencies

:a:generateMain --dry-run
  :b:assembleBLibs before :a:generateMain, no :b:zip

pathProperties of :a:generateMain
  artifacts.bLibs = b/build/artifacts/bLibs
  artifacts.main  = a/build/artifacts/main
  • Before (master): all three fail. :a:setup tries to build :b (fails in :b:generateBuildScripts), generateMain goes through :b:zip, and there are no artifacts.* properties.

    After: all three pass, together with the rest of :mps-gradle-plugin:check (including FullBuildTest, a real MPS build), checkApiCompatibility and checkReleaseVersions.

Merge Danger

Blast Radius: consumers

Breaking for multi-project builds: libraries from other projects no longer appear in build/dependencies. MPS build models or path variables that point there must be updated (or rely on the artifacts.* properties).

setup no longer builds MPS projects that the project depends on. Their
sources are expected to be added to the MPS project as project
libraries.

Instead of extracting the zips of other projects, Ant tasks use their
artifacts directories directly: each project exposes the artifacts
directories of its published main builds in a secondary variant of
apiElements, and the Ant tasks receive their locations as
artifacts.<directory name> properties.
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.

1 participant