-
Notifications
You must be signed in to change notification settings - Fork 19
/
build.gradle.kts
56 lines (49 loc) · 1.87 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.android.application).apply(false)
alias(libs.plugins.benmanes.versions).apply(false)
alias(libs.plugins.cash.paparazzi).apply(false)
alias(libs.plugins.compose.compiler).apply(false)
alias(libs.plugins.detekt).apply(true) // Needs to be applied at the root, unlike others.
alias(libs.plugins.google.dagger.hilt).apply(false)
alias(libs.plugins.google.ksp).apply(false)
alias(libs.plugins.kotlin.android).apply(false)
alias(libs.plugins.kotlinter).apply(false)
alias(libs.plugins.square.sort.dependencies).apply(false)
}
apply(from = "buildscripts/githooks.gradle")
apply(from = "buildscripts/setup.gradle")
apply(from = "buildscripts/versionsplugin.gradle")
subprojects {
apply(from = "../buildscripts/detekt.gradle")
apply(plugin = "com.squareup.sort-dependencies")
apply(plugin = "org.jmailen.kotlinter")
}
tasks.register("clean", Delete::class) {
delete(rootProject.layout.buildDirectory)
}
afterEvaluate {
// We install the hook at the first occasion
tasks.named("clean") {
dependsOn(":installGitHooks")
}
}
tasks {
/**
* The detektAll tasks enables parallel usage for detekt so if this project
* expands to multi module support, detekt can continue to run quickly.
*
* https://proandroiddev.com/how-to-use-detekt-in-a-multi-module-android-project-6781937fbef2
*/
@Suppress("UnusedPrivateMember")
val detektAll by registering(io.gitlab.arturbosch.detekt.Detekt::class) {
parallel = true
setSource(files(projectDir))
include("**/*.kt")
include("**/*.kts")
exclude("**/resources/**")
exclude("**/build/**")
config.setFrom(files("$rootDir/config/detekt/detekt.yml"))
buildUponDefaultConfig = true
}
}