-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
110 lines (88 loc) · 2.68 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
108
109
110
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.jetbrains.kotlin.jvm")
id("fabric-loom")
}
group = "net.rk4z.fabricord"
version = "4.1.0"
description = "A modern message style like DiscordSRV will be reproduced as a Fabric version mod."
repositories {
mavenCentral()
}
val includeInJar: Configuration by configurations.creating
dependencies {
val minecraftVersion: String by project
val mappingsVersion: String by project
val loaderVersion: String by project
val fabricVersion: String by project
val fabricLanguageKotlinVersion: String by project
minecraft("com.mojang:minecraft:$minecraftVersion")
mappings("net.fabricmc:yarn:$mappingsVersion")
modImplementation("net.fabricmc:fabric-loader:$loaderVersion")
modImplementation("net.fabricmc.fabric-api:fabric-api:$fabricVersion")
modImplementation("net.fabricmc:fabric-language-kotlin:$fabricLanguageKotlinVersion")
implementation("net.dv8tion:JDA:5.2.1") {
exclude("net.java.dev.jna", "jna")
}
implementation("org.yaml:snakeyaml:2.3")
implementation("net.kyori:adventure-text-serializer-gson:4.17.0")
implementation("com.github.ben-manes.caffeine:caffeine:3.1.8")
implementation("net.rk4z.s1:swiftbase-core:2.0.9")
implementation("net.rk4z.s1:swiftbase-fabric:2.0.2")
includeInJar("net.dv8tion:JDA:5.2.1") {
exclude("net.java.dev.jna", "jna")
}
includeInJar("org.yaml:snakeyaml:2.3")
includeInJar("net.kyori:adventure-text-serializer-gson:4.17.0")
}
val targetJavaVersion = 21
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(targetJavaVersion))
}
withSourcesJar()
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.release.set(targetJavaVersion)
}
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(targetJavaVersion))
}
}
tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_21)
}
}
tasks.named<ProcessResources>("processResources") {
inputs.property("version", project.version)
inputs.property("description", project.description)
filesMatching("fabric.mod.json") {
expand(mapOf(
"version" to project.version,
"description" to project.description
))
}
}
tasks.named("remapSourcesJar") {
dependsOn(tasks.named("jar"))
}
tasks.named("remapJar") {
dependsOn(tasks.named("sourcesJar"))
}
tasks.withType<Jar> {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveFileName.set("${project.name}-${project.version}.jar")
archiveClassifier = ""
from("LICENSE") {
rename { "${it}_${project.name}" }
}
from({
(configurations["includeInJar"])
.filter { it.exists() && !it.name.startsWith("kotlin") }
.map { if (it.isDirectory) it else project.zipTree(it) }
})
}