-
Notifications
You must be signed in to change notification settings - Fork 52
/
build.gradle.kts
58 lines (54 loc) · 1.92 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import com.android.build.gradle.BaseExtension
import com.android.build.gradle.BasePlugin
import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.extensions.DetektExtension
import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.kotlin.dokka) apply false
alias(libs.plugins.detekt) apply false
}
subprojects {
tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
allWarningsAsErrors = true
progressiveMode = true
jvmTarget = JvmTarget.JVM_11
}
if ((this@subprojects.name != "sample")) {
explicitApiMode = ExplicitApiMode.Strict
}
}
plugins.withType<BasePlugin>().configureEach {
extensions.configure<BaseExtension> {
compileSdkVersion(libs.versions.androidconfig.compileSdk.get().toInt())
buildToolsVersion(libs.versions.androidconfig.buildTools.get())
defaultConfig {
minSdk = libs.versions.androidconfig.minSdk.get().toInt()
targetSdk = libs.versions.androidconfig.targetSdk.get().toInt()
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}
}
apply(plugin = rootProject.libs.plugins.detekt.get().pluginId)
extensions.configure<DetektExtension> {
toolVersion = rootProject.libs.versions.detekt.get()
config.setFrom(files("$rootDir/detekt.yml"))
buildUponDefaultConfig = true
ignoredBuildTypes = listOf("release")
}
dependencies {
add("detektPlugins", rootProject.libs.detektFormatting)
}
tasks.withType<Detekt>().configureEach {
jvmTarget = JvmTarget.JVM_11.target
}
}