forked from Minestom/Minestom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
225 lines (187 loc) · 6.94 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
import org.gradle.internal.os.OperatingSystem
plugins {
id 'java-library'
id 'java'
id 'maven-publish'
id 'net.ltgt.apt' version '0.10'
id 'org.jetbrains.kotlin.jvm' version '1.4.21'
id 'checkstyle'
}
group 'net.minestom.server'
version '1.0'
sourceCompatibility = 1.11
project.ext.lwjglVersion = "3.2.3"
switch (OperatingSystem.current()) {
case OperatingSystem.LINUX:
def osArch = System.getProperty("os.arch")
project.ext.lwjglNatives = osArch.startsWith("arm") || osArch.startsWith("aarch64")
? "natives-linux-${osArch.contains("64") || osArch.startsWith("armv8") ? "arm64" : "arm32"}"
: "natives-linux"
break
case OperatingSystem.MAC_OS:
project.ext.lwjglNatives = "natives-macos"
break
case OperatingSystem.WINDOWS:
project.ext.lwjglNatives = System.getProperty("os.arch").contains("64") ? "natives-windows" : "natives-windows-x86"
break
}
allprojects {
repositories {
mavenCentral()
maven { url 'https://libraries.minecraft.net' }
maven { url 'https://jitpack.io' }
maven {
name 'sponge'
url 'https://repo.spongepowered.org/maven'
}
maven {
url "https://repo.velocitypowered.com/snapshots/"
}
}
javadoc {
options {
destinationDir(file("docs"))
addBooleanOption('html5', true)
links "https://jd.adventure.kyori.net/api/$adventureVersion/"
links "https://docs.oracle.com/en/java/javase/11/docs/api/"
}
// see https://stackoverflow.com/a/56641766
doLast {
// Append the fix to the file
def searchScript = new File(destinationDir.getAbsolutePath() + '/search.js')
searchScript.append '\n\n' +
'getURLPrefix = function(ui) {\n' +
' return \'\';\n' +
'};\n'
}
}
checkstyle {
toolVersion "8.37"
configFile file("${projectDir}/minestom_checks.xml")
}
}
sourceSets {
main {
java {
srcDir 'src/main/java'
srcDir 'src/autogenerated/java'
}
}
generators {
java {
srcDir 'src/generators/java'
}
compileClasspath += sourceSets.main.runtimeClasspath
runtimeClasspath += sourceSets.main.runtimeClasspath
}
lwjgl {
java {
srcDir 'src/lwjgl/java'
}
compileClasspath += sourceSets.main.runtimeClasspath
runtimeClasspath += sourceSets.main.runtimeClasspath
}
}
java {
// Minestom uses LWJGL libs as optional dependency if interfacing with a GPU is asked
registerFeature("lwjgl") {
usingSourceSet(sourceSets.lwjgl)
withJavadocJar()
withSourcesJar()
}
registerFeature("generators") {
usingSourceSet(sourceSets.generators)
withJavadocJar()
withSourcesJar()
}
withJavadocJar()
withSourcesJar()
}
test {
useJUnitPlatform()
}
dependencies {
// Junit Testing Framework
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.2'
testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine:5.6.2')
// Only here to ensure J9 module support for extensions and our classloaders
testCompileOnly "org.mockito:mockito-core:2.28.2"
// Netty
api 'io.netty:netty-handler:4.1.63.Final'
api 'io.netty:netty-codec:4.1.63.Final'
api 'io.netty:netty-transport-native-epoll:4.1.63.Final:linux-x86_64'
api 'io.netty:netty-transport-native-kqueue:4.1.63.Final:osx-x86_64'
api 'io.netty.incubator:netty-incubator-transport-native-io_uring:0.0.5.Final:linux-x86_64'
// https://mvnrepository.com/artifact/org.apache.commons/commons-text
compile group: 'org.apache.commons', name: 'commons-text', version: '1.9'
// https://mvnrepository.com/artifact/it.unimi.dsi/fastutil
api 'it.unimi.dsi:fastutil:8.5.4'
// https://mvnrepository.com/artifact/com.google.code.gson/gson
api 'com.google.code.gson:gson:2.8.6'
// Noise library for terrain generation
// https://jitpack.io/#Articdive/Jnoise
api 'com.github.Articdive:Jnoise:1.0.0'
// https://mvnrepository.com/artifact/org.rocksdb/rocksdbjni
api 'org.rocksdb:rocksdbjni:6.16.4'
// Logging
api 'org.apache.logging.log4j:log4j-core:2.14.0'
// SLF4J is the base logger for most libraries, therefore we can hook it into log4j2.
api 'org.apache.logging.log4j:log4j-slf4j-impl:2.14.0'
// https://mvnrepository.com/artifact/org.jline/jline
implementation group: 'org.jline', name: 'jline', version: '3.19.0'
// Guava 21.0+ required for Mixin, but Authlib imports 17.0
api 'com.google.guava:guava:30.1-jre'
api 'com.mojang:authlib:1.5.21'
// Code modification
api "org.ow2.asm:asm:${asmVersion}"
api "org.ow2.asm:asm-tree:${asmVersion}"
api "org.ow2.asm:asm-analysis:${asmVersion}"
api "org.ow2.asm:asm-util:${asmVersion}"
api "org.ow2.asm:asm-commons:${asmVersion}"
api "org.spongepowered:mixin:${mixinVersion}"
// Compression
implementation "com.velocitypowered:velocity-native:1.1.0-SNAPSHOT"
// Path finding
api 'com.github.MadMartian:hydrazine-path-finding:1.6.0'
api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${project.kotlinVersion}"
api "org.jetbrains.kotlin:kotlin-reflect:${project.kotlinVersion}"
// NBT parsing/manipulation/saving
api("com.github.jglrxavpok:Hephaistos:${project.hephaistosVersion}")
api("com.github.jglrxavpok:Hephaistos:${project.hephaistosVersion}:gson")
api("com.github.jglrxavpok:Hephaistos:${project.hephaistosVersion}") {
capabilities {
requireCapability("org.jglrxavpok.nbt:Hephaistos-gson")
}
}
api "com.github.Minestom:DependencyGetter:v1.0.1"
// Adventure, for user-interface
api "net.kyori:adventure-api:$adventureVersion"
api "net.kyori:adventure-text-serializer-gson:$adventureVersion"
api "net.kyori:adventure-text-serializer-plain:$adventureVersion"
api "net.kyori:adventure-text-serializer-legacy:$adventureVersion"
// LWJGL, for map rendering
lwjglApi platform("org.lwjgl:lwjgl-bom:$lwjglVersion")
lwjglApi "org.lwjgl:lwjgl"
lwjglApi "org.lwjgl:lwjgl-egl"
lwjglApi "org.lwjgl:lwjgl-opengl"
lwjglApi "org.lwjgl:lwjgl-opengles"
lwjglApi "org.lwjgl:lwjgl-glfw"
lwjglApi "org.lwjgl:lwjgl-glfw"
lwjglApi 'org.joml:joml:1.9.25'
lwjglRuntimeOnly "org.lwjgl:lwjgl::$lwjglNatives"
lwjglRuntimeOnly "org.lwjgl:lwjgl-opengl::$lwjglNatives"
lwjglRuntimeOnly "org.lwjgl:lwjgl-opengles::$lwjglNatives"
lwjglRuntimeOnly "org.lwjgl:lwjgl-glfw::$lwjglNatives"
generatorsImplementation("com.squareup:javapoet:1.13.0")
}
configurations.all {
// we use jetbrains annotations
exclude group: "org.checkerframework", module: "checker-qual"
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}