forked from okx-code/civmodern
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
111 lines (99 loc) · 3.52 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
111
plugins {
id("fabric-loom") version "1.7-SNAPSHOT"
}
version = "${rootProject.extra["mod_version"]}-${project.extra["minecraft_version"]}"
group = "${rootProject.extra["maven_group"]}.mod.fabric"
base {
archivesName.set(project.extra["archives_base_name"] as String)
}
dependencies {
minecraft("com.mojang:minecraft:${project.extra["minecraft_version"]}")
loom {
@Suppress("UnstableApiUsage")
mappings(layered {
officialMojangMappings()
parchment("org.parchmentmc.data:${project.extra["parchment_name"]}:${project.extra["parchment_version"]}@zip")
})
}
modImplementation("net.fabricmc:fabric-loader:${project.extra["fabric_loader_version"]}")
modImplementation("net.fabricmc.fabric-api:fabric-api:${project.extra["fabric_api_version"]}")
modImplementation("dev.isxander:yet-another-config-lib:${project.extra["yacl_version"]}")
modImplementation("com.terraformersmc:modmenu:${project.extra["modmenu_version"]}")
// 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-v2.8.0
modLocalRuntime("maven.modrinth:no-chat-reports:riMhCAII")
}
repositories {
maven(url = "https://maven.parchmentmc.org") {
name = "ParchmentMC"
}
maven(url = "https://api.modrinth.com/maven") {
name = "Modrinth"
content {
includeGroup("maven.modrinth")
}
}
// For YACL
maven("https://maven.isxander.dev/releases/") {
name = "Xander Maven"
}
// For ModMenu
maven(url = "https://maven.terraformersmc.com/") {
name = "Terraformers"
}
}
java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
tasks {
jar {
from(file("LICENSE.txt")) {
rename { "LICENSE_${project.extra["mod_name"]}" }
}
}
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"],
"modmenu_version" to project.extra["modmenu_version"]
)
filter {
it.replace(
"\"%FABRIC_AUTHORS_ARRAY%\"",
groovy.json.JsonBuilder((project.extra["mod_authors"] as String).split(",")).toString()
)
}
}
filesMatching("assets/civmodern/lang/en_us.json") {
expand("mod_name" to project.extra["mod_name"])
}
}
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"))
}
}