-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
53 lines (42 loc) · 1.33 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
import org.gradle.jvm.tasks.Jar
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.3.21"
id("com.hpe.kraal") version "0.0.15" // kraal version - for makeRelease.sh
}
group = "io.igx.kotlin"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
jcenter()
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation("org.slf4j:slf4j-simple:1.7.26")
implementation("io.ktor:ktor-server-cio:1.1.3")
implementation("io.ktor:ktor-gson:1.1.3")
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "1.8"
// need use-experimental for Ktor CIO
freeCompilerArgs += listOf("-Xuse-experimental=kotlin.Experimental", "-progressive")
// disable -Werror with: ./gradlew -PwarningsAsErrors=false
allWarningsAsErrors = project.findProperty("warningsAsErrors") != "false"
}
}
val fatjar by tasks.creating(Jar::class) {
from(kraal.outputZipTrees) {
exclude("META-INF/*.SF")
exclude("META-INF/*.DSA")
exclude("META-INF/*.RSA")
}
manifest {
attributes("Main-Class" to "io.igx.kotlin.ApplicationKt")
}
destinationDirectory.set(project.buildDir.resolve("fatjar"))
archiveFileName.set("ktor-native.jar")
}
tasks.named("assemble").configure {
dependsOn(fatjar)
}