habitica-android/build.gradle

129 lines
4.6 KiB
Groovy
Raw Normal View History

2023-08-08 14:40:00 +00:00
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2015-04-12 11:54:29 +00:00
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
2022-06-10 08:03:36 +00:00
ext {
2022-10-12 15:50:02 +00:00
min_sdk = 21
2023-08-22 14:40:55 +00:00
target_sdk = 33
2022-07-19 16:51:33 +00:00
app_version_name = ''
app_version_code = 0
2022-06-10 08:03:36 +00:00
2022-12-20 12:36:34 +00:00
accompanist_version = '0.28.0'
2023-02-13 13:24:37 +00:00
amplitude_version = '1.6.1'
appcompat_version = '1.6.1'
2023-08-08 14:40:00 +00:00
coil_version = '2.4.0'
2023-10-19 11:03:57 +00:00
compose_version = '1.5.4'
2023-10-02 12:50:26 +00:00
core_ktx_version = '1.12.0'
2023-11-29 13:12:45 +00:00
coroutines_version = '1.7.3'
2023-08-08 14:40:00 +00:00
daggerhilt_version = '2.47'
2023-03-27 13:14:49 +00:00
firebase_bom = '31.3.0'
2023-08-08 14:40:00 +00:00
kotest_version = '5.6.2'
2023-10-02 12:50:26 +00:00
kotlin_version = '1.9.10'
2023-08-08 14:40:00 +00:00
ktlint_version = '0.50.0'
2023-10-02 12:50:26 +00:00
lifecycle_version = '2.6.2'
2022-06-10 08:03:36 +00:00
markwon_version = '4.6.2'
2023-02-13 16:29:12 +00:00
mockk_version = '1.13.4'
2023-08-22 14:40:55 +00:00
moshi_version = '1.15.0'
2023-11-29 13:12:45 +00:00
navigation_version = '2.7.5'
2023-08-08 14:40:00 +00:00
okhttp_version = '4.11.0'
2023-10-02 12:50:26 +00:00
paging_version = '3.2.1'
play_wearables_version = '18.1.0'
play_auth_version = '20.7.0'
2023-08-21 12:53:18 +00:00
preferences_version = '1.2.1'
realm_version = '1.0.2'
2022-07-27 11:04:16 +00:00
retrofit_version = '2.9.0'
2023-11-29 13:12:45 +00:00
recyclerview_version = '1.3.2'
2022-06-10 08:03:36 +00:00
}
2015-04-12 11:54:29 +00:00
repositories {
2017-10-26 13:52:12 +00:00
google()
2017-10-03 13:19:05 +00:00
maven { url "https://plugins.gradle.org/m2/" }
2022-06-02 08:17:28 +00:00
mavenCentral()
2015-04-12 11:54:29 +00:00
}
dependencies {
2023-11-29 13:12:45 +00:00
classpath 'com.android.tools.build:gradle:8.1.4'
2017-10-03 13:19:05 +00:00
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
2023-10-02 12:50:26 +00:00
classpath 'com.google.gms:google-services:4.4.0'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9'
2023-02-23 14:52:51 +00:00
classpath "io.realm:realm-gradle-plugin:10.13.2-transformer-api"
classpath("io.realm.kotlin:gradle-plugin:$realm_version")
2017-10-03 13:19:05 +00:00
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
2022-01-06 12:36:08 +00:00
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.19.0"
2022-09-26 11:05:22 +00:00
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$navigation_version"
2022-10-31 14:12:55 +00:00
classpath 'com.google.firebase:perf-plugin:1.4.2'
2022-06-10 08:03:36 +00:00
classpath "com.google.dagger:hilt-android-gradle-plugin:$daggerhilt_version"
2023-03-27 13:14:49 +00:00
classpath "org.jlleitschuh.gradle:ktlint-gradle:11.3.1"
2015-04-12 11:54:29 +00:00
}
}
2017-10-03 13:19:05 +00:00
apply plugin: 'io.gitlab.arturbosch.detekt'
allprojects {
2023-02-13 13:24:37 +00:00
apply plugin: "org.jlleitschuh.gradle.ktlint"
repositories {
2017-10-26 13:52:12 +00:00
google()
2022-03-31 13:07:59 +00:00
mavenCentral()
2017-10-03 13:19:05 +00:00
}
2023-02-23 14:52:51 +00:00
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))
}
}
}
}
2017-10-03 13:19:05 +00:00
}
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'
android.buildTypes.release.signingConfig = null
}
2017-10-03 13:19:05 +00:00
detekt {
2022-03-21 11:56:29 +00:00
source = files("Habitica/src/main/java")
config = files("detekt.yml")
2021-09-14 11:41:33 +00:00
baseline = file("${rootProject.projectDir}/detekt_baseline.xml")
2022-03-21 11:56:29 +00:00
}
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) {
2023-08-08 14:40:00 +00:00
tasks = [':Habitica:testProdDebugUnitTest', ':wearos:testProdDebugUnitTest', ':common:testProdDebugUnitTest']
2023-02-23 14:52:51 +00:00
}
2023-04-27 09:25:23 +00:00
subprojects {
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions.jvmTarget = "11"
}
}