-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider publishing the plugin on the gradle portal #65
Comments
Hi Federico, I really like the idea. Are these two mentioned gradle plugins of yours on github? Is it just a regular gradle publication or is there more behind it? |
Yes:
It is a publication with a small set of metadata. You also need to register for the gradle portal and write the credentials on a configuration file. It is all quite straightforward. Here there is a guide: https://guides.gradle.org/publishing-plugins-to-gradle-plugin-portal/ |
This isn't as easy as it seems. This repo contains only two real plugins in terms of gradle. The vast majority of content are tasks that aren't related to a plugin. That code doesn't even ship with a plugin descriptor because it doesn't contain any plugin and is only used by putting the classes on the classpath and then these classes are used in the end users build scripts. |
Could those tasks be made accessible as part of the plugin? Or do you think it would not work? |
I think having a plugin would make no difference, you would still have to import the tasks in your script to use them and add the itemis repository to the build script to make use of the tasks, I think. @ftomassetti in your opinion, how would publishing the plugin make it easier to use? |
It would not be a huge difference but every gradle users is used to including plugins, let's so to add classes to the classpath of the script. One has to type a few more lines, and typically would need to copy them over from some other projects. While a one-line to include plugins seems more "normal". I suggested because, while the benefit can be minor, I thought also the work required would be minor. |
Also, the plugin can do some initialization when applied, like adding the itemis repository to you, so configuration could become a one-liner. For example, I do something similar in the mpsserver gradle plugin: I look at the repositories, configuration, and dependencies and add some default stuff, if it is not present |
tl;dr: Yes we should publish it to gradle portal, but there is more to it and we need to do some renaming and add a "dummy" plugin. The thing here is we are talking about different things, gradle plugin in the gradle sense, yes that's true it can do these things and we do that with generator plugin etc. But these are niche use cases for the plugin at the moment. The vast majority use that tasks defined in the jar directly without applying any gradle plugin.
The two gradle plugins above are mostly metadata that on the maven repo for gradle to fetch the right dependencies and to know which project plugin classes to apply at runtime. The actual classes are contained in the
Now if we want to provide real value to the end user to make things easier to use we can't just publish the existing things to the gradle portal / maven central. Leaving out the fact that we would need to rename the In order to get gradle to put our tasks on the classpath of the build script we would need a real gradle plugin. Now one would ask why not apply either For renaming the existing plugins, I think the impact to most users is marginal since old versions would still be available on the itemis nexus and without an explicit configuration change you won't run into problems at the user side. To conclude my thoughts, is it flipping a switch and just pushing the existing jars to maven central/gradle portal? No! Is it still worth doing it? Yes! If we create an empty gradle plugin called I hope it made clear why we can't do this right away. |
What tasks do you mean? For instance I guess that would be slightly better than a dummy plugin since it would make the resulting build scripts easier to read and understand. |
I reflect on this and I tried building a simpler plugin to help people getting started on simple projects with KernelF. This experimental plugin (called MPS Wizard) is configured like this:
It does a few things:
Now, this plugin will never be as powerful as this one, and I plan to use it in tutorials to help people getting started more easily. In real projects I use this plugin, but I always need to copy the configuration from other projects, because there are too many things to remember for me. It typically requires me 20-30 minutes to setup a new MPS project with a proper build file (I recorded myself to measure it). My goal with this other plugin is to stay below 1 minute. The drawback is that it would be very "opinionated" and not as poweful and flexibile like this one. I am sharing this because maybe we could steer this plugin to be easier to configure, combining the best of both worlds: having something powerful and easy to use. |
Also, a benefit is that by running |
Hi, I think this should be relatively easy and make a little bit easier to use the plugin. It is also straightforward, I have already done for two gradle plugins. You just need to register a profile and submit the plugin for approval (normally very quick)
The text was updated successfully, but these errors were encountered: