-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
100 lines (82 loc) · 3.25 KB
/
build.gradle
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
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '2.1.10'
id "com.github.ben-manes.versions" version "0.52.0"
id 'com.github.johnrengelman.shadow' version '8.1.1'
}
repositories {
google()
mavenCentral()
maven { url = 'https://jitpack.io' }
}
def mainName = 'org.athenian.Main'
def appName = 'server'
group 'org.athenian'
version '1.0.0'
dependencies {
implementation "org.jetbrains.kotlin-wrappers:kotlin-css:$css_version"
implementation "io.ktor:ktor-serialization-gson:$ktor_version"
implementation "io.ktor:ktor-server:$ktor_version"
implementation "io.ktor:ktor-server-cio:$ktor_version"
implementation "io.ktor:ktor-server-html-builder:$ktor_version"
implementation "io.ktor:ktor-server-resources:$ktor_version"
implementation "io.ktor:ktor-server-compression:$ktor_version"
implementation "io.ktor:ktor-client:$ktor_version"
implementation "io.ktor:ktor-client-cio:$ktor_version"
implementation "io.ktor:ktor-client-content-negotiation:$ktor_version"
implementation "io.ktor:ktor-client-logging:$ktor_version"
implementation "io.github.oshai:kotlin-logging:$logging_version"
implementation "ch.qos.logback:logback-classic:$logback_version"
implementation "org.slf4j:jul-to-slf4j:$slf4j_version"
testImplementation "org.amshove.kluent:kluent:${kluent_version}"
testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version"
}
kotlin {
jvmToolchain(17)
}
// Include build uberjars in heroku deploy
task stage(dependsOn: ['uberjar', 'build', 'clean'])
build.mustRunAfter clean
shadowJar {
mergeServiceFiles()
}
task uberjar(type: Jar, dependsOn: shadowJar) {
archiveFileName = 'server.jar'
manifest {
attributes('Implementation-Title': appName)
attributes('Implementation-Version': version)
attributes('Built-Date': new Date())
attributes('Built-JDK': System.getProperty('java.version'))
attributes('Main-Class': mainName)
}
from zipTree(shadowJar.archiveFile)
}
compileKotlin {
kotlinOptions {
jvmTarget = '1.8'
freeCompilerArgs += ['-Xuse-experimental=kotlin.time.ExperimentalTime',
'-Xuse-experimental=io.ktor.util.KtorExperimentalAPI',
'-Xuse-experimental=io.ktor.server.locations.KtorExperimentalLocationsAPI',
'-Xuse-experimental=io.ktor.util.InternalAPI',
'-Xuse-experimental=kotlin.ExperimentalStdlibApi']
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = '1.8'
freeCompilerArgs += ['-Xuse-experimental=kotlin.time.ExperimentalTime',
'-Xuse-experimental=io.ktor.util.KtorExperimentalAPI',
'-Xuse-experimental=io.ktor.server.locations.KtorExperimentalLocationsAPI',
'-Xuse-experimental=io.ktor.util.InternalAPI',
'-Xuse-experimental=kotlin.ExperimentalStdlibApi']
}
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
exceptionFormat "full"
showStandardStreams = true
}
}