Repository navigation
feat(cli): write a wrapper from --mps-home without Gradle - #233
Merged
Merged
Conversation
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
mops wrappernow works in an MPS project that has no Gradle build. When the global option--mps-homeis given, it skips Gradle discovery and writes the wrapper from the given homes. Without--java-home, it uses the Java runtime bundled with MPS, the same as other commands.The MPS project stands in for the Gradle project, so the wrapper goes in
<MPS project>/build/mopsw.--outputand--macrowork as before.MopsCommand.resolveJavaHomenow holds the "--java-home, or else the JBR bundled with MPS" rule for both daemon startup andmops wrapper.Help text, README, the
setupexamples page, and themopsskill mention the new mode.docs/reference/andskills/mops/references/are regenerated.Left for later: when a home in a wrapper is gone,
RuntimeHomeNotFoundExceptionstill suggestsmops wrapper --project-root X. For a wrapper written without Gradle, that command fails with "No Gradle build found ... Pass --mps-home ... to write the wrapper without Gradle", so the user still gets to the fix, in two steps.Evidence
Before: in a plain MPS 2024.1.6 project (copy of
mops-demo/planning-a):After:
New tests in
WrapperCommandTest(failed with "No Gradle build found" before, pass now):build/mopswwith the full expected text, executable, from inside.mps/--output) with the usual warnings--mps-homealone writes the bundled JBR as the Java homeNew
WrapperIntegrationTestcase:mops wrapperwith given homes on a project without Gradle, thencode runthrough the writtenmopsw. Passes on MPS 2024.1.6, next to the existing Gradle case.Ran:
:cli:test,detektMain,checkReference,:cli:integrationTestMps2024.1.6 --tests '*WrapperIntegrationTest'. Not run: full./gradlew check, integration tests on other MPS versions.Merge Danger
Blast Radius: small
mops wrapper --mps-home Xused to ignore--mps-homeand run Gradle discovery. Now it uses the given home and does not run Gradle. Commands other thanmops wrapperbehave as before; their homes are nownormalize()d.