forked from CCBlueX/LiquidBounce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
321 lines (271 loc) · 10.5 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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
/*
* This file is part of LiquidBounce (https://github.com/CCBlueX/LiquidBounce)
*
* Copyright (c) 2015 - 2024 CCBlueX
*
* LiquidBounce is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LiquidBounce is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LiquidBounce. If not, see <https://www.gnu.org/licenses/>.
*/
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
id 'fabric-loom'
id 'org.jetbrains.kotlin.jvm'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'com.gorylenko.gradle-git-properties' version '2.4.2'
id "io.gitlab.arturbosch.detekt" version "1.23.6"
id "com.github.node-gradle.node" version "7.0.2"
id 'org.jetbrains.dokka' version '1.9.10'
}
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
archivesBaseName = project.archives_base_name
version = project.mod_version
group = project.maven_group
loom {
accessWidenerPath = file('src/main/resources/liquidbounce.accesswidener')
}
repositories {
mavenCentral()
mavenLocal()
maven { url = 'https://maven.fabricmc.net/' }
maven {
name = 'Jitpack'
url = 'https://jitpack.io'
}
maven {
name = 'TerraformersMC'
url = 'https://maven.terraformersmc.com/'
}
maven {
name = 'ViaVersion'
url = 'https://repo.viaversion.com/'
}
maven {
name = "modrinth"
url = "https://api.modrinth.com/maven"
}
maven {
name = "OpenCollab Snapshots"
url = "https://repo.opencollab.dev/maven-snapshots/"
}
maven {
name = "Lenni0451"
url = "https://maven.lenni0451.net/everything"
}
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
// Minecraft
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
// Libraries (required mods)
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modImplementation "net.fabricmc:fabric-language-kotlin:${project.fabric_kotlin_version}"
implementation "net.fabricmc:tiny-mappings-parser:0.3.0+build.17"
// Recommended mods (on IDE)
modRuntimeOnly "com.terraformersmc:modmenu:${project.mod_menu_version}"
modImplementation "maven.modrinth:sodium:${project.sodium_version}"
modImplementation "de.florianmichael:ViaFabricPlus:${project.viafabricplus_version}"
// Tests
// modImplementation 'com.github.superblaubeere27:tenacc:e3a7ada99a'
// fix nullable imports
implementation 'com.google.code.findbugs:jsr305:3.0.2'
// Client libraries
implementation("com.github.CCBlueX:mc-authlib:${project.mc_authlib_version}") {
exclude group: 'com.google.code.gson', module: 'gson'
exclude group: 'org.apache.logging.log4j', module: 'log4j-core'
exclude group: 'org.apache.logging.log4j', module: 'log4j-api'
exclude group: 'org.apache.logging.log4j', module: 'log4j-slf4j-impl'
exclude group: 'org.slf4j', module: 'slf4j-api'
exclude group: 'com.mojang', module: 'authlib'
}
implementation "com.github.CCBlueX:mcef:916f8c5f73"
implementation "com.github.CCBlueX:DiscordIPC:-SNAPSHOT"
implementation 'org.graalvm.sdk:graal-sdk:23.0.3'
implementation 'org.graalvm.truffle:truffle-api:23.0.3'
implementation 'org.graalvm.js:js:23.0.3'
runtimeOnly 'org.graalvm.tools:profiler:23.0.1'
runtimeOnly 'org.graalvm.tools:chromeinspector:23.0.1'
// https://mvnrepository.com/artifact/io.netty/netty-codec
implementation 'io.netty:netty-codec:4.1.82.Final'
// https://mvnrepository.com/artifact/io.netty/netty-codec-http
implementation 'io.netty:netty-codec-http:4.1.82.Final'
// https://mvnrepository.com/artifact/io.netty/netty-handler-proxy
implementation 'io.netty:netty-handler-proxy:4.1.82.Final'
// https://mvnrepository.com/artifact/io.netty/netty-codec-socks
implementation 'io.netty:netty-codec-socks:4.1.82.Final'
implementation 'com.vdurmont:semver4j:3.1.0'
implementation 'org.apache.tika:tika-core:2.9.2'
implementation 'org.apache.commons:commons-exec:1.3'
// Test libraries
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
processResources {
inputs.property 'version', project.version
inputs.property 'minecraft_version', minecraft_version
inputs.property 'fabric_version', fabric_version
inputs.property 'loader_version', loader_version
inputs.property 'min_loader_version', min_loader_version
inputs.property 'fabric_kotlin_version', fabric_kotlin_version
inputs.property 'viafabricplus_version', viafabricplus_version
filesMatching('fabric.mod.json') {
expand([
version : project.version,
minecraft_version : minecraft_version,
fabric_version : fabric_version,
loader_version : loader_version,
min_loader_version : min_loader_version,
fabric_kotlin_version: fabric_kotlin_version,
viafabricplus_version: viafabricplus_version
])
}
}
// The following code will include the theme into the build
tasks.register('npmInstallTheme', NpmTask) {
workingDir = file('src-theme')
args = ['i']
doLast {
println 'Successfully installed dependencies for theme'
}
inputs.files('src-theme/package.json', 'src-theme/package-lock.json')
outputs.dir("src-theme/node_modules")
}
tasks.register('buildTheme', NpmTask) {
dependsOn 'npmInstallTheme'
workingDir = file('src-theme')
args = ['run', 'build']
doLast {
println 'Successfully build theme'
}
inputs.files(
'src-theme/package.json',
'src-theme/package-lock.json',
'src-theme/bundle.cjs',
'src-theme/rollup.config.js'
)
inputs.dir("src-theme/src")
outputs.dir('src-theme/dist')
}
tasks.register('bundleTheme', NodeTask) {
dependsOn 'buildTheme'
workingDir = file('src-theme')
script = file('src-theme/bundle.cjs')
doLast {
println 'Successfully attached theme to build'
}
// Incremental stuff
inputs.files(
'src-theme/package.json',
'src-theme/package-lock.json',
'src-theme/bundle.cjs',
'src-theme/rollup.config.js'
)
inputs.dir("src-theme/src")
inputs.dir("src-theme/public")
inputs.dir("src-theme/dist")
outputs.files('src-theme/resources/assets/liquidbounce/default_theme.zip')
}
sourceSets {
main {
resources {
srcDirs 'src-theme/resources'
}
}
}
processResources.dependsOn bundleTheme
// 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).configureEach {
// 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
// If Javadoc is generated, this must be specified in that task too.
it.options.encoding = 'UTF-8'
// Minecraft 1.20.5 upwards uses Java 17.
it.options.release = 21
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
}
detekt {
config.setFrom(file("${rootProject.projectDir}/config/detekt/detekt.yml"))
buildUponDefaultConfig = true
baseline = file("${rootProject.projectDir}/config/detekt/baseline.xml")
}
task detektProjectBaseline(type: io.gitlab.arturbosch.detekt.DetektCreateBaselineTask) {
description = "Overrides current baseline."
ignoreFailures.set(true)
parallel.set(true)
buildUponDefaultConfig.set(true)
setSource(files(rootDir))
config.setFrom(files("$rootDir/config/detekt/detekt.yml"))
baseline.set(file("$rootDir/config/detekt/baseline.xml"))
include("**/*.kt")
include("**/*.kts")
exclude("**/resources/**")
exclude("**/build/**")
}
java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()
}
compileKotlin {
compilerOptions {
suppressWarnings = true
jvmTarget = JvmTarget.JVM_21
}
}
shadowJar {
archiveClassifier.set('shadow')
// Natives are going to be downloaded from our cloud
exclude 'native-binaries/*'
// META-INF/versions/20
exclude "META-INF/versions/20/**"
dependencies {
include(dependency('com.github.CCBlueX:mcef'))
include(dependency('com.github.CCBlueX:mc-authlib'))
include(dependency('com.github.CCBlueX:DiscordIPC'))
include(dependency('com.thealtening.api:api'))
include(dependency('net.fabricmc:tiny-mappings-parser'))
include(dependency('org.graalvm.sdk:graal-sdk'))
include(dependency('org.graalvm.truffle:truffle-api'))
include(dependency('org.graalvm.js:js'))
include(dependency('io.netty:netty-codec'))
include(dependency('io.netty:netty-codec-http'))
include(dependency('io.netty:netty-handler-proxy'))
include(dependency('io.netty:netty-codec-socks'))
include(dependency('org.apache.commons:commons-exec'))
include(dependency('org.apache.tika:tika-core'))
include(dependency('com.vdurmont:semver4j'))
include(dependency('com.kohlschutter.junixsocket:junixsocket-common'))
include(dependency('com.kohlschutter.junixsocket:junixsocket-native-common'))
include(dependency('net.lenni0451:Reflect'))
}
}
jar {
from 'LICENSE'
}
remapJar {
inputFile = shadowJar.archiveFile
}
tasks.register('copyZipInclude', Copy) {
from 'zip_include/'
into 'build/libs/zip'
}
sourcesJar.dependsOn bundleTheme
build.dependsOn copyZipInclude