generated from Kord-Extensions/template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
80 lines (61 loc) · 1.71 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.util.removeSuffixIfPresent
plugins {
application
kotlin("jvm")
kotlin("plugin.serialization")
id("com.github.johnrengelman.shadow")
}
group = "quest.laxla"
version = file(".version").readText().removeSuffixIfPresent("\n")
repositories {
google()
mavenCentral()
maven("https://oss.sonatype.org/content/repositories/snapshots") {
name = "Sonatype Snapshots (Legacy)"
}
maven("https://s01.oss.sonatype.org/content/repositories/snapshots") {
name = "Sonatype Snapshots"
}
}
val kordex: String by project
val serialization: String by project
val logback: String by project
val slf4j: String by project
val klogging: String by project
dependencies {
implementation(kotlin("stdlib"))
implementation(kotlin("reflect"))
implementation("org.jetbrains.kotlinx:kotlinx-serialization-protobuf:$serialization")
implementation("com.kotlindiscord.kord.extensions:kord-extensions:$kordex")
implementation("io.github.oshai:kotlin-logging:$klogging")
runtimeOnly("org.slf4j:slf4j-api:$slf4j")
runtimeOnly("ch.qos.logback:logback-classic:$logback")
}
val generatedResources = layout.buildDirectory.dir("generated/resources")
tasks.processResources {
from(generatedResources)
doFirst {
generatedResources.orNull?.run {
asFile.mkdirs()
file(".version").asFile.writeText(version.toString())
}
}
}
application {
mainClass = "quest.laxla.trouper.AppKt"
}
tasks.jar {
manifest {
attributes(
"Main-Class" to application.mainClass.get()
)
}
}
val jvm: String by project
tasks.withType<KotlinCompile> { kotlinOptions.jvmTarget = jvm }
java {
val java = JavaVersion.toVersion(jvm)
sourceCompatibility = java
targetCompatibility = java
}