import org.jetbrains.kotlin.gradle.tasks.KotlinCompile // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext { min_sdk = 21 target_sdk = 34 wearos_target_sdk = 33 app_version_name = '' app_version_code = 0 accompanist_version = '0.30.0' amplitude_version = '1.6.1' appcompat_version = '1.7.0' coil_version = '2.4.0' compose_version = '1.6.8' compose_compiler = '1.5.14' core_ktx_version = '1.13.1' coroutines_version = '1.8.0' daggerhilt_version = '2.51.1' firebase_bom = '31.3.0' kotest_version = '5.6.2' kotlin_version = '2.0.20' ktlint_version = '1.2.1' lifecycle_version = '2.8.4' markwon_version = '4.6.2' mockk_version = '1.13.4' moshi_version = '1.15.0' navigation_version = '2.7.7' okhttp_version = '4.12.0' paging_version = '3.3.0' play_wearables_version = '18.2.0' play_auth_version = '21.2.0' preferences_version = '1.2.1' realm_version = '1.9.1' retrofit_version = '2.9.0' recyclerview_version = '1.3.2' } repositories { google() maven { url "https://plugins.gradle.org/m2/" } mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:8.7.2' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' classpath 'com.google.gms:google-services:4.4.2' classpath 'com.google.firebase:firebase-crashlytics-gradle:3.0.2' classpath "io.realm:realm-gradle-plugin:10.19.0" classpath("io.realm.kotlin:gradle-plugin:$realm_version") classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.19.0" classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$navigation_version" classpath 'com.google.firebase:perf-plugin:1.4.2' classpath "com.google.dagger:hilt-android-gradle-plugin:$daggerhilt_version" classpath "org.jlleitschuh.gradle:ktlint-gradle:11.3.1" classpath "org.jetbrains.kotlin:compose-compiler-gradle-plugin:$kotlin_version" } } apply plugin: 'io.gitlab.arturbosch.detekt' allprojects { apply plugin: "org.jlleitschuh.gradle.ktlint" repositories { google() mavenCentral() } tasks.withType(Test).configureEach { testLogging { events "passed", "skipped", "failed", "standardError" outputs.upToDateWhen {false} afterSuite { desc, result -> if (!desc.parent) { // will match the outermost suite def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)" def startItem = '| ', endItem = ' |' def repeatLength = startItem.length() + output.length() + endItem.length() println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength)) } } } } } Properties props = new Properties() def propFile = new File('version.properties') if (propFile.canRead()) { props.load(new FileInputStream(propFile)) if (props != null && props.containsKey('NAME') && props.containsKey('CODE') ) { ext.app_version_name = props['NAME'] ext.app_version_code = props['CODE'] as Integer } else { println 'signing.properties found but some entries are missing' android.buildTypes.release.signingConfig = null } } else { println 'signing.properties not found' } detekt { source = files("Habitica/src/main/java") config = files("detekt.yml") baseline = file("${rootProject.projectDir}/detekt_baseline.xml") } ktlint { filter { exclude { entry -> entry.file.toString().contains("generated") } } } tasks.named("detekt").configure { reports { xml.required.set(false) html.required.set(true) html.outputLocation.set(file("build/reports/detekt.html")) txt.required.set(false) sarif.required.set(true) sarif.outputLocation.set(file("build/reports/detekt.sarif")) } } task allUnitTests(type: GradleBuild) { tasks = [':Habitica:testProdDebugUnitTest', ':wearos:testProdDebugUnitTest', ':common:testProdDebugUnitTest'] } subprojects { tasks.withType(KotlinCompile).configureEach { kotlinOptions.jvmTarget = "11" } }