Skip to content

ktlint version detection from ktlint-plugins.properties file not applied to subprojects #1037

@sgaestel

Description

@sgaestel

First, thanks for the implementation of the support for ktlint-plugins.properties to read ktlint version to be used ❤️

However, I noticed that when having a multi-project build, the version read from this file is only applied to the root project.
If I add that file to subproject folders, it is taken into account from that file (meaning I could define a different version per sub-project).

As the intellij extension is only taking the root project file into account, it would make sense to propagate the version to sub-projects automatically (if possible?).

Workaround for now: Configure explicitly the version when applying the plugin to sub-projects from build.gradle.kts:

ktlint.version.let { ktlintVersion ->
    subprojects {
        apply(plugin = "org.jlleitschuh.gradle.ktlint")
        configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> {
            version.set(ktlintVersion)
        }
    }
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions