forked from Minestom/Minestom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
209 lines (173 loc) · 6.68 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
import org.gradle.internal.os.OperatingSystem
plugins {
id 'java-library'
id 'maven-publish'
id 'org.jetbrains.kotlin.jvm' version '1.5.0'
id 'checkstyle'
id 'com.github.johnrengelman.shadow' version '7.0.0'
}
group 'net.minestom.server'
version '1.0'
sourceCompatibility = 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://jitpack.io' }
maven {
name 'sponge'
url 'https://repo.spongepowered.org/maven'
}
}
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, '/search.js')
searchScript.append '\n\n' +
'getURLPrefix = function(ui) {\n' +
' return \'\';\n' +
'};\n'
}
}
checkstyle {
toolVersion "8.42"
configFile file("${projectDir}/minestom_checks.xml")
}
}
sourceSets {
main {
java {
srcDir 'src/main/java'
srcDir 'src/autogenerated/java'
}
}
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()
}
withJavadocJar()
withSourcesJar()
}
test {
useJUnitPlatform()
}
tasks.withType(Zip).configureEach {
duplicatesStrategy DuplicatesStrategy.EXCLUDE
}
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
implementation 'io.netty:netty-handler:4.1.65.Final'
implementation 'io.netty:netty-codec:4.1.65.Final'
implementation 'io.netty:netty-transport-native-epoll:4.1.65.Final:linux-x86_64'
implementation 'io.netty:netty-transport-native-kqueue:4.1.65.Final:osx-x86_64'
// https://mvnrepository.com/artifact/it.unimi.dsi/fastutil
implementation 'it.unimi.dsi:fastutil:8.5.4'
// https://mvnrepository.com/artifact/com.google.code.gson/gson
implementation 'com.google.code.gson:gson:2.8.6'
// Noise library for terrain generation
// https://jitpack.io/#Articdive/Jnoise
implementation 'com.github.Articdive:Jnoise:2.1.0'
// https://mvnrepository.com/artifact/org.rocksdb/rocksdbjni
implementation 'org.rocksdb:rocksdbjni:6.16.4'
// Logging
implementation 'org.apache.logging.log4j:log4j-core:2.14.0'
// SLF4J is the base logger for most libraries, therefore we can hook it into log4j2.
implementation '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.20.0'
// Jline compatibility for windows
// https://search.maven.org/artifact/org.fusesource.jansi/jansi/2.3.2/jar
implementation 'org.fusesource.jansi:jansi:2.3.2'
implementation 'com.github.ben-manes.caffeine:caffeine:3.0.2'
// Guava 21.0+ required for Mixin
implementation 'com.google.guava:guava:30.1-jre'
// Code modification
implementation "org.ow2.asm:asm:${asmVersion}"
implementation "org.ow2.asm:asm-tree:${asmVersion}"
implementation "org.ow2.asm:asm-analysis:${asmVersion}"
implementation "org.ow2.asm:asm-util:${asmVersion}"
implementation "org.ow2.asm:asm-commons:${asmVersion}"
implementation "org.spongepowered:mixin:${mixinVersion}"
// Path finding
implementation 'com.github.MadMartian:hydrazine-path-finding:1.6.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${project.kotlinVersion}"
implementation "org.jetbrains.kotlin:kotlin-reflect:${project.kotlinVersion}"
// NBT parsing/manipulation/saving
implementation("com.github.jglrxavpok:Hephaistos:${project.hephaistosVersion}")
implementation("com.github.jglrxavpok:Hephaistos:${project.hephaistosVersion}:gson")
implementation("com.github.jglrxavpok:Hephaistos:${project.hephaistosVersion}") {
capabilities {
requireCapability("org.jglrxavpok.nbt:Hephaistos-gson")
}
}
implementation "com.github.Minestom:DependencyGetter:v1.0.1"
// Adventure, for user-interface
implementation "net.kyori:adventure-api:$adventureVersion"
implementation "net.kyori:adventure-text-serializer-gson:$adventureVersion"
implementation "net.kyori:adventure-text-serializer-plain:$adventureVersion"
implementation "net.kyori:adventure-text-serializer-legacy:$adventureVersion"
// LWJGL, for map rendering
implementation platform("org.lwjgl:lwjgl-bom:$lwjglVersion")
implementation "org.lwjgl:lwjgl"
implementation "org.lwjgl:lwjgl-egl"
implementation "org.lwjgl:lwjgl-opengl"
implementation "org.lwjgl:lwjgl-opengles"
implementation "org.lwjgl:lwjgl-glfw"
implementation "org.lwjgl:lwjgl-glfw"
implementation 'org.joml:joml:1.9.25'
implementation "org.lwjgl:lwjgl::$lwjglNatives"
implementation "org.lwjgl:lwjgl-opengl::$lwjglNatives"
implementation "org.lwjgl:lwjgl-opengles::$lwjglNatives"
implementation "org.lwjgl:lwjgl-glfw::$lwjglNatives"
}
shadowJar {
classifier('all')
}
configurations.all {
// we use jetbrains annotations
exclude group: "org.checkerframework", module: "checker-qual"
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}