This repository has been archived by the owner on Sep 15, 2024. It is now read-only.
generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
89 lines (75 loc) · 2.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
import org.polyfrost.gradle.util.noServerRunConfigs
plugins {
id(libs.plugins.pgt.main.get().pluginId)
id(libs.plugins.pgt.defaults.repo.get().pluginId)
id(libs.plugins.pgt.defaults.loom.get().pluginId)
id(libs.plugins.pgt.defaults.java.get().pluginId)
alias(libs.plugins.blossom)
id(libs.plugins.shadow.get().pluginId)
alias(libs.plugins.kotlin) apply false
}
version = project.properties["mod_version"] as String
group = project.properties["maven_group"] as String
repositories {
mavenCentral()
maven("https://repo.polyfrost.org/releases")
maven("https://maven.isxander.dev/releases")
maven("https://maven.terraformersmc.com/releases")
}
java {
toolchain {
when(platform.mcVersion) {
in 12001..12004 -> {
languageVersion.set(JavaLanguageVersion.of(17))
}
else -> {
languageVersion.set(JavaLanguageVersion.of(21))
}
}
}
}
loom {
noServerRunConfigs()
}
dependencies {
val modMenuVersion = when(platform.mcVersion) {
12001 -> "7.2.2"
12004 -> "9.2.0-beta.2"
12006 -> "10.0.0-beta.1"
else -> "11.0.0-beta.1"
}
val fabricApiVersion = when(platform.mcVersion) {
12001 -> "0.92.1"
12004 -> "0.97.0"
12006 -> "0.98.0"
else -> "0.100.1"
}
val yaclVersion = when(platform.mcVersion) {
12001 -> "3.4.2+1.20.1-fabric"
12004 -> "3.4.2+1.20.4-fabric"
12006 -> "3.4.2+1.20.5-fabric"
else -> "3.5.0+1.21-fabric"
}
modImplementation("com.terraformersmc:modmenu:${modMenuVersion}")
modImplementation("net.fabricmc.fabric-api:fabric-api:${fabricApiVersion}+${platform.mcVersionStr}")
modImplementation("dev.isxander:yet-another-config-lib:${yaclVersion}")
// DevAuth. Lets us log in with our own Minecraft account. Useful for testing tab features.
modRuntimeOnly("me.djtheredstoner:DevAuth-${platform.loaderStr}:1.2.0")
// MixinConstraints. Lets us easily conditionally apply mixins.
include(implementation("com.moulberry:mixinconstraints:1.0.1")!!)
}
tasks.processResources {
filesMatching("fabric.mod.json") {
expand(mapOf("version" to project.version))
}
}
tasks.jar {
from("LICENSE") {
rename { "${it}_${project.base.archivesName.get()}" }
}
}
configurations.all {
resolutionStrategy {
force("net.fabricmc:fabric-loader:0.15.11")
}
}