Skip to content
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

Split Grails Gradle Plugins & Use Composition #389

Open
jdaugherty opened this issue Jan 13, 2025 · 1 comment
Open

Split Grails Gradle Plugins & Use Composition #389

jdaugherty opened this issue Jan 13, 2025 · 1 comment
Assignees

Comments

@jdaugherty
Copy link
Contributor

jdaugherty commented Jan 13, 2025

From #340 (comment) , there's previous discussion about splitting the grails gradle plugin.

The side effects from having a core grails plugin that assumes an entire runable grails app causes excess time in compiling for grails plugins that are not runable. We identified that grails-core already takes the approach of not including the gradle plugin because of this issue.

grails/grails-core#13968 (comment) gives further reason for this need.

At a high level, here's what we currently have (simplified view for illustration approaches):

	grails 'core' shared gradle plugin
	- adds spring boot
	- changes tasks
	- adds dependency plugin
	- wires up different classpath
	- etc 

	grails plugin gradle plugin 
	- extends core
	- and generates the metadata
	- which means any plugin gets the kitchen sink, even if it doesn't need to be a runable app

	grails web
	- extends core
	- injects tag libs, registers tag libs, etc

	grails gsp 
	- extends core
	- compiles gsp

We need to split grails plugin gradle plugin separate from the shared grails gradle plugin. We can leave a composite plugin that groups many plugins like the existing grails plugin gradle plugin so it doesn't break existing plugins. The goal of this split would enable people to layer functionality in plugins. need only views? apply only the view plugin. need it a full grails app? apply the set of plugins that make it a full grails app?

This would also have the added benefit of making the gradle plugins not be a magic black box for people. You would know what's causing the gradle behavior and would make it easier for new grails developers to understand what's going on. This split would require a significant amount of documentation to ensure people understand when to use what plugin (instead of the current approach, which is effectively always use everything since the logic is in the core plugin that no one ever includes).

@jdaugherty jdaugherty self-assigned this Jan 13, 2025
@jdaugherty
Copy link
Contributor Author

to be clear, by composition I mean we would have a plugin that includes the split plugins ... we could even have the composed plugin be the same name so it's backwards compatible. Going forward people could then include only the plugins they need to implement a grails plugin.

This has the huge benefit that people only have to rewrite a plugin when they use a function that was changed by grails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant