Not generating java when rebuilding project
Hello!
I created language plugin and loaded it into MPS. Then I created new project and a model with my language. All is ok and works.
But then I want to run this model. But I see always "generation required" message. And I tried Rebuild project, make project, restarting MPS etc. It does not help.
In previous version 2019.1 all works fine.
Preview generated text works and shows correct Java with main function. But generation is not run when rebuilding project.
Where can be the problem?
Please sign in to leave a comment.
This looks like a bug to me. Can you share more details about the project, especially about the generator? Maybe create a YouTrack issue with the project attached?
Vaclav
Project is here https://github.com/d0sl/d0SDK
1) git clone https://github.com/d0sl/d0SDK
2) install plugin d0sl-plugin-mps-0.8.9.zip from plugin catalog
3) Open project in MPS 2019.3.4
in org.d0sl.examples there are auto and chess - this is java models
and org.d0sl.examples.sandbox contains DSL models
If the project is build correctly then you can run
AutodromeAII
ChessAII
MathTest
Linux Ubuntu
I tried MPS from Toolbox, and also downloaded latest version from site.
Problem is that MPS does not generate java classes for org.d0sl.examples.sandbox
But if I generate and place one manually. Then I can run the corresponding model. And after that MPS creates others java for the DSL models.
I followed your scenario and things worked just fine after I fixed two broken references in ChessFrame and Autodrome (both were pointing to an unresolved EXIT_ON_CLOSE field). The generator was failing with errors for me when I checked out. Maybe that was the issue you were having?
After that change I can rebuild the project and run the nodes. Cute animations, BTW.
Vaclav, thank you. Here Youtrack's issue about this
https://mps-support.jetbrains.com/hc/en-us/community/posts/360008233280-Not-generating-java-when-rebuilding-project/comments/360001662940#community_comment_360001662940
To resolve the "generation required" issue in JetBrains MPS after upgrading from version 2019.1, try these steps:
Check for Compilation Errors:
Clean and Rebuild:
Check for Errors:
If your Java code is not generating when rebuilding a project, several issues may be at play. Firstly, check for errors in your code or configuration files, as they can prevent successful compilation. Ensure that dependencies are correctly defined in your build tool (like Maven or Gradle) and that your IDE is properly configured. Additionally, review the build logs for any specific error messages that could pinpoint the issue. Cleaning and rebuilding the project might resolve caching problems. If the problem persists, verify your project settings and ensure the correct Java version is specified. Troubleshooting step by step can identify and address the root cause.
The generator was failing with errors for me when I checked out. Maybe that was the issue you were having?
It sounds like the issue might be related to changes or bugs introduced in the newer version of MPS. The "generation required" message suggests that MPS isn't triggering the code generation process as expected. Ensure that your language's generator is properly configured and that there are no missing or misconfigured generator rules. Double-check if there are any new settings or changes in MPS that might affect the generation process. Sometimes, clearing the MPS caches or deleting the
.idea
directory in your project can resolve such issues. If the problem persists, consider consulting the MPS community or checking for updates or patches that address this issue.