-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
107 lines (85 loc) · 2.29 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
107
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
application
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.ktlint)
alias(libs.plugins.licenser)
}
val jvmVersion = 19
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(jvmVersion))
}
}
application {
mainClass.set("io.mcdev.deduper.Main")
}
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation(kotlin("reflect"))
implementation(libs.kotlin.coroutines)
implementation(libs.kotlin.serialization) {
excludeKotlin()
}
implementation(libs.bundles.ktor) {
excludeKotlin()
}
implementation(libs.bundles.logging)
implementation(libs.typesafe.config)
implementation(libs.kotlin.serialization.hocon) {
excludeKotlin()
}
implementation(libs.postgres)
implementation(libs.hikari)
implementation(platform(libs.jdbi.bom))
implementation(libs.bundles.jdbi)
implementation(libs.jdbi.postgres)
implementation(libs.bundles.jdbi.kotlin)
implementation(libs.github)
implementation(libs.jjwt.api)
runtimeOnly(libs.bundles.jjwt)
testImplementation(libs.junit.api)
testRuntimeOnly(libs.junit.engine)
testImplementation(libs.ktor.server.tests)
testImplementation(libs.kotlin.junit)
}
fun ExternalModuleDependency.excludeKotlin() {
exclude(group = "org.jetbrains.kotlin")
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "$jvmVersion"
freeCompilerArgs = listOf(
"-Xjvm-default=all",
"-Xjdk-release=$jvmVersion",
"-opt-in=kotlin.contracts.ExperimentalContracts",
"-opt-in=kotlinx.serialization.ExperimentalSerializationApi",
)
javaParameters = true
}
}
tasks.test {
useJUnitPlatform()
}
license {
header.set(resources.text.fromFile(file("header.txt")))
}
ktlint {
version.set("0.48.2")
}
tasks.register("format") {
group = "minecraft"
description = "Formats source code according to project style"
dependsOn(tasks.licenseFormat, tasks.ktlintFormat)
}
tasks.distTar {
compression = Compression.GZIP
archiveExtension.set("tar.gz")
}
tasks.distZip {
enabled = false
}