mbeddr / mps-gradle-plugin

Miscellaneous tasks that were found useful when building MPS-based projects with Gradle.
Other
14 stars 15 forks source link

support adding language plugins as dependencies to build script #83

Open amirmv2006 opened 4 years ago

amirmv2006 commented 4 years ago

Hi, I have been trying to automate generating a model using a language I created myself, but it's more complicated than I thought! After some digging I found your useful plugin and now I think I'm very close. I have a couple of questions and a possibly suggested solution!

sergej-koscejev commented 4 years ago

Currently the plugin checks that the mps build configuration contains an artifact with coordinates com.jetbrains:mps so using a custom version of MPS won't work unless you publish it under group com.jetbrains and artifact ID mps. See code in your fork here. I think we could relax this requirement, but for now your only option is to use additional plugins via pluginLocation and plugins as you mentioned.

Yes, it could probably be made to work using the Gradle dependencies mechanism, the only problem I can think of is that MPS wants to know the ID of each plugin when loading it and the ID does not always correspond to its folder name.

amirmv2006 commented 4 years ago

Thank you for your reply Sergej, initially I was using the folder name, but then I made some extra changes to actually parse the META-INF/plugin.xml file and extract plugin id from there.

sergej-koscejev commented 4 years ago

Looks good but it's probably better to make it lazier, to improve startup time. Currently the initialization code will look into the files every time Gradle is run even if you end up not running the task, correct?

amirmv2006 commented 4 years ago

Good point, TBH I'm a bit new to gradle and you're probably right, so I'll look into that 👍. I'll also make some more adjustments to cleanup and get closer to a real-life solution 😅