diff --git a/app/build.gradle.kts b/app/build.gradle.kts index da9a4ab3e9..1909d9fa0f 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -206,7 +206,7 @@ knit { dependencies { allLibrariesImpl() allServicesImpl() - allFeaturesImpl(rootDir) + allFeaturesImpl(rootDir, logger) implementation(projects.libraries.deeplink) implementation(projects.tests.uitests) implementation(projects.anvilannotations) diff --git a/appnav/build.gradle.kts b/appnav/build.gradle.kts index 5b1c4b1ced..2ed497567f 100644 --- a/appnav/build.gradle.kts +++ b/appnav/build.gradle.kts @@ -36,7 +36,7 @@ dependencies { implementation(libs.dagger) kapt(libs.dagger.compiler) - allFeaturesApi(rootDir) + allFeaturesApi(rootDir, logger) implementation(projects.libraries.core) implementation(projects.libraries.androidutils) diff --git a/plugins/src/main/kotlin/extension/DependencyHandleScope.kt b/plugins/src/main/kotlin/extension/DependencyHandleScope.kt index 1819124002..595f30cf30 100644 --- a/plugins/src/main/kotlin/extension/DependencyHandleScope.kt +++ b/plugins/src/main/kotlin/extension/DependencyHandleScope.kt @@ -19,6 +19,7 @@ package extension import org.gradle.accessors.dm.LibrariesForLibs import org.gradle.kotlin.dsl.DependencyHandlerScope import org.gradle.kotlin.dsl.project +import org.gradle.api.logging.Logger import java.io.File private fun DependencyHandlerScope.implementation(dependency: Any) = dependencies.add("implementation", dependency) @@ -53,16 +54,21 @@ fun DependencyHandlerScope.composeDependencies(libs: LibrariesForLibs) { implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.5") } -private fun DependencyHandlerScope.addImplementationProjects(directory: File, path: String, nameFilter: String) { +private fun DependencyHandlerScope.addImplementationProjects( + directory: File, + path: String, + nameFilter: String, + logger: Logger, +) { directory.listFiles().orEmpty().also { it.sort() }.forEach { file -> if (file.isDirectory) { val newPath = "$path:${file.name}" val buildFile = File(file, "build.gradle.kts") if (buildFile.exists() && file.name == nameFilter) { implementation(project(newPath)) - println("Added implementation(project($newPath))") + logger.lifecycle("Added implementation(project($newPath))") } else { - addImplementationProjects(file, newPath, nameFilter) + addImplementationProjects(file, newPath, nameFilter, logger) } } } @@ -100,12 +106,12 @@ fun DependencyHandlerScope.allServicesImpl() { implementation(project(":services:toolbox:impl")) } -fun DependencyHandlerScope.allFeaturesApi(rootDir: File) { +fun DependencyHandlerScope.allFeaturesApi(rootDir: File, logger: Logger) { val featuresDir = File(rootDir, "features") - addImplementationProjects(featuresDir, ":features", "api") + addImplementationProjects(featuresDir, ":features", "api", logger) } -fun DependencyHandlerScope.allFeaturesImpl(rootDir: File) { +fun DependencyHandlerScope.allFeaturesImpl(rootDir: File, logger: Logger) { val featuresDir = File(rootDir, "features") - addImplementationProjects(featuresDir, ":features", "impl") + addImplementationProjects(featuresDir, ":features", "impl", logger) } diff --git a/settings.gradle.kts b/settings.gradle.kts index 0fae407502..9b2d507b7e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -62,7 +62,7 @@ fun includeProjects(directory: File, path: String, maxDepth: Int = 1) { val buildFile = File(file, "build.gradle.kts") if (buildFile.exists()) { include(newPath) - println("Included project: $newPath") + logger.lifecycle("Included project: $newPath") } else if (maxDepth > 0) { includeProjects(file, newPath, maxDepth - 1) } diff --git a/tests/uitests/build.gradle.kts b/tests/uitests/build.gradle.kts index e120e55087..307cbcdd5d 100644 --- a/tests/uitests/build.gradle.kts +++ b/tests/uitests/build.gradle.kts @@ -37,5 +37,5 @@ dependencies { implementation(libs.showkase) allLibrariesImpl() - allFeaturesImpl(rootDir) + allFeaturesImpl(rootDir, logger) }