2020-08-04 23:01:35 +02:00
|
|
|
import org.gradle.internal.os.OperatingSystem
|
|
|
|
|
2019-08-03 15:25:24 +02:00
|
|
|
plugins {
|
2020-05-03 16:05:04 +02:00
|
|
|
id 'java-library'
|
2020-08-10 15:20:09 +02:00
|
|
|
id 'java'
|
2020-08-10 15:48:11 +02:00
|
|
|
id 'maven-publish'
|
2019-09-14 18:00:18 +02:00
|
|
|
id 'net.ltgt.apt' version '0.10'
|
2020-07-06 23:20:20 +02:00
|
|
|
id 'org.jetbrains.kotlin.jvm' version '1.3.72'
|
2019-08-03 15:25:24 +02:00
|
|
|
}
|
|
|
|
|
2020-08-04 23:01:35 +02:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2020-06-30 02:42:02 +02:00
|
|
|
allprojects {
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
maven { url 'https://libraries.minecraft.net' }
|
|
|
|
maven { url 'https://jitpack.io' }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-24 03:25:58 +02:00
|
|
|
group 'net.minestom.server'
|
2019-08-03 15:25:24 +02:00
|
|
|
version '1.0'
|
|
|
|
|
2019-08-24 20:34:01 +02:00
|
|
|
sourceCompatibility = 1.11
|
2019-08-03 15:25:24 +02:00
|
|
|
|
2020-06-19 11:29:09 +02:00
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
java {
|
|
|
|
srcDir 'src/main/java'
|
|
|
|
srcDir 'src/autogenerated/java'
|
|
|
|
}
|
|
|
|
}
|
2020-06-30 00:07:40 +02:00
|
|
|
generators {
|
2020-06-19 11:29:09 +02:00
|
|
|
java {
|
|
|
|
srcDir 'src/generators/java'
|
|
|
|
}
|
|
|
|
|
|
|
|
compileClasspath += sourceSets.main.runtimeClasspath
|
|
|
|
runtimeClasspath += sourceSets.main.runtimeClasspath
|
|
|
|
}
|
2020-08-10 14:50:39 +02:00
|
|
|
lwjgl {
|
|
|
|
java {
|
|
|
|
srcDir 'src/lwjgl/java'
|
|
|
|
}
|
|
|
|
|
|
|
|
compileClasspath += sourceSets.main.runtimeClasspath
|
|
|
|
runtimeClasspath += sourceSets.main.runtimeClasspath
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Minestom uses LWJGL libs as optional dependency if interfacing with a GPU is asked
|
|
|
|
java {
|
|
|
|
registerFeature("lwjgl") {
|
|
|
|
usingSourceSet(sourceSets.lwjgl)
|
2020-08-10 15:20:09 +02:00
|
|
|
withJavadocJar()
|
|
|
|
withSourcesJar()
|
2020-08-10 14:50:39 +02:00
|
|
|
}
|
2020-06-19 11:29:09 +02:00
|
|
|
}
|
|
|
|
|
2020-07-31 22:31:58 +02:00
|
|
|
test {
|
|
|
|
useJUnitPlatform()
|
|
|
|
}
|
|
|
|
|
2019-08-03 15:25:24 +02:00
|
|
|
dependencies {
|
2020-07-13 19:34:32 +02:00
|
|
|
// Junit Testing Framework
|
|
|
|
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.2'
|
|
|
|
testRuntimeOnly('org.junit.jupiter:junit-jupiter-engine:5.6.2')
|
2019-09-14 18:00:18 +02:00
|
|
|
|
2020-07-13 19:34:32 +02:00
|
|
|
// Netty
|
2020-06-28 20:23:52 +02:00
|
|
|
api 'io.netty:netty-handler:4.1.45.Final'
|
|
|
|
api 'io.netty:netty-codec:4.1.45.Final'
|
|
|
|
implementation 'io.netty:netty-transport-native-epoll:4.1.45.Final:linux-x86_64'
|
2020-04-16 16:40:29 +02:00
|
|
|
|
2020-05-29 15:31:11 +02:00
|
|
|
api 'com.github.jhg023:Pbbl:1.0.2'
|
2020-04-17 01:16:02 +02:00
|
|
|
|
2019-09-14 18:00:18 +02:00
|
|
|
// https://mvnrepository.com/artifact/it.unimi.dsi/fastutil
|
2020-07-13 19:34:32 +02:00
|
|
|
api 'it.unimi.dsi:fastutil:8.3.0'
|
2019-09-14 18:00:18 +02:00
|
|
|
|
|
|
|
// https://mvnrepository.com/artifact/com.google.code.gson/gson
|
2020-07-13 19:34:32 +02:00
|
|
|
api 'com.google.code.gson:gson:2.8.6'
|
2020-04-05 10:15:21 +02:00
|
|
|
|
2020-07-13 19:34:32 +02:00
|
|
|
// Noise library for terrain generation
|
2020-05-10 16:02:49 +02:00
|
|
|
// https://jitpack.io/#Articdive/Jnoise
|
2020-07-13 19:34:32 +02:00
|
|
|
api 'com.github.Articdive:Jnoise:1.0.0'
|
2020-05-02 23:16:41 +02:00
|
|
|
|
2020-05-04 18:15:29 +02:00
|
|
|
// https://mvnrepository.com/artifact/org.rocksdb/rocksdbjni
|
2020-07-13 19:34:32 +02:00
|
|
|
api 'org.rocksdb:rocksdbjni:6.8.1'
|
2020-04-16 14:51:21 +02:00
|
|
|
|
2020-07-13 19:34:32 +02:00
|
|
|
// Logging
|
|
|
|
api 'org.apache.logging.log4j:log4j-core:2.13.3'
|
|
|
|
// SLF4J is the base logger for most libraries, therefore we can hook it into log4j2.
|
|
|
|
api 'org.apache.logging.log4j:log4j-slf4j-impl:2.13.3'
|
2020-05-10 16:02:49 +02:00
|
|
|
|
2020-06-22 00:04:19 +02:00
|
|
|
api 'com.mojang:authlib:1.5.21'
|
2020-07-01 01:17:58 +02:00
|
|
|
|
2020-06-22 00:04:19 +02:00
|
|
|
api 'org.projectlombok:lombok:1.18.12'
|
|
|
|
annotationProcessor 'org.projectlombok:lombok:1.18.12'
|
2020-05-29 20:44:03 +02:00
|
|
|
|
2020-08-10 07:24:43 +02:00
|
|
|
// Path finding
|
|
|
|
api 'com.github.MadMartian:hydrazine-path-finding:1.3.0'
|
2020-05-29 20:44:03 +02:00
|
|
|
|
2020-07-06 23:20:20 +02:00
|
|
|
api "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
|
2020-08-09 18:07:07 +02:00
|
|
|
api 'com.github.jglrxavpok:Hephaistos:v1.0.5'
|
2020-08-04 23:01:35 +02:00
|
|
|
|
|
|
|
// LWJGL, for map rendering
|
2020-08-10 14:50:39 +02:00
|
|
|
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"
|
|
|
|
lwjglRuntimeOnly "org.lwjgl:lwjgl::$lwjglNatives"
|
|
|
|
lwjglRuntimeOnly "org.lwjgl:lwjgl-opengl::$lwjglNatives"
|
|
|
|
lwjglRuntimeOnly "org.lwjgl:lwjgl-opengles::$lwjglNatives"
|
|
|
|
lwjglRuntimeOnly "org.lwjgl:lwjgl-glfw::$lwjglNatives"
|
2019-08-03 15:25:24 +02:00
|
|
|
}
|
2020-08-10 15:52:12 +02:00
|
|
|
|
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
mavenJava(MavenPublication) {
|
|
|
|
from components.java
|
|
|
|
}
|
|
|
|
}
|
2020-08-10 15:48:11 +02:00
|
|
|
}
|