-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.gradle.kts
46 lines (42 loc) · 1.44 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
// 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.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.hilt) apply false
alias(libs.plugins.kotlin.ksp) apply false
alias(libs.plugins.compose.compiler) apply(false)
alias(libs.plugins.detekt)
}
tasks.register("copyGitHooks", Copy::class.java) {
description = "Copies the git hooks from /git-hooks to the .git folder."
group = "git hooks"
from("$rootDir/git-hooks/pre-commit")
into("$rootDir/.git/hooks/")
}
tasks.register("installGitHooks", Exec::class.java) {
description = "Installs the pre-commit git hooks from /git-hooks."
group = "git hooks"
workingDir = rootDir
commandLine = listOf("chmod")
args("-R", "+x", ".git/hooks/")
dependsOn("copyGitHooks")
doLast {
logger.info("Git hook installed successfully.")
}
}
detekt {
toolVersion = libs.versions.detektVersion.get()
parallel = false
config.setFrom(file("config/detekt/detekt.yml"))
buildUponDefaultConfig = false
allRules = true
disableDefaultRuleSets = false
debug = false
ignoreFailures = false
basePath = projectDir.absolutePath
}
afterEvaluate {
tasks.getByPath(":app:preBuild").dependsOn(":installGitHooks")
}