@@ -12,6 +12,7 @@ val postgresqlVersion = "42.7.2"
12
12
13
13
plugins {
14
14
kotlin(" jvm" ) version " 1.9.22"
15
+ id(" org.jlleitschuh.gradle.ktlint" ) version " 12.1.0"
15
16
}
16
17
17
18
val githubUser: String by project
@@ -33,13 +34,14 @@ allprojects {
33
34
}
34
35
35
36
apply (plugin = " org.jetbrains.kotlin.jvm" )
37
+ apply (plugin = " org.jlleitschuh.gradle.ktlint" )
36
38
37
39
dependencies {
38
40
implementation(" com.github.navikt:rapids-and-rivers:$rapidsAndRiversVersion " )
39
41
implementation(" io.ktor:ktor-server-cio:$ktorVersion " )
40
42
implementation(" io.ktor:ktor-server-websockets:$ktorVersion " )
41
43
implementation(" org.postgresql:postgresql:$postgresqlVersion " )
42
- implementation(" com.papertrailapp:logback-syslog4j:$logbackSyslog4jVersion " ) // August, 2014
44
+ implementation(" com.papertrailapp:logback-syslog4j:$logbackSyslog4jVersion " ) // August, 2014
43
45
{
44
46
exclude(group = " ch.qos.logback" )
45
47
}
@@ -87,6 +89,15 @@ allprojects {
87
89
}
88
90
testImplementation(" io.mockk:mockk:$mockkVersion " )
89
91
}
92
+
93
+ ktlint {
94
+ // Hvis du gjør endringer i disse filterne må du slette alle "build"/"out"-mappene og deretter
95
+ // kjøre ./gradlew --no-build-cache ktlintCheck minst én gang for at endringene skal ta effekt
96
+ filter {
97
+ exclude { it.file.path.contains(" generated" ) }
98
+ exclude { it.file.path.contains(" test" ) }
99
+ }
100
+ }
90
101
}
91
102
92
103
subprojects {
@@ -108,6 +119,18 @@ subprojects {
108
119
}
109
120
}
110
121
111
- tasks.jar {
112
- enabled = false
122
+ tasks {
123
+ register<Copy >(" copyPreCommitHook" ) {
124
+ description = " Kopierer pre-commit hook fra scripts til .git/hooks"
125
+ outputs.upToDateWhen { false }
126
+ from(" $rootDir /scripts/pre-commit" )
127
+ into(" $rootDir /.git/hooks" )
128
+ }
129
+
130
+ jar {
131
+ enabled = false
132
+ }
133
+ build {
134
+ dependsOn(" copyPreCommitHook" )
135
+ }
113
136
}
0 commit comments