// Top-level build file where you can add configuration options common to all sub-projects/modules. import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask @Suppress("DSL_SCOPE_VIOLATION") plugins { alias(libs.plugins.android.application) apply false alias(libs.plugins.android.library) apply false alias(libs.plugins.kotlin.android) apply false alias(libs.plugins.android.junit5) apply false alias(libs.plugins.hilt) apply false alias(libs.plugins.gradle.versions) alias(libs.plugins.gradle.versions.update) } fun isNonStable(version: String): Boolean { // val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.toUpperCase().contains(it) } val unstableKeyword = listOf("ALPHA", "BETA", "RC").any { version.toUpperCase().contains(it) } val regex = "^[0-9,.v-]+(-r)?$".toRegex() return unstableKeyword || regex.matches(version).not() } tasks.withType { rejectVersionIf { isNonStable(candidate.version) } checkConstraints = true checkBuildEnvironmentConstraints = true outputFormatter = "json" outputDir = "build/dependencyUpdates" reportfileName = "report" } versionCatalogUpdate { keep { // keep versions without any library or plugin reference keepUnusedVersions.set(true) // keep all libraries that aren't used in the project keepUnusedLibraries.set(true) // keep all plugins that aren't used in the project keepUnusedPlugins.set(true) } } buildscript { extra.apply { // This is required as of Android Studio 4.1, this is required for modules/libraries since VERSION_CODE and VERSION_NAME is no longer included in the generated build config // See: https://issuetracker.google.com/issues/158695880 // Use this field to set the major/minor/patch numbers for the whole app. set("versionName", "1.0.0") // Use this field to set the VersionCode for the whole app, this should not updated manually, but via `fastlane BumpReleaseVersion` set("versionCode", 905) } val libs = extensions.getByType().named("libs") dependencies { classpath(libs.findLibrary("android-navigation-gradlePlugin").get()) } } tasks.create("clean") { delete(rootProject.buildDir) delete("${rootProject.rootDir}/qa-reports") } project.afterEvaluate { tasks.create("runAllUnitTests") { dependsOn( "app:testProjectEnvDebugUnitTest", "api:testProjectEnvDebugUnitTest", "repo:testProjectEnvDebugUnitTest", "shared:testProjectEnvDebugUnitTest", ) } tasks.create("generateReports") { dependsOn( "app:customJacocoTestReport", "api:customJacocoTestReport", "repo:customJacocoTestReport", "shared:customJacocoTestReport", ) } }