diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index e668c17275..86e823f335 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -9,7 +9,7 @@ on: # Enrich gradle.properties for CI/CD env: GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3072m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -XX:MaxMetaspaceSize=512m -Dkotlin.daemon.jvm.options="-Xmx2g" -Dkotlin.incremental=false - CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 2 --no-daemon + CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 2 --no-daemon --warn jobs: check: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7b6e5eaf7d..aea05b5a22 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,7 +9,7 @@ on: # Enrich gradle.properties for CI/CD env: GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3072m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.daemon.jvm.options="-Xmx2560m" -Dkotlin.incremental=false - CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 4 + CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 4 --warn jobs: tests: diff --git a/app/build.gradle.kts b/app/build.gradle.kts index da9a4ab3e9..d4e889adc1 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -206,15 +206,14 @@ knit { dependencies { allLibrariesImpl() allServicesImpl() - allFeaturesImpl(rootDir) + allFeaturesImpl(rootDir, logger) implementation(projects.libraries.deeplink) implementation(projects.tests.uitests) implementation(projects.anvilannotations) implementation(projects.appnav) anvil(projects.anvilcodegen) - // https://developer.android.com/studio/write/java8-support#library-desugaring-versions - coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.3") + coreLibraryDesugaring(libs.android.desugar) implementation(libs.appyx.core) implementation(libs.androidx.splash) implementation(libs.androidx.core) 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/gradle/libs.versions.toml b/gradle/libs.versions.toml index b32859cca1..9f6b9c7d63 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -53,6 +53,8 @@ dependencygraph = "0.10" [libraries] # Project android_gradle_plugin = { module = "com.android.tools.build:gradle", version.ref = "android_gradle_plugin" } +# https://developer.android.com/studio/write/java8-support#library-desugaring-versions +android_desugar = "com.android.tools:desugar_jdk_libs:2.0.3" kotlin_gradle_plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } # https://firebase.google.com/docs/android/setup#available-libraries google_firebase_bom = "com.google.firebase:firebase-bom:32.0.0" diff --git a/plugins/src/main/kotlin/extension/DependencyHandleScope.kt b/plugins/src/main/kotlin/extension/DependencyHandleScope.kt index c433ed2e07..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) { - directory.listFiles().orEmpty().forEach { file -> +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,11 +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/samples/minimal/build.gradle.kts b/samples/minimal/build.gradle.kts index 73e09d2314..78212a1b9c 100644 --- a/samples/minimal/build.gradle.kts +++ b/samples/minimal/build.gradle.kts @@ -61,5 +61,5 @@ dependencies { implementation(projects.features.login.impl) implementation(projects.features.networkmonitor.impl) implementation(libs.coroutines.core) - coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.3") + coreLibraryDesugaring(libs.android.desugar) } diff --git a/settings.gradle.kts b/settings.gradle.kts index 1173288adb..9b2d507b7e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -56,13 +56,13 @@ include(":anvilcodegen") include(":samples:minimal") fun includeProjects(directory: File, path: String, maxDepth: Int = 1) { - directory.listFiles().orEmpty().forEach { file -> + 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()) { 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) }