-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle.kts
57 lines (50 loc) · 1.38 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
import com.android.build.gradle.internal.dsl.LintOptions
import io.gitlab.arturbosch.detekt.Detekt
import org.jlleitschuh.gradle.ktlint.KtlintPlugin
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.4.2")
classpath("com.google.dagger:hilt-android-gradle-plugin:${libs.versions.hilt.get()}")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0")
}
}
plugins {
alias(libs.plugins.detekt)
alias(libs.plugins.ktlint)
}
allprojects {
repositories {
google()
mavenCentral()
}
}
subprojects {
apply<KtlintPlugin>()
afterEvaluate {
if (plugins.hasPlugin("android") || plugins.hasPlugin("android-library")) {
if (extensions.findByName("LintOptions") == true) {
extensions.getByType<LintOptions>().apply {
isAbortOnError = false
isCheckAllWarnings = true
}
}
}
}
}
tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}
tasks.register("detektCheck", Detekt::class) {
parallel = true
setSource(files(projectDir))
include("**/*.kt")
include("**/*.kts")
exclude("**/resources/**")
exclude("**/build/**")
config.setFrom(files("$rootDir/detekt.yml"))
buildUponDefaultConfig = false
}