-
Notifications
You must be signed in to change notification settings - Fork 1
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
initial setup of plugin structure #2
base: master
Are you sure you want to change the base?
Conversation
You add a dependency on them in your build file and then apply them, just like you apply the Java plugin. Of course you should only do this with plugins that are core to the "JHipster experience". If there are some "optional integrations", you have two approaches at your disposal:
You could literally use the same API as in the build file, i.e. just create a Jar task and call dependsOn etc. But I think a
You then create an instance of this dedicated type and only set the runtimeClasspath property.
I'm not sure where the code snippet above should live, can you elaborate? |
Thanks for your input, so basically just apply the plugin the buildscript to have it available in the plugin source code and apply it to the project, sounds easy. 👍 Basically I would like to have the plugin and the generated code not tightly coupled. In particular, if someone wants to use a newer boot version the version of the boot plugin should be easily configurable and not fixed by e.g. the plugin version. So in a generated build file I could do jhipster {
apt = 0.12
} if I want the newest apt plugin applied, although jhipster applies 0.11 by default. |
That's not possible. By the time you are applied, the plugin classpath is long resolved. The user can apply the apt plugin herself to override your version. I'm not sure how common that is though and I'd probably not add boilerplate into the build script for that case. |
✔️ Alright, was not sure about it, but that is what I already thought. |
As mentioned by @oehme that's not possible. Also please be aware that you would be dependent on the API/DSL exposed by the third-party plugin you are configuring in your plugin. This API/DSL of course might change between versions and potentially break your plugin. +1 for a dedicated plugin as suggested to avoid too tight integration in a single plugin e.g. |
Thats even more fine granular than I had planned ( |
These are the first steps to create a gradle base plugin. Currently id does nothing except applying the java plugin and creating a new task when you are under windows.
Mostly I have two open questions (maybe @oehme or @eriwen can help here).
PathingJarTask
via code and plugin the same as in the current build file? Overwriting the methods (like for the theappendix
) seems no not right to me, but couldn't find much about it.What I need to consider is plugin versions. Currently I think of something like @oehme suggested, that we can easily overwrite the version of certain plugins like this, so a user can easily update versions:
What do you think?
Updates jhipster/generator-jhipster#6252
Updates #1