Skip to content

Replace allprojects {} config with convention plugins #50

@aSemy

Description

@aSemy

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

allprojects {
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "org.gradle.maven-publish")

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.

dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.11.1")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.11.1")
testImplementation(kotlin("test-junit"))
}

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions