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.3.72' } 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' } } } group 'net.minestom.server' version '1.0' sourceCompatibility = 1.11 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 } } // Minestom uses LWJGL libs as optional dependency if interfacing with a GPU is asked java { registerFeature("lwjgl") { usingSourceSet(sourceSets.lwjgl) 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') // Netty 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' api 'com.github.jhg023:Pbbl:1.0.2' // https://mvnrepository.com/artifact/it.unimi.dsi/fastutil api 'it.unimi.dsi:fastutil:8.3.0' // 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.8.1' // 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' api 'com.mojang:authlib:1.5.21' api 'org.projectlombok:lombok:1.18.12' annotationProcessor 'org.projectlombok:lombok:1.18.12' // Path finding api 'com.github.MadMartian:hydrazine-path-finding:1.3.0' api "org.jetbrains.kotlin:kotlin-stdlib-jdk8" api 'com.github.jglrxavpok:Hephaistos:v1.0.5' // 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" } publishing { publications { mavenJava(MavenPublication) { from components.java } } }