2023-02-13 14:59:46 +00:00
|
|
|
import com.android.build.gradle.BaseExtension
|
2022-12-07 02:58:28 +00:00
|
|
|
import com.android.build.gradle.BasePlugin
|
2023-01-24 18:01:57 +00:00
|
|
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
2021-05-28 11:26:19 +00:00
|
|
|
|
2023-02-13 14:59:46 +00:00
|
|
|
@Suppress("DSL_SCOPE_VIOLATION")
|
2023-01-08 02:14:00 +00:00
|
|
|
plugins {
|
|
|
|
alias(libs.plugins.android.application) apply false
|
|
|
|
alias(libs.plugins.android.library) apply false
|
|
|
|
alias(libs.plugins.android.lint) apply false
|
|
|
|
alias(libs.plugins.ksp) apply false
|
|
|
|
alias(libs.plugins.kotlin.android) apply false
|
|
|
|
alias(libs.plugins.kotlin.parcelize) apply false
|
|
|
|
alias(libs.plugins.kotlin.jvm) apply false
|
2023-02-13 16:18:33 +00:00
|
|
|
|
|
|
|
id("app.k9mail.gradle.plugin.quality.spotless")
|
2013-05-25 21:14:46 +00:00
|
|
|
}
|
|
|
|
|
2023-02-13 14:59:46 +00:00
|
|
|
val propertyTestCoverage: String? by extra
|
2014-08-30 23:10:13 +00:00
|
|
|
|
2023-02-13 14:59:46 +00:00
|
|
|
val javaVersion = JavaVersion.VERSION_11
|
|
|
|
val jvmTargetVersion = JvmTarget.JVM_11
|
2023-01-24 18:01:57 +00:00
|
|
|
|
2022-12-07 04:19:41 +00:00
|
|
|
allprojects {
|
2023-02-13 14:59:46 +00:00
|
|
|
extra.apply {
|
|
|
|
set("testCoverage", propertyTestCoverage != null)
|
|
|
|
}
|
|
|
|
|
2023-01-24 18:09:37 +00:00
|
|
|
configurations.configureEach {
|
2021-10-30 00:31:37 +00:00
|
|
|
resolutionStrategy.dependencySubstitution {
|
2023-02-13 14:59:46 +00:00
|
|
|
substitute(module("androidx.core:core"))
|
|
|
|
.using(module("androidx.core:core:${libs.versions.androidxCore.get()}"))
|
|
|
|
substitute(module("androidx.activity:activity"))
|
|
|
|
.using(module("androidx.activity:activity:${libs.versions.androidxActivity.get()}"))
|
|
|
|
substitute(module("androidx.activity:activity-ktx"))
|
|
|
|
.using(module("androidx.activity:activity-ktx:${libs.versions.androidxActivity.get()}"))
|
|
|
|
substitute(module("androidx.fragment:fragment"))
|
|
|
|
.using(module("androidx.fragment:fragment:${libs.versions.androidxFragment.get()}"))
|
|
|
|
substitute(module("androidx.fragment:fragment-ktx"))
|
|
|
|
.using(module("androidx.fragment:fragment-ktx:${libs.versions.androidxFragment.get()}"))
|
|
|
|
substitute(module("androidx.appcompat:appcompat"))
|
|
|
|
.using(module("androidx.appcompat:appcompat:${libs.versions.androidxAppCompat.get()}"))
|
|
|
|
substitute(module("androidx.preference:preference"))
|
|
|
|
.using(module("androidx.preference:preference:${libs.versions.androidxPreference.get()}"))
|
|
|
|
substitute(module("androidx.recyclerview:recyclerview"))
|
|
|
|
.using(module("androidx.recyclerview:recyclerview:${libs.versions.androidxRecyclerView.get()}"))
|
|
|
|
substitute(module("androidx.constraintlayout:constraintlayout"))
|
|
|
|
.using(module("androidx.constraintlayout:constraintlayout:${libs.versions.androidxConstraintLayout.get()}"))
|
|
|
|
substitute(module("androidx.drawerlayout:drawerlayout"))
|
|
|
|
.using(module("androidx.drawerlayout:drawerlayout:${libs.versions.androidxDrawerLayout.get()}"))
|
|
|
|
substitute(module("androidx.lifecycle:lifecycle-livedata"))
|
|
|
|
.using(module("androidx.lifecycle:lifecycle-livedata:${libs.versions.androidxLifecycle.get()}"))
|
|
|
|
substitute(module("androidx.transition:transition"))
|
|
|
|
.using(module("androidx.transition:transition:${libs.versions.androidxTransition.get()}"))
|
|
|
|
substitute(module("org.jetbrains:annotations"))
|
|
|
|
.using(module("org.jetbrains:annotations:${libs.versions.jetbrainsAnnotations.get()}"))
|
|
|
|
substitute(module("org.jetbrains.kotlin:kotlin-stdlib"))
|
|
|
|
.using(module("org.jetbrains.kotlin:kotlin-stdlib:${libs.versions.kotlin.get()}"))
|
|
|
|
substitute(module("org.jetbrains.kotlin:kotlin-stdlib-jdk7"))
|
|
|
|
.using(module("org.jetbrains.kotlin:kotlin-stdlib-jdk7:${libs.versions.kotlin.get()}"))
|
|
|
|
substitute(module("org.jetbrains.kotlin:kotlin-stdlib-jdk8"))
|
|
|
|
.using(module("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${libs.versions.kotlin.get()}"))
|
|
|
|
substitute(module("org.jetbrains.kotlinx:kotlinx-coroutines-android"))
|
|
|
|
.using(module("org.jetbrains.kotlinx:kotlinx-coroutines-android:${libs.versions.kotlinCoroutines.get()}"))
|
2021-10-30 00:31:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-13 14:59:46 +00:00
|
|
|
plugins.withType<BasePlugin> {
|
|
|
|
configure<BaseExtension> {
|
|
|
|
compileSdkVersion(33)
|
2022-12-07 02:58:28 +00:00
|
|
|
|
|
|
|
defaultConfig {
|
2023-02-13 14:59:46 +00:00
|
|
|
minSdk = 21
|
|
|
|
targetSdk = 31
|
2022-12-07 02:58:28 +00:00
|
|
|
|
|
|
|
vectorDrawables.useSupportLibrary = true
|
2023-02-13 14:59:46 +00:00
|
|
|
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
2022-12-07 02:58:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
compileOptions {
|
2023-02-13 14:59:46 +00:00
|
|
|
sourceCompatibility = javaVersion
|
|
|
|
targetCompatibility = javaVersion
|
2022-12-07 02:58:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
lintOptions {
|
2023-02-13 14:59:46 +00:00
|
|
|
isAbortOnError = false
|
|
|
|
lintConfig = file("${rootProject.projectDir}/config/lint/lint.xml")
|
2022-12-07 02:58:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
testOptions {
|
|
|
|
unitTests {
|
2023-02-13 14:59:46 +00:00
|
|
|
isIncludeAndroidResources = true
|
2022-12-07 02:58:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-13 14:59:46 +00:00
|
|
|
plugins.withType<JavaPlugin> {
|
|
|
|
configure<JavaPluginExtension> {
|
2023-01-24 18:01:57 +00:00
|
|
|
sourceCompatibility = javaVersion
|
|
|
|
targetCompatibility = javaVersion
|
2022-12-07 07:03:37 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-13 14:59:46 +00:00
|
|
|
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
|
|
|
|
kotlinOptions.jvmTarget = jvmTargetVersion.target
|
2020-09-19 19:55:25 +00:00
|
|
|
}
|
2020-10-16 12:14:12 +00:00
|
|
|
|
2023-02-13 14:59:46 +00:00
|
|
|
tasks.withType<Test> {
|
|
|
|
testLogging {
|
|
|
|
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
|
|
|
|
showCauses = true
|
|
|
|
showExceptions = true
|
|
|
|
showStackTraces = true
|
2021-05-28 11:26:19 +00:00
|
|
|
}
|
|
|
|
}
|
2014-08-30 23:10:13 +00:00
|
|
|
}
|
2022-01-28 03:07:22 +00:00
|
|
|
|
2023-02-13 14:59:46 +00:00
|
|
|
tasks.register("testsOnCi") {
|
|
|
|
dependsOn(
|
|
|
|
subprojects.map { project -> project.tasks.withType(Test::class.java) }
|
2022-01-28 03:07:22 +00:00
|
|
|
.flatten()
|
2023-02-13 14:59:46 +00:00
|
|
|
.filterNot { task -> task.name in arrayOf("testDebugUnitTest", "test") }
|
|
|
|
)
|
2022-01-28 03:07:22 +00:00
|
|
|
}
|