Skip to content

Using plugins in conventions #10

Closed
@Chasson1992

Description

@Chasson1992

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:

  1. 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

  1. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions