Minestom/build.gradle

190 lines
5.6 KiB
Groovy
Raw Normal View History

2020-08-04 23:01:35 +02:00
import org.gradle.internal.os.OperatingSystem
2019-08-03 15:25:24 +02:00
plugins {
id 'java-library'
id 'java'
id 'maven-publish'
2019-09-14 18:00:18 +02:00
id 'net.ltgt.apt' version '0.10'
2021-01-23 09:32:18 +01:00
id 'org.jetbrains.kotlin.jvm' version '1.4.21'
2020-11-18 00:50:27 +01:00
id 'checkstyle'
2019-08-03 15:25:24 +02:00
}
2020-11-16 03:10:51 +01:00
group 'net.minestom.server'
version '1.0'
sourceCompatibility = 1.11
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
}
allprojects {
repositories {
mavenCentral()
maven { url 'https://libraries.minecraft.net' }
maven { url 'https://jitpack.io' }
2020-08-23 22:38:27 +02:00
maven {
name 'sponge'
2020-11-18 00:50:27 +01:00
url 'https://repo.spongepowered.org/maven'
2020-08-23 22:38:27 +02:00
}
}
2020-10-13 10:51:48 +02:00
javadoc {
options {
2020-11-15 23:39:49 +01:00
destinationDir(file("docs"))
2020-10-13 10:51:48 +02:00
addBooleanOption('html5', true)
}
}
2020-11-20 01:30:01 +01:00
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()
}
2020-09-20 15:04:07 +02:00
registerFeature("generators") {
usingSourceSet(sourceSets.generators)
withJavadocJar()
withSourcesJar()
}
2020-09-20 15:04:07 +02:00
withJavadocJar()
withSourcesJar()
}
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
2021-01-14 01:38:34 +01:00
api 'io.netty:netty-handler:4.1.57.Final'
api 'io.netty:netty-codec:4.1.57.Final'
api 'io.netty:netty-transport-native-epoll:4.1.57.Final:linux-x86_64'
api 'io.netty:netty-transport-native-kqueue:4.1.57.Final:osx-x86_64'
2020-12-08 18:09:37 +01:00
api 'io.netty.incubator:netty-incubator-transport-native-io_uring:0.0.2.Final:linux-x86_64'
2020-04-16 16:40:29 +02:00
// https://mvnrepository.com/artifact/org.apache.commons/commons-text
compile group: 'org.apache.commons', name: 'commons-text', version: '1.9'
2019-09-14 18:00:18 +02:00
// https://mvnrepository.com/artifact/it.unimi.dsi/fastutil
2020-12-12 23:15:33 +01:00
api 'it.unimi.dsi:fastutil:8.4.4'
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
// 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
// https://mvnrepository.com/artifact/org.rocksdb/rocksdbjni
2021-01-14 01:38:34 +01:00
api 'org.rocksdb:rocksdbjni:6.15.2'
2020-04-16 14:51:21 +02:00
2020-07-13 19:34:32 +02:00
// Logging
2020-11-13 09:56:28 +01:00
api 'org.apache.logging.log4j:log4j-core:2.14.0'
2020-07-13 19:34:32 +02:00
// SLF4J is the base logger for most libraries, therefore we can hook it into log4j2.
2020-11-13 09:56:28 +01:00
api 'org.apache.logging.log4j:log4j-slf4j-impl:2.14.0'
2020-11-18 09:24:59 +01:00
// Guava 21.0+ required for Mixin, but Authlib imports 17.0
api 'com.google.guava:guava:21.0'
api 'com.mojang:authlib:1.5.21'
2020-08-21 01:32:59 +02:00
// Code modification
2020-08-23 22:38:27 +02:00
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}"
2020-08-21 01:32:59 +02:00
// Path finding
2021-01-04 21:37:34 +01:00
api 'com.github.MadMartian:hydrazine-path-finding:1.5.2'
2020-05-29 20:44:03 +02:00
2021-01-23 09:32:18 +01:00
api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${project.kotlinVersion}"
api "org.jetbrains.kotlin:kotlin-reflect:${project.kotlinVersion}"
// NBT parsing/manipulation/saving
2021-01-23 09:32:18 +01:00
api("com.github.jglrxavpok:Hephaistos:${project.hephaistosVersion}")
api("com.github.jglrxavpok:Hephaistos:${project.hephaistosVersion}:gson")
api("com.github.jglrxavpok:Hephaistos:${project.hephaistosVersion}") {
2020-10-16 12:16:06 +02:00
capabilities {
requireCapability("org.jglrxavpok.nbt:Hephaistos-gson")
}
}
2020-08-04 23:01:35 +02:00
implementation "com.github.Minestom:DependencyGetter:v1.0.1"
2020-08-04 23:01:35 +02:00
// 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"
2020-10-25 17:54:10 +01:00
generatorsImplementation("com.squareup:javapoet:1.13.0")
2019-08-03 15:25:24 +02:00
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}