-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
79 lines (59 loc) · 1.97 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.gradle.jvm.tasks.Jar
plugins {
kotlin("jvm") version "1.7.0"
kotlin("kapt") version "1.7.21"
}
group = "fi.lipp.bazarakibot"
val my_version = "1.0-SNAPSHOT"
version = my_version
repositories {
mavenCentral()
}
val exposedVersion: String = "0.39.1"
val daggerVersion: String = "2.16"
dependencies {
testImplementation(kotlin("test"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
implementation("com.google.dagger:dagger:$daggerVersion")
kapt("com.google.dagger:dagger-compiler:$daggerVersion")
implementation("org.telegram:telegrambots:6.1.0")
implementation("org.jsoup:jsoup:1.15.3")
implementation("org.jetbrains.exposed:exposed-core:$exposedVersion")
implementation("org.jetbrains.exposed:exposed-dao:$exposedVersion")
implementation("org.jetbrains.exposed:exposed-jdbc:$exposedVersion")
implementation("io.github.microutils:kotlin-logging-jvm:3.0.4")
implementation("ch.qos.logback:logback-classic:1.4.5")
implementation("com.h2database:h2:2.1.214")
}
tasks.assemble {}
tasks.withType<Jar> {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes["Main-Class"] = "MainKt"
}
configurations["compileClasspath"].forEach { file: File ->
from(zipTree(file.absoluteFile))
}
}
tasks.test {
useJUnitPlatform()
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
val fatJar = task("fatJar", type = Jar::class) {
archiveBaseName.set("${project.name}-fat")
manifest {
attributes["Implementation-Title"] = "Gradle Jar File Example"
attributes["Implementation-Version"] = my_version
attributes["Main-Class"] = "fi.lipp.bazarakibot.ApplicationRunnerKt"
}
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
with(tasks.jar.get() as CopySpec)
}
tasks {
"build" {
dependsOn(fatJar)
}
}