2022-12-07 02:58:28 +00:00
|
|
|
import com.android.build.gradle.BasePlugin
|
2022-12-07 07:03:37 +00:00
|
|
|
import org.gradle.api.plugins.JavaPlugin
|
2021-05-28 11:26:19 +00:00
|
|
|
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
|
|
|
|
|
2013-05-25 21:14:46 +00:00
|
|
|
buildscript {
|
2018-05-23 13:57:04 +00:00
|
|
|
ext {
|
2018-05-23 17:36:52 +00:00
|
|
|
buildConfig = [
|
2022-02-15 15:37:51 +00:00
|
|
|
'robolectricSdk': 31
|
2018-05-23 17:36:52 +00:00
|
|
|
]
|
2018-05-23 13:57:04 +00:00
|
|
|
|
2022-09-05 13:27:05 +00:00
|
|
|
// 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.
|
2018-05-23 17:36:52 +00:00
|
|
|
versions = [
|
2022-12-07 03:24:38 +00:00
|
|
|
'kotlin': '1.7.22',
|
2022-08-05 14:07:46 +00:00
|
|
|
'kotlinCoroutines': '1.6.4',
|
2022-05-01 23:53:00 +00:00
|
|
|
'jetbrainsAnnotations': '23.0.0',
|
2022-09-20 16:39:22 +00:00
|
|
|
'androidxAppCompat': '1.5.1',
|
2022-10-10 15:10:25 +00:00
|
|
|
'androidxActivity': '1.6.0',
|
2021-10-30 01:33:49 +00:00
|
|
|
'androidxRecyclerView': '1.2.1',
|
2022-08-05 14:46:04 +00:00
|
|
|
'androidxLifecycle': '2.5.1',
|
2022-10-10 15:15:58 +00:00
|
|
|
'androidxAnnotation': '1.5.0',
|
2021-08-17 16:24:58 +00:00
|
|
|
'androidxBiometric': '1.1.0',
|
2022-09-20 16:43:02 +00:00
|
|
|
'androidxNavigation': '2.5.2',
|
2022-08-05 14:55:52 +00:00
|
|
|
'androidxConstraintLayout': '2.1.4',
|
2022-03-03 19:55:22 +00:00
|
|
|
'androidxWorkManager': '2.7.1',
|
2022-10-10 15:17:50 +00:00
|
|
|
'androidxFragment': '1.5.3',
|
2022-03-03 23:16:12 +00:00
|
|
|
'androidxLocalBroadcastManager': '1.1.0',
|
2022-09-20 17:00:24 +00:00
|
|
|
'androidxCore': '1.9.0',
|
2020-04-04 23:01:21 +00:00
|
|
|
'androidxCardView': '1.0.0',
|
2022-03-03 20:29:23 +00:00
|
|
|
'androidxPreference': '1.2.0',
|
2022-09-28 10:11:02 +00:00
|
|
|
'androidxDrawerLayout': '1.1.1',
|
|
|
|
'androidxTransition': '1.4.1',
|
2021-10-30 01:38:55 +00:00
|
|
|
'androidxTestCore': '1.4.0',
|
2022-08-05 20:49:06 +00:00
|
|
|
'materialComponents': '1.6.1',
|
2022-10-10 15:25:32 +00:00
|
|
|
'fastAdapter': '5.7.0',
|
2019-11-28 16:26:29 +00:00
|
|
|
'preferencesFix': '1.1.0',
|
2022-08-05 19:59:43 +00:00
|
|
|
'okio': '3.2.0',
|
2022-09-20 17:03:31 +00:00
|
|
|
'moshi': '1.14.0',
|
2021-10-30 01:43:52 +00:00
|
|
|
'timber': '5.0.1',
|
2022-10-10 15:54:51 +00:00
|
|
|
'koin': '3.2.2',
|
2022-09-05 12:47:11 +00:00
|
|
|
// 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
|
2021-11-15 17:06:18 +00:00
|
|
|
'commonsIo': '2.6',
|
2021-10-30 02:25:44 +00:00
|
|
|
'mime4j': '0.8.6',
|
2022-08-05 20:27:27 +00:00
|
|
|
'okhttp': '4.10.0',
|
2022-09-05 00:57:42 +00:00
|
|
|
'minidns': '1.0.4',
|
2022-10-10 16:24:25 +00:00
|
|
|
'glide': '4.14.2',
|
2022-09-05 00:57:42 +00:00
|
|
|
'jsoup': '1.15.3',
|
2022-09-05 11:40:21 +00:00
|
|
|
'httpClient': '4.5.13',
|
2019-01-16 12:52:46 +00:00
|
|
|
|
2021-10-30 02:31:13 +00:00
|
|
|
'androidxTestRunner': '1.4.0',
|
2021-04-21 23:49:06 +00:00
|
|
|
'junit': '4.13.2',
|
2022-10-10 16:34:09 +00:00
|
|
|
'robolectric': '4.9',
|
2022-09-20 17:13:46 +00:00
|
|
|
'mockito': '4.8.0',
|
2021-10-30 02:49:09 +00:00
|
|
|
'mockitoKotlin': '4.0.0',
|
2021-10-30 02:50:40 +00:00
|
|
|
'truth': '1.1.3',
|
2022-10-10 16:36:24 +00:00
|
|
|
'turbine': '0.11.0',
|
2020-10-16 12:14:12 +00:00
|
|
|
|
2022-09-05 00:57:01 +00:00
|
|
|
'ktlint': '0.44.0'
|
2018-05-23 17:36:52 +00:00
|
|
|
]
|
2019-11-13 15:10:14 +00:00
|
|
|
|
2019-11-13 15:35:38 +00:00
|
|
|
javaVersion = JavaVersion.VERSION_1_8
|
2019-11-17 13:40:57 +00:00
|
|
|
kotlinJvmVersion = "1.8"
|
2018-05-23 13:57:04 +00:00
|
|
|
}
|
|
|
|
|
2014-09-18 13:18:41 +00:00
|
|
|
repositories {
|
2018-10-24 01:29:21 +00:00
|
|
|
mavenCentral()
|
2018-02-17 03:05:09 +00:00
|
|
|
google()
|
2019-11-26 20:37:40 +00:00
|
|
|
maven { url "https://plugins.gradle.org/m2/" }
|
2014-09-18 13:18:41 +00:00
|
|
|
}
|
2013-05-25 21:14:46 +00:00
|
|
|
|
2014-09-18 13:18:41 +00:00
|
|
|
dependencies {
|
2022-12-07 03:24:38 +00:00
|
|
|
classpath 'com.android.tools.build:gradle:7.3.1'
|
2018-05-23 17:36:52 +00:00
|
|
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}"
|
2022-09-05 00:57:01 +00:00
|
|
|
classpath "org.jlleitschuh.gradle:ktlint-gradle:11.0.0"
|
2014-09-18 13:18:41 +00:00
|
|
|
}
|
2013-05-25 21:14:46 +00:00
|
|
|
}
|
|
|
|
|
2015-12-21 01:11:37 +00:00
|
|
|
project.ext {
|
|
|
|
testCoverage = project.hasProperty('testCoverage')
|
|
|
|
}
|
2014-08-30 23:10:13 +00:00
|
|
|
|
|
|
|
subprojects {
|
2021-10-30 00:31:37 +00:00
|
|
|
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}")
|
2022-09-28 10:11:02 +00:00
|
|
|
substitute module("androidx.activity:activity-ktx") using module("androidx.activity:activity-ktx:${versions.androidxActivity}")
|
|
|
|
substitute module("androidx.fragment:fragment") using module("androidx.fragment:fragment:${versions.androidxFragment}")
|
|
|
|
substitute module("androidx.fragment:fragment-ktx") using module("androidx.fragment:fragment-ktx:${versions.androidxFragment}")
|
2021-10-30 00:31:37 +00:00
|
|
|
substitute module("androidx.appcompat:appcompat") using module("androidx.appcompat:appcompat:${versions.androidxAppCompat}")
|
|
|
|
substitute module("androidx.preference:preference") using module("androidx.preference:preference:${versions.androidxPreference}")
|
2022-09-28 10:11:02 +00:00
|
|
|
substitute module("androidx.recyclerview:recyclerview") using module("androidx.recyclerview:recyclerview:${versions.androidxRecyclerView}")
|
|
|
|
substitute module("androidx.constraintlayout:constraintlayout") using module("androidx.constraintlayout:constraintlayout:${versions.androidxConstraintLayout}")
|
|
|
|
substitute module("androidx.drawerlayout:drawerlayout") using module("androidx.drawerlayout:drawerlayout:${versions.androidxDrawerLayout}")
|
|
|
|
substitute module("androidx.lifecycle:lifecycle-livedata") using module("androidx.lifecycle:lifecycle-livedata:${versions.androidxLifecycle}")
|
|
|
|
substitute module("androidx.transition:transition") using module("androidx.transition:transition:${versions.androidxTransition}")
|
|
|
|
substitute module("org.jetbrains:annotations") using module("org.jetbrains:annotations:${versions.jetbrainsAnnotations}")
|
|
|
|
substitute module("org.jetbrains.kotlin:kotlin-stdlib") using module("org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlin}")
|
|
|
|
substitute module("org.jetbrains.kotlin:kotlin-stdlib-jdk7") using module("org.jetbrains.kotlin:kotlin-stdlib-jdk7:${versions.kotlin}")
|
|
|
|
substitute module("org.jetbrains.kotlin:kotlin-stdlib-jdk8") using module("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${versions.kotlin}")
|
|
|
|
substitute module("org.jetbrains.kotlinx:kotlinx-coroutines-android") using module("org.jetbrains.kotlinx:kotlinx-coroutines-android:${versions.kotlinCoroutines}")
|
2021-10-30 00:31:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-07 02:58:28 +00:00
|
|
|
plugins.withType(BasePlugin).configureEach {
|
|
|
|
project.android {
|
|
|
|
compileSdk 33
|
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
minSdk 21
|
|
|
|
targetSdk 31
|
|
|
|
|
|
|
|
vectorDrawables.useSupportLibrary = true
|
|
|
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
|
|
}
|
|
|
|
|
|
|
|
compileOptions {
|
|
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
|
|
}
|
|
|
|
|
|
|
|
lintOptions {
|
|
|
|
abortOnError false
|
|
|
|
lintConfig file("$rootProject.projectDir/config/lint/lint.xml")
|
|
|
|
}
|
|
|
|
|
|
|
|
testOptions {
|
|
|
|
unitTests {
|
|
|
|
includeAndroidResources = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-12-07 07:03:37 +00:00
|
|
|
plugins.withType(JavaPlugin).configureEach {
|
|
|
|
project.java {
|
|
|
|
sourceCompatibility = javaVersion
|
|
|
|
targetCompatibility = javaVersion
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-19 19:55:25 +00:00
|
|
|
tasks.withType(Test) {
|
|
|
|
testLogging {
|
|
|
|
exceptionFormat "full"
|
|
|
|
showCauses true
|
|
|
|
showExceptions true
|
|
|
|
showStackTraces true
|
|
|
|
}
|
|
|
|
}
|
2020-10-16 12:14:12 +00:00
|
|
|
|
2021-05-28 11:26:19 +00:00
|
|
|
tasks.withType(KotlinCompile) {
|
|
|
|
kotlinOptions {
|
2022-08-09 11:01:50 +00:00
|
|
|
freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn"
|
2021-05-28 11:26:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-16 12:14:12 +00:00
|
|
|
apply plugin: 'org.jlleitschuh.gradle.ktlint'
|
|
|
|
ktlint {
|
|
|
|
version = versions.ktlint
|
|
|
|
}
|
2014-08-30 23:10:13 +00:00
|
|
|
}
|
2022-01-28 03:07:22 +00:00
|
|
|
|
|
|
|
tasks.register('testsOnCi') {
|
|
|
|
dependsOn getSubprojects()
|
|
|
|
.collect { project -> project.tasks.withType(Test) }
|
|
|
|
.flatten()
|
|
|
|
.findAll { task -> task.name in ['testDebugUnitTest', 'test'] }
|
|
|
|
}
|