diff --git a/ktlint-bom/build.gradle.kts b/ktlint-bom/build.gradle.kts index 904b6a7b70..68eb6640ff 100644 --- a/ktlint-bom/build.gradle.kts +++ b/ktlint-bom/build.gradle.kts @@ -7,16 +7,13 @@ publishing.publications.named("maven") { from(components["javaPlatform"]) } -val internalNonPublishableProjects: Set by rootProject.extra -val excludeList = internalNonPublishableProjects + "ktlint-test-ruleset-provider-v2-deprecated" - dependencies { logger.lifecycle("Creating dependencies for ktlint-bom") constraints { project.rootProject.subprojects.forEach { subproject -> - if (subproject.name in excludeList) { - logger.lifecycle(" - Ignore dependency '${subproject.name}' and do not add to ktlint-bom") - } else { + subproject.plugins.withId("ktlint-publication") { + // Exclude self project from BOM. + if (subproject == project) return@withId logger.lifecycle(" + Add api dependency on '${subproject.name}' to ktlint-bom") api(subproject) }