-
Notifications
You must be signed in to change notification settings - Fork 63
/
tasks.gradle.kts
44 lines (36 loc) · 1.14 KB
/
tasks.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
tasks.register("installGitHooks") {
group = "git hooks"
doFirst {
val hooks = project.fileTree("scripts/hooks").files.map { it.name }
description = "Installs the following git hooks: ${hooks.joinToString(", ")}."
}
doLast {
val hooksDir = File(rootDir, ".git/hooks")
if (!hooksDir.exists()) {
hooksDir.mkdirs()
}
val hooks = project.fileTree("scripts/hooks")
hooks.forEach { file ->
val destination = File(hooksDir, file.name)
file.copyTo(destination, overwrite = true)
destination.setExecutable(true)
println("Installed hook: ${file.name}")
}
println("All hooks installed successfully.")
}
}
tasks.register("clean", Delete::class) {
delete(rootProject.layout.buildDirectory)
}
tasks.register("runChecks") {
group = "verification"
description = "Cleans the project, runs lint checks, and code quality checks."
dependsOn(
":core:clean",
":core:ktlintCheck",
":core:detekt",
":core:checkstyleDebug",
":core:pmdDebug",
":core:lintDebug"
)
}