-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
executable file
·91 lines (70 loc) · 2.42 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val gradleVersion = "7.3.3"
val javaVersion = JavaVersion.VERSION_17
val slf4jVersion = "1.7.35"
val logbackVersion = "1.2.10"
val ktorVersion = "1.6.7"
val jacksonVersion = "2.13.1"
val rabbitmqVersion = "5.14.1"
val assertjVersion = "3.22.0"
val mockkVersion = "1.12.2"
val junitJupiterVersion = "5.8.2"
val mainClass = "com.andersostby.webhook.MainKt"
plugins {
kotlin("jvm") version "1.6.10"
}
repositories {
mavenCentral()
}
dependencies {
implementation("org.slf4j:slf4j-api:$slf4jVersion")
implementation("ch.qos.logback:logback-classic:$logbackVersion")
implementation("io.ktor:ktor-server-core:$ktorVersion")
implementation("io.ktor:ktor-server-netty:$ktorVersion")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion")
implementation("com.rabbitmq:amqp-client:$rabbitmqVersion")
testImplementation("org.assertj:assertj-core:$assertjVersion")
testImplementation("io.mockk:mockk:$mockkVersion")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitJupiterVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion")
testImplementation("io.ktor:ktor-server-test-host:$ktorVersion")
}
tasks {
withType<Test> {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
withType<Wrapper> {
gradleVersion = gradleVersion
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = javaVersion.toString()
}
named<KotlinCompile>("compileTestKotlin") {
kotlinOptions.jvmTarget = javaVersion.toString()
}
named<Jar>("jar") {
baseName = "app"
manifest {
attributes["Main-Class"] = mainClass
attributes["Class-Path"] = configurations.runtimeClasspath.get().joinToString(separator = " ") {
it.name
}
}
doLast {
configurations.runtimeClasspath.get().forEach {
val file = File("$buildDir/libs/${it.name}")
if (!file.exists())
it.copyTo(file)
}
}
}
}
java {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}