-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
106 lines (84 loc) · 2.79 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
val javaVersion = JavaVersion.VERSION_16
val kotlinLanguageVersion = "1.6"
val ktorVersion = "2.0.0"
val jacksonVersion = "2.13.2"
val logbackVersion = "1.2.11"
val applicationJvmArgs = listOf(
"-server",
"-XX:+UseSerialGC",
"-XX:+UseStringDeduplication",
"-Xms40m",
"-Xmx40m",
"--finalization=disabled" // TODO will be removed when JDK sets finalization to disabled by default.
)
group = "land.tbp"
version = "1.6"
description = "Telegram Bot used for my Duplicacy Utils scripts"
java.sourceCompatibility = javaVersion
java.targetCompatibility = javaVersion
plugins {
application
kotlin("jvm") version "1.6.20"
id("com.google.cloud.tools.jib") version "3.2.0"
}
repositories {
mavenCentral()
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("ch.qos.logback:logback-classic:$logbackVersion")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion")
// ktor server
implementation("io.ktor:ktor-server-netty-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-host-common:$ktorVersion")
implementation("io.ktor:ktor-server-core-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-metrics-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-call-logging-jvm:$ktorVersion")
implementation("io.ktor:ktor-server-content-negotiation:$ktorVersion")
// ktor client
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-apache:$ktorVersion")
implementation("io.ktor:ktor-client-logging:$ktorVersion")
implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
// ktor common
implementation("io.ktor:ktor-serialization-jackson:$ktorVersion")
testImplementation("io.ktor:ktor-server-tests-jvm:$ktorVersion")
configurations.all {
exclude(group = "junit", module = "junit")
exclude(module = "mockito-core")
exclude(module = "mockito-all")
exclude(module = "slf4j-log4j12")
}
}
tasks {
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
@Suppress("SuspiciousCollectionReassignment")
freeCompilerArgs += listOf("-Xjsr305=strict")
jvmTarget = javaVersion.majorVersion
languageVersion = kotlinLanguageVersion
apiVersion = kotlinLanguageVersion
}
}
withType<Test> {
useJUnitPlatform()
}
wrapper {
gradleVersion = "7.4.2"
}
}
jib {
from {
image = "openjdk:18"
}
to {
image = "docker.io/thebestpessimist/duplicacy-utils-telegram-bot"
}
container {
ports = listOf("13337")
jvmFlags = applicationJvmArgs
}
}
application {
applicationDefaultJvmArgs = applicationJvmArgs
}