-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
63 lines (50 loc) · 1.34 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
59
60
61
62
63
import org.codehaus.groovy.runtime.ProcessGroovyMethods
import java.nio.file.Files
import java.nio.file.StandardCopyOption
plugins {
kotlin("jvm") version "1.8.20"
id("io.gitlab.arturbosch.detekt") version "1.22.0"
}
subprojects {
apply {
plugin("org.jetbrains.kotlin.jvm")
version = "1.8.20"
}
apply {
plugin("io.gitlab.arturbosch.detekt")
version = "1.22.0"
}
detekt {
toolVersion = "1.22.0"
buildUponDefaultConfig = true
autoCorrect = true
config = files("$rootDir/rules/detekt.yml")
}
group = "woorizip-server"
version = "0.0.1-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.22.0")
}
}
fun String.execute() = ProcessGroovyMethods.getText(ProcessGroovyMethods.execute(this))
tasks.create("installGitHooks") {
doLast {
val gitDir = File(".git/hooks/pre-push")
val prePushFile = File(".githooks/pre-push")
if (!gitDir.exists()) {
gitDir.mkdirs()
}
Files.copy(
prePushFile.toPath(),
gitDir.toPath(),
StandardCopyOption.REPLACE_EXISTING,
)
"chmod +x ${gitDir.path}".execute()
}
}
tasks.compileKotlin {
dependsOn("installGitHooks")
}