kotlinx-knit icon indicating copy to clipboard operation
kotlinx-knit copied to clipboard

Replace `allprojects {}` config with convention plugins

Open aSemy opened this issue 2 years ago • 0 comments

Currently the project uses allprojects {} to configure all subprojects.

https://github.com/Kotlin/kotlinx-knit/blob/c4e77da4dfc4a863c71f7d09fe7c566d2ee39936/build.gradle.kts#L24-L27

Using allprojects {} is not recommended by Gradle. Is is for number of reasons which are explained thoroughly elsewhere (1, 2), so I won't detail them again.

One specific issue that Knit encounters is that Jackson is added to all projects, even though this dependency is only required in 'Dokka plugin' and (non-Gradle) Knit project.

https://github.com/Kotlin/kotlinx-knit/blob/c4e77da4dfc4a863c71f7d09fe7c566d2ee39936/build.gradle.kts#L33-L38

This can be resolved by creating buildSrc convention plugins that can be applied specifically to subprojects as required, avoiding duplicate configurations.

aSemy avatar Nov 13 '22 14:11 aSemy