-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
235 lines (202 loc) · 7.18 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
//buildscript {
// dependencies {
// constraints {
// ["asm", "asm-util", "asm-tree", "asm-analysis"].forEach {
// classpath("org.ow2.asm:$it") {
// version { require("9.0") }
// because("Fabric's TinyRemapper requires ASM 9")
// }
// }
// }
// }
//}
plugins {
id "fabric-loom" version "0.8.14"
id "maven-publish"
id "org.jetbrains.kotlin.jvm" version "1.5.10"
id "com.github.johnrengelman.shadow" version "7.0.0"
id "com.modrinth.minotaur" version "1.1.0"
}
sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16
archivesBaseName = project.archives_base_name
def ENV = System.getenv()
version = project.mod_version + "+local"
if (ENV.VERSION) {
version = ENV.VERSION
version = version.substring(version.lastIndexOf("/") + 1 + 1) // remove the '/' and the 'v'
}
group = project.maven_group
import com.modrinth.minotaur.TaskModrinthUpload
minecraft {
}
compileKotlin {
kotlinOptions {
jvmTarget = "16"
freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
}
}
configurations {
shade
implementation.extendsFrom shade
modShade
modImplementation.extendsFrom modShade
}
repositories {
maven {
name = "Kotlin Discord"
url = "https://maven.kotlindiscord.com/repository/maven-public/"
}
maven {
name = "Vankka"
url = "https://nexus.vankka.dev/repository/maven-public/"
}
maven {
name = "sonatype-oss"
url = "https://oss.sonatype.org/content/groups/public/"
}
maven {
name = "Ladysnake Libs"
url = "https://ladysnake.jfrog.io/artifactory/mods"
}
maven {
name = "Nucleoid"
url = "https://maven.nucleoid.xyz/"
}
maven {
name = "Jitpack"
url = "https://jitpack.io"
}
}
dependencies {
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
modApi "net.fabricmc:fabric-language-kotlin:${project.fabric_kotlin_version}"
shade "com.kotlindiscord.kord.extensions:kord-extensions:${project.kordex_version}"
// Cardinal Components
modImplementation "io.github.onyxstudios.Cardinal-Components-API:cardinal-components-base:${project.cardinal_components_version}"
include "io.github.onyxstudios.Cardinal-Components-API:cardinal-components-base:${project.cardinal_components_version}"
modImplementation "io.github.onyxstudios.Cardinal-Components-API:cardinal-components-entity:${project.cardinal_components_version}"
include "io.github.onyxstudios.Cardinal-Components-API:cardinal-components-entity:${project.cardinal_components_version}"
modImplementation "com.github.P03W:Aegis:3.0.0"
include "com.github.P03W:Aegis:3.0.0"
shade "dev.vankka:MCDiscordReserializer:4.1.1-SNAPSHOT"
shade "dev.vankka:SimpleAST:2.2.4-SNAPSHOT"
modImplementation("net.kyori:adventure-platform-fabric:4.1.0-SNAPSHOT") {
exclude module: "colonel"
}
include "net.kyori:adventure-platform-fabric:4.1.0-SNAPSHOT"
// include "ca.stellardrift:colonel:0.2"
include "net.kyori:adventure-api:4.2.0"
include "net.kyori:adventure-platform-api:4.0.0-SNAPSHOT"
include "net.kyori:adventure-text-feature-pagination:4.0.0-SNAPSHOT"
include "net.kyori:adventure-text-serializer-gson:4.2.0"
include "net.kyori:adventure-text-serializer-plain:4.2.0"
shade "club.minnced:discord-webhooks:${project.webhooks_version}"
shade "com.uchuhimo:konf-toml:${project.konf_version}"
shade "org.mozilla:rhino:1.7.13"
// server-translations
modImplementation "fr.catcore:server-translations-api:1.4.2+1.17"
include "fr.catcore:server-translations-api:1.4.2+1.17"
// Don't need slf4j anymore, MC includes it
// include "org.slf4j:slf4j-api:1.7.25"
// implementation "org.apache.logging.log4j:log4j-slf4j-impl:2.8.1"
// include "org.apache.logging.log4j:log4j-slf4j-impl:2.8.1"
}
processResources {
processResources {
inputs.property "version", project.version
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
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this task, sources will not be generated.
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = "sources"
from sourceSets.main.allSource
}
jar {
from "LICENSE"
from sourceSets.main.output
}
shadowJar {
from "LICENSE"
from sourceSets.main.output
configurations = [ project.configurations.shade, project.configurations.modShade ]
classifier = "dev-all"
exclude("kotlin/**", "kotlinx/**", "javax/**", "META-INF")
exclude "org/checkerframework/**", "org/jetbrains/**", "org/intellij/**"
exclude "com/google/gson/**"
exclude "net/kyori/**"
exclude "org/slf4j/**"
def relocPath = "me.geek.tom.serverutils.libs."
relocate "club.minnced.discord", relocPath + "club.minnced.discord"
relocate "com.fasterxml", relocPath + "com.fasterxml"
relocate "com.kotlindiscord", relocPath + "com.kotlindiscord"
relocate "com.moandjiezana.toml", relocPath + "com.moandjiezana.toml"
relocate "com.uchuhimo.konf", relocPath + "com.uchuhimo.konf"
relocate "dev.kord", relocPath + "dev.kord"
relocate "dev.vankka", relocPath + "dev.vankka"
relocate "io.ktor", relocPath + "io.ktor"
// Note: I am not using sentry in this mod, kordex has dependency on it as it has optional integration
relocate "io.sentry", relocPath + "io.sentry"
relocate "javassist", relocPath + "javassist"
// This broke stuff TODO: fix
// relocate "mu", relocPath + "mu"
relocate "net.time4j", relocPath + "net.time4j"
relocate "okhttp3", relocPath + "okhttp3"
relocate "okio", relocPath + "okio"
relocate "org.apache.commons.lang3", relocPath + "org.apache.commons.lang3"
relocate "org.apache.commons.collections4", relocPath + "org.apache.commons.collections4"
relocate "org.apache.commons.text", relocPath + "org.apache.commons.text"
relocate "org.json", relocPath + "org.json"
relocate "org.koin", relocPath = "org.koin"
relocate "org.mozilla", relocPath + "org.mozilla"
relocate "org.reflections", relocPath + "org.reflections"
}
remapJar {
dependsOn(shadowJar)
input.set(shadowJar.archivePath)
}
task publishModrinth(type: TaskModrinthUpload, dependsOn: remapJar) {
token = ENV["MODRINTH_TOKEN"]
projectId = "ul4zTWk4"
versionNumber = project.version
uploadFile = remapJar // This is the java jar task
addGameVersion("1.17-rc2")
addLoader("fabric")
}
apply from: "release_notifications.gradle"
// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven
artifact(jar) {
builtBy remapJar
}
artifact("${project.buildDir.absolutePath}/libs/${archivesBaseName}-${project.version}.jar"){
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
}
// select the repositories you want to publish to
repositories {
// uncomment to publish to the local maven
// mavenLocal()
}
}