@@ -2,148 +2,93 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
2
2
import org.gradle.api.tasks.testing.logging.TestLogEvent
3
3
4
4
plugins {
5
- application
6
5
kotlin(" jvm" ) version Kotlin .version
7
6
id(Spotless .spotless) version Spotless .version
8
- id(Shadow .shadow) version Shadow .version
9
7
}
10
8
11
- buildscript {
12
- repositories {
13
- mavenCentral()
14
- }
15
- }
16
-
17
- apply {
18
- plugin(Spotless .spotless)
19
- }
9
+ val grpcVersion = " 1.27.2"
20
10
21
11
repositories {
22
- mavenCentral()
23
12
jcenter()
24
- maven(" https://packages.confluent.io/maven/" )
25
13
maven(" https://jitpack.io" )
26
14
}
27
15
28
- application {
29
- applicationName = " dp-inntekt-api"
30
- mainClassName = " no.nav.dagpenger.inntekt.InntektApiKt"
31
- }
32
-
33
- java {
34
- sourceCompatibility = JavaVersion .VERSION_11
35
- targetCompatibility = JavaVersion .VERSION_11
36
- }
37
-
38
- dependencyLocking {
39
- lockAllConfigurations()
40
- }
41
-
42
- configurations.all {
43
- resolutionStrategy.activateDependencyLocking()
44
- resolutionStrategy.preferProjectModules()
45
- resolutionStrategy.eachDependency { DependencyResolver .execute(this ) }
46
- }
47
-
48
- dependencies {
49
- implementation(kotlin(" stdlib-jdk8" ))
50
-
51
- implementation(Dagpenger .Events )
16
+ allprojects {
17
+ group = " no.nav.dagpenger"
52
18
53
- implementation(Ktor .server)
54
- implementation(Ktor .serverNetty)
55
- implementation(Ktor .auth)
56
- implementation(Ktor .authJwt)
57
- implementation(Ktor .micrometerMetrics)
58
- implementation(Dagpenger .Biblioteker .ktorUtils)
59
- implementation(Micrometer .prometheusRegistry)
19
+ apply (plugin = " org.jetbrains.kotlin.jvm" )
20
+ apply (plugin = Spotless .spotless)
60
21
61
- implementation(Moshi .moshi)
62
- implementation(Moshi .moshiAdapters)
63
- implementation(Moshi .moshiKotlin)
64
- implementation(Moshi .moshiKtor)
22
+ dependencies {
23
+ implementation(kotlin(" stdlib-jdk8" ))
65
24
66
- implementation( Dagpenger . Streams )
67
- implementation(Kafka .clients )
25
+ // ulid
26
+ implementation(Ulid .ulid )
68
27
69
- implementation(Kotlin .Logging .kotlinLogging)
70
-
71
- implementation(Fuel .fuel)
72
- implementation(Fuel .fuelMoshi)
73
- implementation(Fuel .library(" coroutines" ))
28
+ testImplementation(kotlin(" test" ))
29
+ testImplementation(Junit5 .api)
30
+ testRuntimeOnly(Junit5 .engine)
31
+ testImplementation(KoTest .assertions)
32
+ testImplementation(KoTest .runner)
33
+ }
74
34
75
- implementation(Log4j2 .api)
76
- implementation(Log4j2 .core)
77
- implementation(Log4j2 .slf4j)
78
- implementation(Log4j2 .Logstash .logstashLayout)
35
+ tasks.withType< org.jetbrains.kotlin.gradle.tasks.KotlinCompile > {
36
+ kotlinOptions.jvmTarget = JavaVersion .VERSION_1_8 .toString()
37
+ }
79
38
80
- implementation(Ulid .ulid)
39
+ java {
40
+ sourceCompatibility = JavaVersion .VERSION_1_8
41
+ targetCompatibility = JavaVersion .VERSION_1_8
42
+ }
81
43
82
- implementation(Dagpenger .Biblioteker .stsKlient)
44
+ tasks.withType<Wrapper > {
45
+ gradleVersion = " 6.3"
46
+ }
83
47
84
- implementation(Database .Flyway )
85
- implementation(Database .HikariCP )
86
- implementation(Database .Postgres )
87
- implementation(Database .Kotlinquery )
88
- implementation(Konfig .konfig)
89
- implementation(Database .VaultJdbc ) {
90
- exclude(module = " slf4j-simple" )
91
- exclude(module = " slf4j-api" )
48
+ spotless {
49
+ kotlin {
50
+ targetExclude(" **/generated/**" ) // ignore generated gRpc stuff
51
+ ktlint()
52
+ }
53
+ kotlinGradle {
54
+ target(" *.gradle.kts" , " buildSrc/**/*.kt*" )
55
+ ktlint()
56
+ }
92
57
}
93
58
94
- implementation(Prometheus .common)
95
- implementation(Prometheus .hotspot)
96
- implementation(Prometheus .log4j2)
97
-
98
- implementation(Bekk .nocommons)
99
-
100
- implementation(Kotlinx .bimap)
101
-
102
- testImplementation(kotlin(" test" ))
103
- testImplementation(Ktor .ktorTest)
104
- testImplementation(Junit5 .api)
105
- testImplementation(Junit5 .params)
106
- testRuntimeOnly(Junit5 .engine)
107
- testImplementation(Wiremock .standalone)
108
- testImplementation(KoTest .assertions)
109
- testImplementation(KoTest .runner)
110
- testImplementation(KoTest .property)
111
- testImplementation(TestContainers .postgresql)
112
- testImplementation(TestContainers .kafka)
113
- testImplementation(Mockk .mockk)
114
- testImplementation(JsonAssert .jsonassert)
115
- }
59
+ tasks.withType<Test > {
60
+ useJUnitPlatform()
61
+ testLogging {
62
+ showExceptions = true
63
+ showStackTraces = true
64
+ exceptionFormat = TestExceptionFormat .FULL
65
+ events = setOf (TestLogEvent .PASSED , TestLogEvent .SKIPPED , TestLogEvent .FAILED )
66
+ }
67
+ }
116
68
117
- spotless {
118
- kotlin {
119
- ktlint()
69
+ tasks.named(" compileKotlin" ) {
70
+ dependsOn(" spotlessApply" , " spotlessKotlinCheck" )
120
71
}
121
- kotlinGradle {
122
- target( " *.gradle.kts " , " buildSrc/**/*.kt* " )
123
- ktlint( )
72
+
73
+ tasks.named( " jar " ) {
74
+ dependsOn( " test " )
124
75
}
125
76
}
126
77
127
- tasks.withType< org.jetbrains.kotlin.gradle.tasks.KotlinCompile > { kotlinOptions.jvmTarget = " 1.8" }
78
+ subprojects {
79
+ apply (plugin = " org.jetbrains.kotlin.jvm" )
128
80
129
- tasks.withType<Test > {
130
- useJUnitPlatform()
131
- testLogging {
132
- showExceptions = true
133
- showStackTraces = true
134
- exceptionFormat = TestExceptionFormat .FULL
135
- events = setOf (TestLogEvent .PASSED , TestLogEvent .SKIPPED , TestLogEvent .FAILED )
81
+ repositories {
82
+ jcenter()
83
+ maven(" https://jitpack.io" )
136
84
}
137
- }
138
85
139
- tasks.withType<Wrapper > {
140
- gradleVersion = " 6.0.1"
141
- }
86
+ dependencies {
87
+ implementation(kotlin(" stdlib-jdk8" ))
142
88
143
- tasks.named(" shadowJar" ) {
144
- dependsOn(" test" )
145
- }
146
-
147
- tasks.named(" compileKotlin" ) {
148
- dependsOn(" spotlessKotlinCheck" )
89
+ testImplementation(kotlin(" test" ))
90
+ testImplementation(Junit5 .api)
91
+ testRuntimeOnly(Junit5 .engine)
92
+ testImplementation(Mockk .mockk)
93
+ }
149
94
}
0 commit comments