-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
57 lines (45 loc) · 1.34 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
plugins {
kotlin("jvm")
kotlin("plugin.serialization")
id("org.jlleitschuh.gradle.ktlint")
application
}
repositories {
mavenCentral()
}
dependencies {
implementation("org.jetbrains.kotlinx", "kotlinx-serialization-json", "1.6.2")
implementation("com.sksamuel.hoplite", "hoplite-core", "2.7.5")
}
internal val projectGroup: String by project
internal val projectVersion: String by project
group = projectGroup
version = projectVersion
application.mainClass.set("us.dragonma.minecraft.server.launcher.MainKt")
internal val javaVersion: String by project
java {
val javaVersion = JavaVersion.toVersion(javaVersion)
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
toolchain {
languageVersion.set(JavaLanguageVersion.of(javaVersion.toString().toInt()))
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
withSourcesJar()
}
tasks.compileJava {
options.encoding = "UTF-8"
options.release.set(javaVersion.toInt())
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
tasks.compileKotlin {
kotlinOptions.jvmTarget = javaVersion
}
tasks.jar {
configurations["compileClasspath"].forEach { from(zipTree(it.absoluteFile)) }
duplicatesStrategy = DuplicatesStrategy.INCLUDE
from("LICENSE") { rename { "$it.${project.name}" } }
manifest.attributes["Main-Class"] = application.mainClass
}