generated from syorito-hatsuki/fabric-mod-template
-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle.kts
110 lines (86 loc) · 3.17 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
plugins {
id("fabric-loom")
kotlin("jvm")
kotlin("plugin.serialization")
}
base {
val archivesBaseName: String by project
archivesName.set(archivesBaseName)
}
val fabricKotlinVersion: String by project
val javaVersion = JavaVersion.VERSION_21
val loaderVersion: String by project
val minecraftVersion: String by project
val modVersion: String by project
version = modVersion
val mavenGroup: String by project
group = mavenGroup
repositories {
maven("https://api.modrinth.com/maven")
maven("https://maven.terraformersmc.com/")
maven("https://maven.shedaniel.me/")
}
dependencies {
minecraft("com.mojang", "minecraft", minecraftVersion)
val yarnMappings: String by project
mappings("net.fabricmc", "yarn", yarnMappings, null, "v2")
modImplementation("net.fabricmc", "fabric-loader", loaderVersion)
val fabricVersion: String by project
modImplementation("net.fabricmc.fabric-api", "fabric-api", fabricVersion)
modImplementation("net.fabricmc", "fabric-language-kotlin", fabricKotlinVersion)
include(modApi("teamreborn", "energy", "4.1.0"))
val emiVersion: String by project
modCompileOnly("dev.emi:emi-fabric:$emiVersion:api")
modLocalRuntime("dev.emi", "emi-fabric", emiVersion)
val jadeVersion: String by project
modImplementation("maven.modrinth", "jade", jadeVersion)
val reiVersion: String by project
modLocalRuntime("me.shedaniel", "RoughlyEnoughItems-fabric", reiVersion)
modCompileOnly("me.shedaniel", "RoughlyEnoughItems-api-fabric", reiVersion)
modCompileOnly("me.shedaniel", "RoughlyEnoughItems-default-plugin-fabric", reiVersion)
modApi("me.shedaniel.cloth:cloth-config-fabric:15.0.140") {
exclude(group = "net.fabricmc.fabric-api")
}
include(modImplementation("maven.modrinth", "fstats", "2023.12.3"))
include(modImplementation("maven.modrinth", "ducky-updater-lib", "2023.10.1"))
include(modImplementation("maven.modrinth", "modmenu-badges-lib", "2023.6.1"))
}
tasks {
withType<JavaCompile> {
options.encoding = "UTF-8"
sourceCompatibility = javaVersion.toString()
targetCompatibility = javaVersion.toString()
options.release.set(javaVersion.toString().toInt())
}
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_21)
}
}
jar {
from("LICENSE")
}
processResources {
inputs.property("version", project.version)
filesMatching("fabric.mod.json") {
expand(
mutableMapOf(
"version" to project.version,
"loaderVersion" to loaderVersion,
"minecraftVersion" to minecraftVersion,
"fabricKotlinVersion" to fabricKotlinVersion,
"javaVersion" to javaVersion.toString()
)
)
}
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(javaVersion.toString()))
}
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
withSourcesJar()
}
}