diff --git a/plugins/src/main/kotlin/extension/DependencyHandleScope.kt b/plugins/src/main/kotlin/extension/DependencyHandleScope.kt index 3e8f8f57b0..d7fbdfae2c 100644 --- a/plugins/src/main/kotlin/extension/DependencyHandleScope.kt +++ b/plugins/src/main/kotlin/extension/DependencyHandleScope.kt @@ -25,7 +25,7 @@ internal fun DependencyHandler.implementation(dependency: Any) = add("implementa private fun DependencyHandlerScope.implementation( dependency: Any, config: Action -) = dependencies.add("implementation", dependency, closureOf { config.execute(this) }) +) = dependencies.add("implementation", dependency, closureOf { config.execute(this) }) private fun DependencyHandlerScope.androidTestImplementation(dependency: Any) = dependencies.add("androidTestImplementation", dependency) @@ -114,14 +114,30 @@ fun DependencyHandlerScope.allServicesImpl() { implementation(project(":services:toolbox:impl")) } -fun DependencyHandlerScope.allEnterpriseImpl(project: Project) = addAll(project, "enterprise", "impl") +fun DependencyHandlerScope.allEnterpriseImpl(project: Project) = addAll( + project = project, + modulePrefix = ":enterprise:features", + moduleSuffix = ":impl", +) -fun DependencyHandlerScope.allFeaturesImpl(project: Project) = addAll(project, "features", "impl") +fun DependencyHandlerScope.allFeaturesImpl(project: Project) = addAll( + project = project, + modulePrefix = ":features", + moduleSuffix = ":impl", +) -fun DependencyHandlerScope.allFeaturesApi(project: Project) = addAll(project, "features", "api") +fun DependencyHandlerScope.allFeaturesApi(project: Project) = addAll( + project = project, + modulePrefix = ":features", + moduleSuffix = ":api", +) -private fun DependencyHandlerScope.addAll(project: Project, prefix: String, suffix: String) { - val subProjects = project.rootProject.subprojects.filter { it.path.startsWith(":$prefix") && it.path.endsWith(":$suffix") } +private fun DependencyHandlerScope.addAll( + project: Project, + modulePrefix: String, + moduleSuffix: String, +) { + val subProjects = project.rootProject.subprojects.filter { it.path.startsWith(modulePrefix) && it.path.endsWith(moduleSuffix) } for (p in subProjects) { add("implementation", p) }