-
-
Notifications
You must be signed in to change notification settings - Fork 273
/
build.gradle.kts
38 lines (34 loc) · 1 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
plugins {
kotlin("jvm") version libs.versions.kotlinVer.get()
alias(libs.plugins.detekt)
alias(libs.plugins.javafx)
alias(libs.plugins.spotless)
}
val jvmTarget = "1.8"
subprojects {
apply(from = "${rootProject.projectDir}/config/codeQuality.gradle")
apply(plugin = "org.openjfx.javafxplugin")
apply(plugin = "org.jetbrains.kotlin.jvm")
dependencies {
detektPlugins(rootProject.libs.detekt.formatting)
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
targetCompatibility = jvmTarget
sourceCompatibility = jvmTarget
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = jvmTarget
}
}
val hook = File("${rootProject.projectDir}/.git/hooks/pre-commit")
hook.parentFile.mkdirs()
hook.writeBytes(
"""
#!/bin/bash
echo "run code format"
./gradlew spotlessCheck
echo "run code smell check"
./gradlew detekt
""".trimIndent().toByteArray()
)