-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
106 lines (93 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
plugins {
id("fabric-loom") version "1.9-SNAPSHOT"
}
version = "${rootProject.extra["mod_version"]}"
group = "${rootProject.extra["maven_group"]}.mod.fabric"
base {
archivesName = "${project.extra["archives_base_name"]}"
}
loom {
accessWidenerPath = file("src/main/resources/civvoxelmap.accesswidener")
}
dependencies {
minecraft("com.mojang:minecraft:${project.extra["minecraft_version"]}")
loom {
@Suppress("UnstableApiUsage")
mappings(layered {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${project.extra["parchment_minecraft_version"]}:${project.extra["parchment_mappings_version"]}@zip")
})
}
modImplementation("net.fabricmc:fabric-loader:${project.extra["fabric_loader_version"]}")
modImplementation("net.fabricmc.fabric-api:fabric-api:${project.extra["fabric_api_version"]}")
// https://modrinth.com/mod/voxelmap-updated/version/1.21.4-1.14.7
"maven.modrinth:voxelmap-updated:lIwnSHMm".also {
modImplementation(it)
include(it)
}
// https://modrinth.com/mod/modmenu/version/13.0.0-beta.1
// TODO: Update to a release version ASAP
"maven.modrinth:modmenu:2pJcGBVh".also {
modCompileOnly(it)
modLocalRuntime(it)
}
// This is literally only here to make Minecraft SHUT UP about non-signed messages while testing.
// https://modrinth.com/mod/no-chat-reports/version/Fabric-1.21.4-v2.11.0
modLocalRuntime("maven.modrinth:no-chat-reports:9xt05630")
}
repositories {
maven(url = "https://maven.parchmentmc.org") {
name = "ParchmentMC"
}
maven(url = "https://api.modrinth.com/maven") {
name = "Modrinth"
content {
includeGroup("maven.modrinth")
}
}
}
java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
tasks {
jar {
from("LICENCE") {
rename { "LICENSE_${project.extra["mod_name"]}" } // Use US spelling
}
}
compileJava {
options.encoding = "UTF-8"
options.release.set(21)
}
processResources {
filesMatching("fabric.mod.json") {
expand(
"mod_name" to project.extra["mod_name"],
"mod_version" to project.version,
"mod_description" to project.extra["mod_description"],
"copyright_licence" to project.extra["copyright_licence"],
"mod_home_url" to project.extra["mod_home_url"],
"mod_source_url" to project.extra["mod_source_url"],
"mod_issues_url" to project.extra["mod_issues_url"],
"minecraft_version" to project.extra["minecraft_version"],
"fabric_loader_version" to project.extra["fabric_loader_version"],
)
}
}
register<Delete>("cleanJar") {
delete(fileTree("./dist") {
include("*.jar")
})
}
register<Copy>("copyJar") {
dependsOn(getByName("cleanJar"))
from(getByName("remapJar"))
into("./dist")
rename("(.*?)\\.jar", "\$1-fabric.jar")
}
build {
dependsOn(getByName("copyJar"))
}
}