-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
build.gradle
70 lines (60 loc) · 2.27 KB
/
build.gradle
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
plugins {
id "fabric-loom" version "1.8-SNAPSHOT"
}
base {
archivesName = property "archives_base_name"
group = property "maven_group"
//version = property("mod.version")
version = "v${property "mod.version"}-${property "loader.id"}+mc${property "mc.displayed_range"}"
}
repositories {
maven { url "https://maven.shedaniel.me" }
maven { url "https://maven.terraformersmc.com/releases" }
}
def mcVersion = property("mc.version").toString()
def clothConfigVersion = property("mods.clothconfig.ref")
def clothConfigMajor = clothConfigVersion != "[VERSIONED]" ? clothConfigVersion.split("\\.")[0].toInteger() : 0
// To change any versions see the gradle.properties files under root and "/versions/*/"
dependencies {
minecraft "com.mojang:minecraft:${mcVersion}"
mappings loom.officialMojangMappings()
modImplementation "net.fabricmc:fabric-loader:${property("deps.fabric_loader")}"
// Common libraries
include (implementation "io.hotmoka:toml4j:0.7.3")
if (stonecutter.eval(mcVersion, "<1.19.3")) {
include(implementation "org.joml:joml:1.10.5")
}
// Cloth Config
modApi("me.shedaniel.cloth:${clothConfigMajor <= 2 ? "config-2" : "cloth-config-fabric"}:${clothConfigVersion}") {
// Prevent preparing two loader versions in cache. Not needed.
exclude(group: "net.fabricmc")
exclude(group: "net.fabricmc.fabric-api")
}
// ModMenu API, to add the Config Screen to it
modImplementation "com.terraformersmc:modmenu:${property("mods.modmenu.ref")}"
}
def javaVersion = stonecutter.eval(mcVersion, ">=1.20.6") ? JavaVersion.VERSION_21 : JavaVersion.VERSION_17
tasks.withType(JavaCompile).configureEach {
it.options.release = javaVersion.ordinal() + 1
}
processResources {
filesMatching("fabric.mod.json") {
expand([
"mod_version": project.property("mod.version"),
"mc_version_range": project.property("mc.version_range"),
"mods_clothconfig_range": project.property("mods.clothconfig.range"),
"mods_modmenu_range": project.property("mods.modmenu.range"),
])
}
}
loom {
runConfigs.all {
ideConfigGenerated true // Run configurations are not created for subprojects by default
runDir "../../run" // Use a shared run folder and create separate worlds
}
}
// Copy produced jars into /out/
task copyJar(type: Copy) {
from remapJar into "../../out/"
}
build.finalizedBy copyJar