Description
Hello Jendrik,
I hope this is the appropriate forum to ask this question.
We have a large multi-project build, following much of the best practices outlined here and in the Gradle User Guide but I am struggling to understand the best practices for applying plugins to our conventions.
There are two ways in which I've applied plugins to our projects:
- Create separate convention plugins for each variant of the plugins to apply, as this repository has done under
gradle/plugins/java-library-plugins
In this case, I could end up with a considerable amount of conventions such as:
java-library-with-text-fixtures
java-library-published
java-library-with-jmh
java-library-with-text-fixtures-and-jmh
java-library-published-and-jmh
java-library-publish-with-text-fixtures-and-jmh
- Apply all the common conventions to all java-library projects
In this case, I would minimize the amount of conventions plugins I need to write and when a developer creates a new subproject, simply applying java-library
will give you access to things like JMH and Test Fixtures already configured and ready to be used.
The issue I've found with using this technique is that the configuration time can be dramatically increased throughout the project. There might be subprojects that don't use JMH or Test Fixtures even though these plugins are being applied needlessly increasing the configuration time.
I've been using the incubating configuration on demand feature and that has improved our configuration time.
This seems to be a trade-off between ease of use and build speed. I'm wondering your thoughts on the best way to approach applying plugins to our conventions in a large multi-project build.