From c3d1998a37a774e19e2d6dabb4b8a63ae4002258 Mon Sep 17 00:00:00 2001 From: Goooler Date: Sun, 31 Dec 2023 23:57:30 +0800 Subject: [PATCH] Simplify BOM exclude list --- ktlint-bom/build.gradle.kts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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) }