-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
58 lines (45 loc) · 1.46 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
plugins {
kotlin("jvm") version "1.4.21"
}
group = "net.perfectdreams.yadls"
version = "0.0.2-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation("io.github.microutils:kotlin-logging:1.8.0.1")
implementation("ch.qos.logback:logback-classic:1.3.0-alpha4")
implementation("io.ktor:ktor-server-core:1.5.0")
implementation("io.ktor:ktor-server-netty:1.5.0")
implementation("org.yaml:snakeyaml:1.26")
}
tasks {
val fatJar = task("fatJar", type = Jar::class) {
println("Building fat jar for ${project.name}...")
archiveBaseName.set("${project.name}-fat")
manifest {
attributes["Main-Class"] = "net.perfectdreams.yetanothersimplemavenrepo.YetAnotherSimpleMavenRepoLauncher"
attributes["Class-Path"] = configurations.runtimeClasspath.get().joinToString(" ", transform = { "libs/" + it.name })
}
val libs = File(rootProject.projectDir, "libs")
// libs.deleteRecursively()
libs.mkdirs()
from(configurations.runtimeClasspath.get().mapNotNull {
val output = File(libs, it.name)
if (!output.exists())
it.copyTo(output, true)
null
})
with(jar.get() as CopySpec)
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
"build" {
dependsOn(fatJar)
}
}