Description
Is your feature request related to a problem? Please describe
Presently the Dokka Gradle config uses a lot of allprojects {}
and subprojects {}
blocks to share configuration, but this is discouraged by Gradle
- https://docs.gradle.org/current/userguide/sharing_build_logic_between_subprojects.html#sec:convention_plugins_vs_cross_configuration
- https://melix.github.io/blog/2021/12/composition-in-gradle.html
Using inheritance makes configuring the project difficult, as it prevents subprojects from being ordered nicely (for example, it's not easily possible to have 'empty' subprojects, as the subprojects{}
block will add the plugins to them). It also means configuration is applied, even when not desired. For example, Dokka always applies the kotlin("jvm")
plugin
Line 44 in 8317436
But that's not required for the Gradle plugin project, as Gradle will supply the correct Kotlin plugin when the kotlin-dsl
plugin is applied.
Describe the solution you'd like
Dokka uses buildSrc convention plugins to configure and apply configuration in a modular way.
- https://docs.gradle.org/current/samples/sample_convention_plugins.html
- https://docs.gradle.org/current/userguide/custom_plugins.html#sec:precompiled_plugins
Describe alternatives you've considered
Additional context
This would help with implementation of #2700, so the Gradle Plugin subproject would not have unecessary configuration applied to it (like the kotlin("jvm")
plugin.
Are you willing to provide a PR?
I have made a start, but there's a lot of work to do!