-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
138 lines (111 loc) · 5.25 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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
import org.apache.commons.io.FileUtils;
plugins {
id 'fabric-loom' version '1.6-SNAPSHOT'
}
String getGitCommit() {
ByteArrayOutputStream stdout = new ByteArrayOutputStream();
exec {
commandLine("git", "rev-parse", "--short", "HEAD")
standardOutput = stdout
}
return stdout.toString().trim()
}
String getGitBranch() {
ByteArrayOutputStream stdout = new ByteArrayOutputStream();
exec {
commandLine("git", "rev-parse", "--abbrev-ref", "HEAD")
standardOutput = stdout
}
return stdout.toString().trim()
}
version = project.mod_version + "+" + getGitBranch() + "." + getGitCommit()
group = project.maven_group
// Set Build Dir to main to differentiate
buildDir = new File(buildDir, getGitBranch())
if(new File(buildDir, "libs").exists()) FileUtils.cleanDirectory(buildDir.toPath().resolve("libs").toFile())
base {
archivesName = project.archives_base_name
}
// Repo for CT intermediary mappings
repositories {
flatDir { dirs("libraries") }
maven { url 'https://github.com/not-coded/notcoded-maven/raw/fabric/' }
maven { url 'https://maven.nucleoid.xyz' }
//maven { url "https://maven.rizecookey.net/" }
maven { url "https://maven.shedaniel.me/" }
maven { url "https://maven.gegy.dev/" }
maven { url "https://jitpack.io" }
maven { url "https://maven.terraformersmc.com/releases/" }
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url 'https://github.com/ricksouth/serilum-forge-maven/raw/maven/' }
maven { url 'https://repo.minebench.de/' }
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings loom.officialMojangMappings()
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
// Important!
modImplementation("com.nexia.nexus:nexus-api:${project.nexus_version}-full")
modImplementation("com.nexia.nexus:nexus-builder:${project.nexus_version}-${project.minecraft_version}-full")
// Using Fabric API for CTS apparently just doesn't want to make it build but we have to use it so the server doesn't crash when right clicking something
modCompileOnlyApi("net.fabricmc.fabric-api:fabric-api:${project.fabric_version}")
//modRuntimeOnly("net.fabricmc.fabric-api:fabric-api:${project.fabric_version}.combat")
// ↑ included in run/mods/ instead
include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:${project.mixin_extras_version}")))
// MongoDB
include(implementation("org.mongodb:mongodb-driver-sync:${project.mongodb_version}"))
include(implementation("org.mongodb:mongodb-driver-core:${project.mongodb_version}"))
include(implementation("org.mongodb:bson:${project.mongodb_version}"))
// Will be replaced by Nexus
include(modApi("eu.pb4:sgui:${project.sgui_version}") { exclude(group: "net.fabricmc.fabric-api") })
modApi("xyz.nucleoid:fantasy:${project.fantasy_version}") {exclude(group: "net.fabricmc.fabric-api") }
include(modApi("io.github.blumbo:inventory-merger:${project.inventory_merger_version}"))
// Should probably be removed/replaced
include(modApi("me.sargunvohra.mcmods:autoconfig1u:${project.autoconfig1u_version}") { exclude(group: "net.fabricmc.fabric-api") })
modApi("com.natamus.collective:collective-fabric:${project.collective_version}")
// somewhat useful stuff
modApi("me.lucko:fabric-permissions-api:${project.fabric_permissions_api_version}")
include(implementation("net.kyori:adventure-text-minimessage:${project.adventure_version}"))
include(implementation("net.kyori:adventure-text-serializer-gson:${project.adventure_version}"))
include(implementation("de.themoep:minedown-adventure:${project.minedown_adventure_version}"))
compileOnly("net.luckperms:api:${project.luckperms_api_version}")
// discord shit
include(api("net.dv8tion:JDA:${project.jda_version}"))
include(api("club.minnced:discord-webhooks:${project.discord_webhooks_version}") { exclude(group: "org.json") })
include(api("org.json:json:${project.json_version}"))
// useless libraries
include(implementation("com.google.code.gson:gson:${project.gson_version}"))
include(implementation("com.googlecode.json-simple:json-simple:${project.json_simple_version}"))
}
// Custom Manifest and Intermediary mappings declaration
loom {
accessWidenerPath = file("src/main/resources/nexia.accesswidener")
customMinecraftManifest = "https://gist.githubusercontent.com/rizecookey/4c6142baaccc3875f9b227fe22f2ace5/raw/c8ed74b19f7a5315813c9d4b199798b692a8f359/1.16_combat-6.json"
intermediaryUrl = "https://maven.rizecookey.net/net/fabricmc/intermediary/%1\$s/intermediary-%1\$s-v2.jar"
}
processResources {
inputs.property "version", project.version
filteringCharset "UTF-8"
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
def targetJavaVersion = 21
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = targetJavaVersion
}
java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }
}
}