-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
58 lines (48 loc) · 1.45 KB
/
build.gradle.kts
File metadata and controls
58 lines (48 loc) · 1.45 KB
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
plugins {
id("fabric-loom")
}
// Set the base name and version
base {
archivesName.set("greentext")
}
version = "1.0.0"
group = "com.greentextmod"
java {
withSourcesJar()
}
repositories {
mavenCentral()
maven("https://maven.fabricmc.net/")
}
dependencies {
minecraft("com.mojang:minecraft:${stonecutter.current}")
mappings("net.fabricmc:yarn:${property("deps.yarn")}:v2")
modImplementation("net.fabricmc:fabric-loader:0.16.13")
modImplementation("net.fabricmc.fabric-api:fabric-api:${property("deps.fabric_api")}")
}
tasks {
processResources {
inputs.property("version", project.version)
filesMatching("fabric.mod.json") {
expand(mapOf(
"version" to project.version,
"mc_dep" to (project.findProperty("mod.mc_dep") ?: ">=1.16")
))
}
}
compileJava {
// Use Java 17 for 1.18+ and Java 8 for older versions
val currentVersion = stonecutter.current.version
val javaVersion = when {
currentVersion.startsWith("1.21") || currentVersion.startsWith("1.20") -> 17
currentVersion.startsWith("1.19") || currentVersion.startsWith("1.18") -> 17
else -> 8
}
options.release.set(javaVersion)
}
// Configure JAR output name explicitly (optional, as base.archivesName handles this)
jar {
archiveBaseName.set("greentext")
archiveVersion.set("1.0.0")
}
}