125 lines
4.3 KiB
Groovy
125 lines
4.3 KiB
Groovy
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
|
|
|
|
buildscript {
|
|
ext {
|
|
buildConfig = [
|
|
'compileSdk': 33,
|
|
'targetSdk': 31,
|
|
'minSdk': 21,
|
|
'buildTools': '32.0.0',
|
|
'robolectricSdk': 31
|
|
]
|
|
|
|
// Judging the impact of newer library versions on the app requires being intimately familiar with the code
|
|
// base. Please don't open pull requests upgrading dependencies if you're a new contributor.
|
|
versions = [
|
|
'kotlin': '1.7.10',
|
|
'kotlinCoroutines': '1.6.4',
|
|
'jetbrainsAnnotations': '23.0.0',
|
|
'androidxAppCompat': '1.5.0',
|
|
'androidxActivity': '1.5.1',
|
|
'androidxRecyclerView': '1.2.1',
|
|
'androidxLifecycle': '2.5.1',
|
|
'androidxAnnotation': '1.4.0',
|
|
'androidxBiometric': '1.1.0',
|
|
'androidxNavigation': '2.5.1',
|
|
'androidxConstraintLayout': '2.1.4',
|
|
'androidxWorkManager': '2.7.1',
|
|
'androidxFragment': '1.5.2',
|
|
'androidxLocalBroadcastManager': '1.1.0',
|
|
'androidxCore': '1.8.0',
|
|
'androidxCardView': '1.0.0',
|
|
'androidxPreference': '1.2.0',
|
|
'androidxTestCore': '1.4.0',
|
|
'materialComponents': '1.6.1',
|
|
'fastAdapter': '5.6.0',
|
|
'preferencesFix': '1.1.0',
|
|
'okio': '3.2.0',
|
|
'moshi': '1.13.0',
|
|
'timber': '5.0.1',
|
|
'koin': '3.2.0',
|
|
// We can't upgrade Commons IO beyond this version because starting with 2.7 it is using Java 8 API
|
|
// that is not available until Android API 26 (even with desugaring enabled).
|
|
// See https://issuetracker.google.com/issues/160484830
|
|
'commonsIo': '2.6',
|
|
'mime4j': '0.8.6',
|
|
'okhttp': '4.10.0',
|
|
'minidns': '1.0.3',
|
|
'glide': '4.13.2',
|
|
'jsoup': '1.15.2',
|
|
|
|
'androidxTestRunner': '1.4.0',
|
|
'junit': '4.13.2',
|
|
'robolectric': '4.8.1',
|
|
'mockito': '4.6.1',
|
|
'mockitoKotlin': '4.0.0',
|
|
'truth': '1.1.3',
|
|
'turbine': '0.9.0',
|
|
|
|
'ktlint': '0.44.0'
|
|
]
|
|
|
|
javaVersion = JavaVersion.VERSION_1_8
|
|
kotlinJvmVersion = "1.8"
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
google()
|
|
maven { url "https://plugins.gradle.org/m2/" }
|
|
}
|
|
|
|
dependencies {
|
|
classpath 'com.android.tools.build:gradle:7.2.2'
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
|
|
classpath "org.jlleitschuh.gradle:ktlint-gradle:11.0.0"
|
|
}
|
|
}
|
|
|
|
project.ext {
|
|
testCoverage = project.hasProperty('testCoverage')
|
|
}
|
|
|
|
subprojects {
|
|
repositories {
|
|
mavenCentral()
|
|
google()
|
|
maven { url 'https://jitpack.io' }
|
|
}
|
|
|
|
configurations.all {
|
|
resolutionStrategy.dependencySubstitution {
|
|
substitute module("androidx.core:core") using module("androidx.core:core:${versions.androidxCore}")
|
|
substitute module("androidx.activity:activity") using module("androidx.activity:activity:${versions.androidxActivity}")
|
|
substitute module("androidx.appcompat:appcompat") using module("androidx.appcompat:appcompat:${versions.androidxAppCompat}")
|
|
substitute module("androidx.preference:preference") using module("androidx.preference:preference:${versions.androidxPreference}")
|
|
}
|
|
}
|
|
|
|
tasks.withType(Test) {
|
|
testLogging {
|
|
exceptionFormat "full"
|
|
showCauses true
|
|
showExceptions true
|
|
showStackTraces true
|
|
}
|
|
}
|
|
|
|
tasks.withType(KotlinCompile) {
|
|
kotlinOptions {
|
|
freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
|
|
}
|
|
}
|
|
|
|
apply plugin: 'org.jlleitschuh.gradle.ktlint'
|
|
ktlint {
|
|
version = versions.ktlint
|
|
}
|
|
}
|
|
|
|
tasks.register('testsOnCi') {
|
|
dependsOn getSubprojects()
|
|
.collect { project -> project.tasks.withType(Test) }
|
|
.flatten()
|
|
.findAll { task -> task.name in ['testDebugUnitTest', 'test'] }
|
|
}
|