mbeddr / mps-build-backends

Command-line utilities used e.g. by Gradle plugins to generate or check models.
Apache License 2.0
3 stars 4 forks source link

Adding the ability to bypass reconciliation and compilation phases. #24

Open tomb50 opened 3 months ago

tomb50 commented 3 months ago

As far as I can see the reconciliation phase doesn't really offer anything in the use case of execute-generators in a headless environment. Please correct me if this is wrong.

I have a use case where my generation phase takes 60 seconds, the reconciliation is ALSO taking 70+ seconds, so I'd very much like the ability to opt-out of that stage. This wasn't an issue for me when using the old Ant GenerateTask as that just did pure Generation, no mention of reconciliation.

Similarly, I've added the ability to opt-out of Java compilation since my source_gen is compiled externally. I know that it can be defined at the Solution level whether or not compilation is needed, but I think it is nicer to be able to have the model compiled if made from the IDE, but not compiled if Made through CLI.

sergej-koscejev commented 2 months ago

Thank you for your investigation and your PR.

I would like to understand why GenerateTask is not performing reconciliation. I don't see anything in its code in MPS skipping reconciliation explicitly. Perhaps we should also always skip it?

I am a bit on the fence about skipping compilation because it seems very specific to your use case.

However, since a generic mechanism to configure make/generation properties externally is missing from MPS, I will consider merging this as well. I have also created MPS-37484 to request the generic mechanism from JetBrains... eventually.

In any case, before this PR can be merged (with or without skipping compilation), several things will need to be done:

tomb50 commented 2 months ago

Hi Sergej,

Thanks for the comments - I think I made a mistake, the Ant GenerateTask DOES do reconciliation, as you mentioned. - I got confused when reading through Tasks vs Facets (the ReduceMakeFacet).

I will update the PR as needed above, though as it seems like this may be becoming a more specific change I'm also happy to use a local fork for now whilst we wait for generic mechanism for the other configurable options.