-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
209 lines (168 loc) · 6.45 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
/*
* This file is part of LiquidBounce (https://github.com/CCBlueX/LiquidBounce)
*
* Copyright (c) 2016 - 2022 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/>.
*/
plugins {
id "fabric-loom"
id "org.jetbrains.kotlin.jvm"
id "com.github.johnrengelman.shadow" version "7.1.2"
id "org.jlleitschuh.gradle.ktlint" version "11.4.0"
}
ktlint {
enableExperimentalRules = true
ignoreFailures = true
disabledRules = ["no-wildcard-imports", "no-blank-line-before-rbrace"]
reporters {
reporter "plain"
reporter "checkstyle"
}
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
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 { url = "https://jitpack.io" }
maven {
name = 'TerraformersMC'
url = 'https://maven.terraformersmc.com/'
}
maven { url = "https://repo.viaversion.com/" }
}
dependencies {
// 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}"
modImplementation "com.viaversion:viaversion:4.7.1-SNAPSHOT"
modImplementation "com.github.FlorianMichael:ViaLoadingBase:4.4.8"
// Recommended mods (on IDE)
modRuntimeOnly "com.terraformersmc:modmenu:${project.mod_menu_version}"
modRuntimeOnly "com.github.CaffeineMC:sodium-fabric:${project.sodium_version}"
modRuntimeOnly "com.github.CaffeineMC:lithium-fabric:${project.lithium_version}"
// modRuntimeOnly "com.github.CaffeineMC:phosphor-fabric:${project.phosphor_version}"
// fix nullable imports
implementation "com.google.code.findbugs:jsr305:3.0.2"
// Client libraries
implementation ('com.thealtening.api:api:4.1.0') {
exclude group: 'com.google.code.gson', module: 'gson'
}
implementation "com.github.CCBlueX:Elixir:1.2.6"
implementation "com.labymedia:ultralight-java-base:0.4.12"
implementation "com.labymedia:ultralight-java-databind:0.4.12"
implementation "com.labymedia:ultralight-java-gpu:0.4.12"
implementation "com.labymedia:ultralight-java-glfw-opengl-util:0.4.12"
implementation "org.graalvm.sdk:graal-sdk:22.3.2"
implementation "org.graalvm.truffle:truffle-api:22.3.2"
implementation "org.graalvm.js:js:22.3.2"
runtimeOnly "org.graalvm.tools:profiler:22.3.2"
runtimeOnly "org.graalvm.tools:chromeinspector:22.3.2"
// 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'
// Test libraries
testImplementation "org.junit.jupiter:junit-jupiter:5.9.2"
}
processResources {
inputs.property "version", project.version
filesMatching("fabric.mod.json") {
expand "version": project.version
}
}
// The following code will include the theme into the build
task makeTheme(type: Exec) {
workingDir file("src-theme")
commandLine "python", "build.py"
doLast {
println "Successfully exported theme.zip"
}
}
sourceSets {
main {
resources {
srcDirs "src-theme/resources"
}
}
}
processResources.dependsOn makeTheme
// 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.18 upwards uses Java 17.
it.options.release = 17
}
tasks.withType(Test) {
useJUnitPlatform()
}
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 {
kotlinOptions {
suppressWarnings = true
jvmTarget = 17
}
}
shadowJar {
archiveClassifier.set('shadow')
// Natives are going to be downloaded from our cloud
exclude "native-binaries/*"
dependencies {
include(dependency('com.labymedia:ultralight-java-base'))
include(dependency('com.labymedia:ultralight-java-databind'))
include(dependency('com.labymedia:ultralight-java-gpu'))
include(dependency('com.labymedia:ultralight-java-glfw-opengl-util'))
include(dependency('com.thealtening.api:api'))
include(dependency('com.github.CCBlueX:Elixir'))
include(dependency("org.graalvm.sdk:graal-sdk:22.3.2"))
include(dependency("org.graalvm.truffle:truffle-api:22.3.2"))
include(dependency("org.graalvm.js:js:22.3.2"))
include(dependency('io.netty:netty-codec-http'))
include(dependency('io.netty:netty-handler-proxy'))
}
}
jar {
from "LICENSE"
}
remapJar {
inputFile = shadowJar.archiveFile
}
task copyZipInclude(type: Copy) {
from 'zip_include/'
into 'build/libs/zip'
}
build.dependsOn copyZipInclude