This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
137 lines (115 loc) · 4.9 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
import com.expediagroup.graphql.plugin.gradle.config.GraphQLSerializer
val ktorVersion: String by project
val kotlinVersion: String by project
val logbackVersion: String by project
val junitJupiterVersion: String by project
val mockOAuth2ServerVersion: String by project
val coroutinesVersion: String by project
val latestGraphQLKotlinVersion: String by project
plugins {
application
kotlin("jvm") version "1.7.0"
kotlin("plugin.serialization") version "1.7.0"
id("com.expediagroup.graphql") version "6.1.0"
//id("com.github.johnrengelman.shadow") version "7.1.2" || Shadow JAR
}
group = "no.nav.bulk"
version = "0.0.1"
application {
mainClass.set("no.nav.bulk.ApplicationKt")
val isDevelopment: Boolean = project.ext.has("development")
applicationDefaultJvmArgs = listOf("-Dio.ktor.development=$isDevelopment")
}
tasks {
compileKotlin {
kotlinOptions.jvmTarget = "17"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "17"
}
withType<Test> {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
filter {
includeTestsMatching("no.nav.bulk.lib.*")
}
}
task("integrationtest", Test::class) {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
filter {
includeTestsMatching("no.nav.bulk.integrationtests.*")
excludeTestsMatching("no.nav.bulk.lib.*")
}
description = "Runs integration tests"
}
jar {
archiveFileName.set("app.jar")
manifest {
attributes["Main-Class"] = "no.nav.bulk.ApplicationKt"
attributes["Class-Path"] = configurations.runtimeClasspath.get().joinToString(separator = " ") {
it.name
}
}
doLast {
configurations.runtimeClasspath.get()
.filter { it.name != "app.jar" }
.forEach {
val file = File("$buildDir/libs/${it.name}")
if (!file.exists())
it.copyTo(file)
}
}
}
}
repositories {
mavenCentral()
maven { url = uri("https://maven.pkg.jetbrains.space/public/p/ktor/eap") }
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
implementation("io.ktor:ktor-server-cors-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-default-headers-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3")
implementation("io.ktor:ktor-server-netty-jvm:$ktorVersion")
implementation("ch.qos.logback:logback-classic:$logbackVersion")
implementation("net.logstash.logback:logstash-logback-encoder:7.2")
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-cio:$ktorVersion")
implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
implementation("io.github.cdimascio:dotenv-kotlin:6.3.1")
implementation("io.ktor:ktor-server-partial-content:$ktorVersion")
implementation("io.ktor:ktor-server-auto-head-response:$ktorVersion")
// https://mavenlibs.com/maven/dependency/no.nav.common/token-client
implementation("no.nav.common:token-client:2.2022.07.01_07.12-6a0864fa6938")
implementation("io.ktor:ktor-server-call-logging:$ktorVersion")
implementation("io.ktor:ktor-server-auth:$ktorVersion")
implementation("io.ktor:ktor-server-auth-jwt:$ktorVersion")
implementation("com.auth0:auth0:1.42.0")
implementation("com.expediagroup:graphql-kotlin-ktor-client:$latestGraphQLKotlinVersion")
implementation("com.expediagroup:graphql-kotlin-client-serialization:$latestGraphQLKotlinVersion")
testImplementation("io.ktor:ktor-server-tests-jvm:$ktorVersion")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitJupiterVersion")
testImplementation("org.awaitility:awaitility:4.2.0")
testImplementation("io.ktor:ktor-server-test-host:$ktorVersion")
testImplementation("org.jetbrains.kotlin:kotlin-test:$kotlinVersion")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion")
testImplementation("no.nav.security:mock-oauth2-server:$mockOAuth2ServerVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion")
}
graphql {
client {
// endpoint = "https://pdl-api.dev-fss-pub.nais.io/graphql"
sdlEndpoint = "https://navikt.github.io/pdl/pdl-api-sdl.graphqls"
packageName = "no.nav.bulk.generated"
serializer = GraphQLSerializer.KOTLINX
}
}