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?

1
11 comments

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

 

0

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

 

0

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.

0

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.

0

To resolve the "generation required" issue in JetBrains MPS after upgrading from version 2019.1, try these steps:

  1. Verify Plugin Compatibility: Ensure your language plugin is compatible with the new MPS version.
  2. Check Project Configuration: Review and adjust project settings like sekho.com.pk for the new version.
  3. Inspect Model Properties: Make sure all dependencies and settings in your model are correct.
  4. Examine Generation Plan: Ensure the generation plan is properly set up.
  5. Look at Logs: Check MPS console and log files for error messages or warnings.
  6. Update/Reinstall Plugins: Update other plugins to be compatible with the new MPS version.
  7. Reimport Project: Try reimporting your project into MPS.
  8. Consult Documentation/Community: Check MPS documentation and seek help from the MPS community or forums.
  9. Test with a Simple Model: Create a simple test model to identify if the issue is widespread.
  10. Revert to Backup: If possible, revert to a backup from the previous version and update incrementally.
0

Check for Compilation Errors:

  • Before attempting to rebuild the project, make sure there are no compilation errors in your Java code. Fix any syntax errors or other issues that might prevent successful compilation.

Clean and Rebuild:

  • In your Integrated Development Environment (IDE), such as Eclipse or IntelliJ IDEA, use the "Clean" and "Rebuild" options. This helps remove any compiled artifacts https://keziapickuplines.com/dad-pick-up-lines/ and forces a fresh compilation of your code.
0
  1.  
    • Before rebuilding the project, try cleaning it first. In many IDEs (Integrated Development Environments), there's an option to "Clean" the project, which removes all compiled files. After cleaning, rebuild the project promotional items.

Check for Errors:

  • Inspect the error logs and console output in your IDE for any error messages. Addressing any compilation errors is crucial before expecting the code generation to proceed smoothly.
0

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.

0

The generator was failing with errors for me when I checked out. Maybe that was the issue you were having?

0

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.

0

Please sign in to leave a comment.