Initial move to gradle

This commit is contained in:
RednedEpic 2022-02-27 16:38:55 -06:00
parent 354e87b747
commit 6321ecc166
50 changed files with 1052 additions and 1279 deletions

6
Jenkinsfile vendored
View file

@ -1,7 +1,7 @@
pipeline {
agent any
tools {
maven 'Maven 3'
gradle 'Gradle 7'
jdk 'Java 16'
}
options {
@ -11,11 +11,11 @@ pipeline {
stage ('Build') {
steps {
sh 'git submodule update --init --recursive'
sh 'mvn clean package'
sh './gradlew shadowJar'
}
post {
success {
archiveArtifacts artifacts: 'bootstrap/**/target/*.jar', excludes: 'bootstrap/**/target/original-*.jar', fingerprint: true
archiveArtifacts artifacts: 'bootstrap/**/build/libs/*.jar', excludes: 'bootstrap/**/build/libs/original-*.jar', fingerprint: true
}
}
}

0
ap/build.gradle.kts Normal file
View file

View file

@ -163,6 +163,7 @@ public class ClassProcessor extends AbstractProcessor {
this.processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE, "Reading existing " + this.annotationClassName + " list from " + this.outputPath);
return Files.newBufferedReader(this.outputPath);
}
FileObject obj = this.processingEnv.getFiler().getResource(StandardLocation.CLASS_OUTPUT, "", this.annotationClassName);
if (obj != null) {
this.processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE, "Reading existing " + this.annotationClassName + " list from " + obj.toUri());

View file

@ -0,0 +1 @@
provided("net.kyori", "event-api", Versions.eventVersion)

View file

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.geysermc</groupId>
<artifactId>api-parent</artifactId>
<version>2.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>base-api</artifactId>
<properties>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
<version>3.19.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View file

@ -0,0 +1,3 @@
dependencies {
api(projects.api)
}

View file

@ -1,48 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>org.geysermc</groupId>
<artifactId>api-parent</artifactId>
<version>2.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>geyser-api</artifactId>
<properties>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
<adventure.version>4.9.3</adventure.version>
</properties>
<dependencies>
<dependency>
<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
<version>3.19.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>event-api</artifactId>
<version>3.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.geysermc</groupId>
<artifactId>base-api</artifactId>
<version>2.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.27</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

View file

@ -55,9 +55,9 @@ public interface GeyserApi extends GeyserApiBase {
* Gets if this Geyser instance is running in an IDE. This only needs to be used in cases where files
* expected to be in a jarfile are not present.
*
* @return true if the version number is not 'DEV'.
* @return if we are in a production environment
*/
boolean productionEnvironment();
boolean isProductionEnvironment();
/**
* {@inheritDoc}

View file

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.geysermc</groupId>
<artifactId>geyser-parent</artifactId>
<version>2.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>api-parent</artifactId>
<packaging>pom</packaging>
<properties>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
</properties>
<modules>
<module>base</module>
<module>geyser</module>
</modules>
</project>

View file

@ -0,0 +1,35 @@
val bungeeVersion = "a7c6ede";
dependencies {
api(projects.core)
}
platformRelocate("net.md_5.bungee.jni")
platformRelocate("com.fasterxml.jackson")
platformRelocate("io.netty.channel.kqueue") // This is not used because relocating breaks natives, but we must include it or else we get ClassDefNotFound
platformRelocate("net.kyori")
// These dependencies are already present on the platform
provided("com.github.SpigotMC.BungeeCord", "bungeecord-proxy", bungeeVersion)
application {
mainClass.set("org.geysermc.geyser.platform.bungeecord.GeyserBungeeMain")
}
tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
archiveBaseName.set("Geyser-BungeeCord")
dependencies {
exclude(dependency("com.google.*:.*"))
exclude(dependency("org.yaml:.*"))
exclude(dependency("io.netty:netty-transport-native-epoll:.*"))
exclude(dependency("io.netty:netty-transport-native-unix-common:.*"))
exclude(dependency("io.netty:netty-handler:.*"))
exclude(dependency("io.netty:netty-common:.*"))
exclude(dependency("io.netty:netty-buffer:.*"))
exclude(dependency("io.netty:netty-resolver:.*"))
exclude(dependency("io.netty:netty-transport:.*"))
exclude(dependency("io.netty:netty-codec:.*"))
exclude(dependency("io.netty:netty-resolver-dns:.*"))
}
}

View file

@ -1,103 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.geysermc</groupId>
<artifactId>bootstrap-parent</artifactId>
<version>2.0.1-SNAPSHOT</version>
</parent>
<artifactId>bootstrap-bungeecord</artifactId>
<dependencies>
<dependency>
<groupId>org.geysermc</groupId>
<artifactId>core</artifactId>
<version>2.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<!-- Used for better working with internals without reflection -->
<dependency>
<groupId>com.github.SpigotMC.BungeeCord</groupId>
<artifactId>bungeecord-proxy</artifactId>
<version>a7c6ede</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>${outputName}-BungeeCord</finalName>
<resources>
<resource>
<directory>src/main/resources/</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifestEntries>
<Main-Class>org.geysermc.geyser.platform.bungeecord.GeyserBungeeMain</Main-Class>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0-SNAPSHOT</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>net.md_5.bungee.jni</pattern>
<shadedPattern>org.geysermc.geyser.platform.bungeecord.shaded.jni</shadedPattern>
</relocation>
<relocation>
<pattern>com.fasterxml.jackson</pattern>
<shadedPattern>org.geysermc.geyser.platform.bungeecord.shaded.jackson</shadedPattern>
</relocation>
<relocation>
<!-- This is not used because relocating breaks natives, but we must include it
or else we get ClassDefNotFound -->
<pattern>io.netty.channel.kqueue</pattern>
<shadedPattern>org.geysermc.geyser.platform.bungeecord.shaded.io.netty.channel.kqueue</shadedPattern>
</relocation>
<relocation>
<pattern>net.kyori</pattern>
<shadedPattern>org.geysermc.geyser.platform.bungeecord.shaded.kyori</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
<configuration>
<artifactSet>
<excludes>
<exclude>com.google.*:*</exclude>
<exclude>org.yaml:*</exclude>
<exclude>io.netty:netty-transport-native-epoll:*</exclude>
<exclude>io.netty:netty-transport-native-unix-common:*</exclude>
<exclude>io.netty:netty-handler:*</exclude>
<exclude>io.netty:netty-common:*</exclude>
<exclude>io.netty:netty-buffer:*</exclude>
<exclude>io.netty:netty-resolver:*</exclude>
<exclude>io.netty:netty-transport:*</exclude>
<exclude>io.netty:netty-codec:*</exclude>
<exclude>io.netty:netty-resolver-dns:*</exclude>
</excludes>
</artifactSet>
</configuration>
</plugin>
</plugins>
</build>
</project>

View file

@ -27,6 +27,7 @@ package org.geysermc.geyser.platform.bungeecord;
import net.md_5.bungee.api.config.ListenerInfo;
import net.md_5.bungee.api.plugin.Plugin;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.geysermc.common.PlatformType;
import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.GeyserBootstrap;
@ -40,7 +41,6 @@ import org.geysermc.geyser.util.FileUtils;
import org.geysermc.geyser.text.GeyserLocale;
import org.geysermc.geyser.platform.bungeecord.command.GeyserBungeeCommandExecutor;
import org.geysermc.geyser.platform.bungeecord.command.GeyserBungeeCommandManager;
import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.io.IOException;

View file

@ -1,5 +1,5 @@
main: org.geysermc.geyser.platform.bungeecord.GeyserBungeePlugin
name: ${outputName}-BungeeCord
author: ${project.organization.name}
website: ${project.organization.url}
version: ${project.version}
name: ${name}-BungeeCord
author: ${author}
website: ${url}
version: ${version}

View file

@ -1,49 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.geysermc</groupId>
<artifactId>geyser-parent</artifactId>
<version>2.0.1-SNAPSHOT</version>
</parent>
<artifactId>bootstrap-parent</artifactId>
<packaging>pom</packaging>
<repositories>
<repository>
<id>spigot-public</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/public/</url>
</repository>
<repository>
<id>sponge-repo</id>
<url>https://repo.spongepowered.org/repository/maven-public/</url>
</repository>
<repository>
<id>bungeecord-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
<repository>
<id>velocity-repo</id>
<url>https://repo.velocitypowered.com/snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.geysermc</groupId>
<artifactId>ap</artifactId>
<version>2.0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
<modules>
<module>bungeecord</module>
<module>spigot</module>
<module>sponge</module>
<module>standalone</module>
<module>velocity</module>
</modules>
</project>

View file

@ -0,0 +1,46 @@
val paperVersion = "1.17.1-R0.1-SNAPSHOT" // Needed because we do not support Java 17 yet
val viaVersion = "4.0.0"
val adaptersVersion = "1.3-SNAPSHOT"
dependencies {
api(projects.core)
implementation("org.geysermc.geyser.adapters", "spigot-all", adaptersVersion)
}
platformRelocate("it.unimi.dsi.fastutil")
platformRelocate("com.fasterxml.jackson")
platformRelocate("net.kyori")
platformRelocate("org.objectweb.asm")
// These dependencies are already present on the platform
provided("io.papermc.paper", "paper-api", paperVersion)
provided("com.viaversion", "viaversion", viaVersion)
application {
mainClass.set("org.geysermc.geyser.platform.spigot.GeyserSpigotMain")
}
tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
archiveBaseName.set("Geyser-Spigot")
dependencies {
exclude(dependency("com.google.*:.*"))
exclude(dependency("org.yaml:.*"))
// We cannot shade Netty, or else native libraries will not load
// Needed because older Spigot builds do not provide the haproxy module
exclude(dependency("io.netty:netty-transport-native-epoll:.*"))
exclude(dependency("io.netty:netty-transport-native-unix-common:.*"))
exclude(dependency("io.netty:netty-transport-native-kqueue:.*"))
exclude(dependency("io.netty:netty-handler:.*"))
exclude(dependency("io.netty:netty-common:.*"))
exclude(dependency("io.netty:netty-buffer:.*"))
exclude(dependency("io.netty:netty-resolver:.*"))
exclude(dependency("io.netty:netty-transport:.*"))
exclude(dependency("io.netty:netty-codec:.*"))
exclude(dependency("io.netty:netty-codec-dns:.*"))
exclude(dependency("io.netty:netty-resolver-dns:.*"))
exclude(dependency("io.netty:netty-resolver-dns-native-macos:.*"))
}
}

View file

@ -1,127 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.geysermc</groupId>
<artifactId>bootstrap-parent</artifactId>
<version>2.0.1-SNAPSHOT</version>
</parent>
<artifactId>bootstrap-spigot</artifactId>
<repositories>
<repository>
<id>papermc</id>
<url>https://papermc.io/repo/repository/maven-public/</url>
</repository>
<repository>
<id>viaversion-repo</id>
<url>https://repo.viaversion.com</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.geysermc</groupId>
<artifactId>core</artifactId>
<version>2.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.18.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.viaversion</groupId>
<artifactId>viaversion</artifactId>
<version>4.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.geysermc.geyser.adapters</groupId>
<artifactId>spigot-all</artifactId>
<version>1.3-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<finalName>${outputName}-Spigot</finalName>
<resources>
<resource>
<directory>src/main/resources/</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifestEntries>
<Main-Class>org.geysermc.geyser.platform.spigot.GeyserSpigotMain</Main-Class>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0-SNAPSHOT</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>it.unimi.dsi.fastutil</pattern>
<shadedPattern>org.geysermc.geyser.platform.spigot.shaded.fastutil</shadedPattern>
</relocation>
<relocation>
<pattern>com.fasterxml.jackson</pattern>
<shadedPattern>org.geysermc.geyser.platform.spigot.shaded.jackson</shadedPattern>
</relocation>
<relocation>
<pattern>net.kyori</pattern>
<shadedPattern>org.geysermc.geyser.platform.spigot.shaded.kyori</shadedPattern>
</relocation>
<relocation>
<pattern>org.objectweb.asm</pattern>
<shadedPattern>org.geysermc.geyser.platform.spigot.shaded.asm</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
<configuration>
<artifactSet>
<excludes>
<exclude>com.google.*:*</exclude>
<exclude>org.yaml:*</exclude>
<!-- We cannot shade Netty, or else native libraries will not load -->
<!-- Needed because older Spigot builds do not provide the haproxy module -->
<exclude>io.netty:netty-transport-native-epoll:*</exclude>
<exclude>io.netty:netty-transport-native-unix-common:*</exclude>
<exclude>io.netty:netty-transport-native-kqueue:*</exclude>
<exclude>io.netty:netty-handler:*</exclude>
<exclude>io.netty:netty-common:*</exclude>
<exclude>io.netty:netty-buffer:*</exclude>
<exclude>io.netty:netty-resolver:*</exclude>
<exclude>io.netty:netty-transport:*</exclude>
<exclude>io.netty:netty-codec:*</exclude>
<exclude>io.netty:netty-codec-dns:*</exclude>
<exclude>io.netty:netty-resolver-dns:*</exclude>
<exclude>io.netty:netty-resolver-dns-native-macos:*</exclude>
</excludes>
</artifactSet>
</configuration>
</plugin>
</plugins>
</build>
</project>

View file

@ -1,8 +1,8 @@
main: org.geysermc.geyser.platform.spigot.GeyserSpigotPlugin
name: ${outputName}-Spigot
author: ${project.organization.name}
website: ${project.organization.url}
version: ${project.version}
name: ${name}-Spigot
author: ${author}
website: ${url}
version: ${version}
softdepend: ["ViaVersion", "floodgate"]
api-version: 1.13
commands:

View file

@ -0,0 +1,36 @@
val spongeVersion = "7.1.0"
dependencies {
api(projects.core)
}
platformRelocate("com.fasterxml.jackson")
platformRelocate("io.netty")
platformRelocate("it.unimi.dsi.fastutil")
platformRelocate("com.google.common")
platformRelocate("com.google.guava")
platformRelocate("net.kyori")
// Exclude these dependencies
exclude("com.google.code.gson:*")
exclude("org.yaml:*")
exclude("org.slf4j:*")
exclude("org.ow2.asm:*")
// These dependencies are already present on the platform
provided("org.spongepowered", "spongeapi", spongeVersion)
application {
mainClass.set("org.geysermc.geyser.platform.sponge.GeyserSpongeMain")
}
tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
archiveBaseName.set("Geyser-Sponge")
dependencies {
exclude(dependency("com.google.code.gson:.*"))
exclude(dependency("org.yaml:.*"))
exclude(dependency("org.slf4j:.*"))
exclude(dependency("org.ow2.asm:.*"))
}
}

View file

@ -1,101 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.geysermc</groupId>
<artifactId>bootstrap-parent</artifactId>
<version>2.0.1-SNAPSHOT</version>
</parent>
<artifactId>bootstrap-sponge</artifactId>
<dependencies>
<dependency>
<groupId>org.geysermc</groupId>
<artifactId>core</artifactId>
<version>2.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.spongepowered</groupId>
<artifactId>spongeapi</artifactId>
<version>7.1.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>${outputName}-Sponge</finalName>
<resources>
<resource>
<directory>src/main/resources/</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifestEntries>
<Main-Class>org.geysermc.geyser.platform.sponge.GeyserSpongeMain</Main-Class>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0-SNAPSHOT</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>com.fasterxml.jackson</pattern>
<shadedPattern>org.geysermc.geyser.platform.sponge.shaded.jackson</shadedPattern>
</relocation>
<relocation>
<pattern>io.netty</pattern>
<shadedPattern>org.geysermc.geyser.platform.sponge.shaded.netty</shadedPattern>
</relocation>
<relocation>
<pattern>it.unimi.dsi.fastutil</pattern>
<shadedPattern>org.geysermc.geyser.platform.sponge.shaded.fastutil</shadedPattern>
</relocation>
<relocation>
<pattern>com.google.common</pattern>
<shadedPattern>org.geysermc.geyser.platform.sponge.shaded.google.common</shadedPattern>
</relocation>
<relocation>
<pattern>com.google.guava</pattern>
<shadedPattern>org.geysermc.geyser.platform.sponge.shaded.google.guava</shadedPattern>
</relocation>
<relocation>
<pattern>net.kyori</pattern>
<shadedPattern>org.geysermc.geyser.platform.sponge.shaded.kyori</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
<configuration>
<artifactSet>
<excludes>
<exclude>com.google.code.gson:*</exclude>
<exclude>org.yaml:*</exclude>
<exclude>org.slf4j:*</exclude>
<exclude>org.ow2.asm:*</exclude>
</excludes>
</artifactSet>
</configuration>
</plugin>
</plugins>
</build>
</project>

View file

@ -0,0 +1,33 @@
import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer
val terminalConsoleVersion = "1.2.0"
val jlineVersion = "3.20.0"
dependencies {
api(projects.core)
implementation("net.minecrell", "terminalconsoleappender", terminalConsoleVersion) {
exclude("org.apache.logging.log4j", "log4j-core")
exclude("org.jline", "jline-reader")
exclude("org.jline", "jline-terminal")
exclude("org.jline", "jline-terminal-jna")
}
implementation("org.jline", "jline-terminal", jlineVersion)
implementation("org.jline", "jline-terminal-jna", jlineVersion)
implementation("org.jline", "jline-reader", jlineVersion)
implementation("org.apache.logging.log4j", "log4j-api", Versions.log4jVersion)
implementation("org.apache.logging.log4j", "log4j-core", Versions.log4jVersion)
implementation("org.apache.logging.log4j", "log4j-slf4j18-impl", Versions.log4jVersion)
}
application {
mainClass.set("org.geysermc.geyser.platform.standalone.GeyserStandaloneBootstrap")
}
tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
archiveBaseName.set("Geyser")
transform(Log4j2PluginsCacheFileTransformer())
}

View file

@ -1,140 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.geysermc</groupId>
<artifactId>bootstrap-parent</artifactId>
<version>2.0.1-SNAPSHOT</version>
</parent>
<artifactId>bootstrap-standalone</artifactId>
<properties>
<log4j.version>2.17.1</log4j.version>
</properties>
<dependencies>
<dependency>
<groupId>org.geysermc</groupId>
<artifactId>core</artifactId>
<version>2.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.minecrell</groupId>
<artifactId>terminalconsoleappender</artifactId>
<version>1.2.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.jline</groupId>
<artifactId>jline-reader</artifactId>
</exclusion>
<exclusion>
<groupId>org.jline</groupId>
<artifactId>jline-terminal-jna</artifactId>
</exclusion>
<exclusion>
<groupId>org.jline</groupId>
<artifactId>jline-terminal</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline-terminal</artifactId>
<version>3.20.0</version>
</dependency>
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline-terminal-jna</artifactId>
<version>3.20.0</version>
</dependency>
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline-reader</artifactId>
<version>3.20.0</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j18-impl</artifactId>
<version>${log4j.version}</version>
</dependency>
</dependencies>
<build>
<finalName>${outputName}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifestEntries>
<Main-Class>org.geysermc.geyser.platform.standalone.GeyserStandaloneBootstrap</Main-Class>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.github.edwgiz</groupId>
<artifactId>maven-shade-plugin.log4j2-cachefile-transformer</artifactId>
<version>2.8.1</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<minimizeJar>false</minimizeJar>
</configuration>
</execution>
</executions>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/versions/9/module-info.class</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.geysermc.geyser.platform.standalone.GeyserStandaloneBootstrap</mainClass>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</transformer>
<transformer
implementation="com.github.edwgiz.mavenShadePlugin.log4j2CacheTransformer.PluginsCacheFileTransformer">
</transformer>
</transformers>
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
</configuration>
</plugin>
</plugins>
</build>
</project>

View file

@ -38,6 +38,7 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.core.Appender;
import org.apache.logging.log4j.core.Logger;
import org.apache.logging.log4j.core.appender.ConsoleAppender;
import org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender;
import org.geysermc.common.PlatformType;
import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.GeyserBootstrap;
@ -179,6 +180,7 @@ public class GeyserStandaloneBootstrap implements GeyserBootstrap {
logger.removeAppender(appender);
}
}
if (useGui && gui == null) {
gui = new GeyserStandaloneGUI();
gui.redirectSystemStreams();

View file

@ -25,7 +25,7 @@
package org.geysermc.geyser.platform.standalone;
import lombok.extern.log4j.Log4j2;
import lombok.extern.slf4j.Slf4j;
import net.minecrell.terminalconsole.SimpleTerminalConsole;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.config.Configurator;
@ -34,7 +34,7 @@ import org.geysermc.geyser.GeyserLogger;
import org.geysermc.geyser.command.GeyserCommandSource;
import org.geysermc.geyser.text.ChatColor;
@Log4j2
@Slf4j
public class GeyserStandaloneLogger extends SimpleTerminalConsole implements GeyserLogger, GeyserCommandSource {
@Override
@ -54,12 +54,12 @@ public class GeyserStandaloneLogger extends SimpleTerminalConsole implements Gey
@Override
public void severe(String message) {
log.fatal(ChatColor.DARK_RED + message);
log.error(ChatColor.DARK_RED + message);
}
@Override
public void severe(String message, Throwable error) {
log.fatal(ChatColor.DARK_RED + message, error);
log.error(ChatColor.DARK_RED + message, error);
}
@Override

View file

@ -16,7 +16,7 @@
</RollingRandomAccessFile>
</Appenders>
<Loggers>
<Root level="INFO">
<Root level="INFO" >
<AppenderRef ref="TerminalConsole"/>
<AppenderRef ref="Console"/>
<AppenderRef ref="File"/>

View file

@ -0,0 +1,68 @@
val velocityVersion = "3.0.0"
dependencies {
api(projects.core)
}
platformRelocate("com.fasterxml.jackson")
platformRelocate("it.unimi.fastutil")
platformRelocate("net.kyori.adventure.text.serializer.gson.legacyimpl")
exclude("com.google.*:*")
// Needed because Velocity provides every dependency except netty-resolver-dns
exclude("io.netty:netty-transport-native-epoll:*")
exclude("io.netty:netty-transport-native-unix-common:*")
exclude("io.netty:netty-transport-native-kqueue:*")
exclude("io.netty:netty-handler:*")
exclude("io.netty:netty-common:*")
exclude("io.netty:netty-buffer:*")
exclude("io.netty:netty-resolver:*")
exclude("io.netty:netty-transport:*")
exclude("io.netty:netty-codec:*")
exclude("io.netty:netty-codec-haproxy:*")
exclude("org.slf4j:*")
exclude("org.ow2.asm:*")
// Exclude all Kyori dependencies except the legacy NBT serializer
exclude("net.kyori:adventure-api:*")
exclude("net.kyori:examination-api:*")
exclude("net.kyori:examination-string:*")
exclude("net.kyori:adventure-text-serializer-gson:*")
exclude("net.kyori:adventure-text-serializer-legacy:*")
exclude("net.kyori:adventure-nbt:*")
// These dependencies are already present on the platform
provided("com.velocitypowered", "velocity-api", velocityVersion)
application {
mainClass.set("org.geysermc.geyser.platform.velocity.GeyserVelocityMain")
}
tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
archiveBaseName.set("Geyser-Velocity")
dependencies {
exclude(dependency("com.google.*:.*"))
// Needed because Velocity provides every dependency except netty-resolver-dns
exclude(dependency("io.netty:netty-transport-native-epoll:.*"))
exclude(dependency("io.netty:netty-transport-native-unix-common:.*"))
exclude(dependency("io.netty:netty-transport-native-kqueue:.*"))
exclude(dependency("io.netty:netty-handler:.*"))
exclude(dependency("io.netty:netty-common:.*"))
exclude(dependency("io.netty:netty-buffer:.*"))
exclude(dependency("io.netty:netty-resolver:.*"))
exclude(dependency("io.netty:netty-transport:.*"))
exclude(dependency("io.netty:netty-codec:.*"))
exclude(dependency("io.netty:netty-codec-haproxy:.*"))
exclude(dependency("org.slf4j:.*"))
exclude(dependency("org.ow2.asm:.*"))
// Exclude all Kyori dependencies except the legacy NBT serializer
exclude(dependency("net.kyori:adventure-api:.*"))
exclude(dependency("net.kyori:examination-api:.*"))
exclude(dependency("net.kyori:examination-string:.*"))
exclude(dependency("net.kyori:adventure-text-serializer-gson:.*"))
exclude(dependency("net.kyori:adventure-text-serializer-legacy:.*"))
exclude(dependency("net.kyori:adventure-nbt:.*"))
}
}

View file

@ -1,106 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.geysermc</groupId>
<artifactId>bootstrap-parent</artifactId>
<version>2.0.1-SNAPSHOT</version>
</parent>
<artifactId>bootstrap-velocity</artifactId>
<dependencies>
<dependency>
<groupId>org.geysermc</groupId>
<artifactId>core</artifactId>
<version>2.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.velocitypowered</groupId>
<artifactId>velocity-api</artifactId>
<version>3.0.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>${outputName}-Velocity</finalName>
<resources>
<resource>
<directory>src/main/resources/</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifestEntries>
<Main-Class>org.geysermc.geyser.platform.velocity.GeyserVelocityMain</Main-Class>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0-SNAPSHOT</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>com.fasterxml.jackson</pattern>
<shadedPattern>org.geysermc.geyser.platform.velocity.shaded.jackson</shadedPattern>
</relocation>
<relocation>
<pattern>it.unimi.dsi.fastutil</pattern>
<shadedPattern>org.geysermc.geyser.platform.velocity.shaded.fastutil</shadedPattern>
</relocation>
<relocation>
<pattern>net.kyori.adventure.text.serializer.gson.legacyimpl</pattern>
<shadedPattern>org.geysermc.geyser.platform.velocity.shaded.kyori.legacyimpl</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
<configuration>
<artifactSet>
<excludes>
<exclude>com.google.*:*</exclude>
<!-- Needed because Velocity provides every dependency except netty-resolver-dns -->
<exclude>io.netty:netty-transport-native-epoll:*</exclude>
<exclude>io.netty:netty-transport-native-unix-common:*</exclude>
<exclude>io.netty:netty-transport-native-kqueue:*</exclude>
<exclude>io.netty:netty-handler:*</exclude>
<exclude>io.netty:netty-common:*</exclude>
<exclude>io.netty:netty-buffer:*</exclude>
<exclude>io.netty:netty-resolver:*</exclude>
<exclude>io.netty:netty-transport:*</exclude>
<exclude>io.netty:netty-codec:*</exclude>
<exclude>io.netty:netty-codec-haproxy:*</exclude>
<exclude>org.slf4j:*</exclude>
<exclude>org.ow2.asm:*</exclude>
<!-- Exclude all Kyori dependencies except the legacy NBT serializer -->
<exclude>net.kyori:adventure-api:*</exclude>
<exclude>net.kyori:examination-api:*</exclude>
<exclude>net.kyori:examination-string:*</exclude>
<exclude>net.kyori:adventure-text-serializer-gson:*</exclude>
<exclude>net.kyori:adventure-text-serializer-legacy:*</exclude>
<exclude>net.kyori:adventure-nbt:*</exclude>
</excludes>
</artifactSet>
</configuration>
</plugin>
</plugins>
</build>
</project>

View file

@ -0,0 +1,21 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
`kotlin-dsl`
}
repositories {
gradlePluginPortal()
}
dependencies {
implementation("net.kyori", "indra-common", "2.0.6")
implementation("org.jfrog.buildinfo", "build-info-extractor-gradle", "4.26.1")
implementation("gradle.plugin.com.github.johnrengelman", "shadow", "7.1.1")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "16"
}
}

View file

@ -0,0 +1,44 @@
/*
* Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @author GeyserMC
* @link https://github.com/GeyserMC/Geyser
*/
object Versions {
const val jacksonVersion= "2.12.4"
const val fastutilVersion= "8.5.2"
const val nettyVersion= "4.1.66.Final"
const val guavaVersion= "29.0-jre"
const val nbtVersion= "2.1.0"
const val websocketVersion= "1.5.1"
const val protocolVersion= "0cd24c0"
const val raknetVersion= "1.6.28-SNAPSHOT"
const val mcauthlibVersion= "6c99331"
const val mcprotocollibversion= "6a23a780"
const val packetlibVersion= "2.1-SNAPSHOT"
const val adventureVersion= "4.9.3"
const val eventVersion= "3.0.0"
const val junitVersion= "4.13.1"
const val checkerQualVersion= "3.19.0"
const val cumulusVersion = "1.0-SNAPSHOT"
const val log4jVersion = "2.17.1"
}

View file

@ -0,0 +1,79 @@
/*
* Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @author GeyserMC
* @link https://github.com/GeyserMC/Geyser
*/
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import net.kyori.indra.git.IndraGitExtension
import org.gradle.api.Project
import org.gradle.api.artifacts.ProjectDependency
import org.gradle.kotlin.dsl.named
import org.gradle.kotlin.dsl.the
fun Project.lastCommitHash(): String? =
the<IndraGitExtension>().commit()?.name?.substring(0, 7)
// retrieved from https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project
// some properties might be specific to Jenkins
fun Project.branchName(): String =
System.getProperty("GIT_BRANCH", "local/dev")
fun Project.commitHashAbbrev(): String =
System.getProperty("GIT_COMMIT", "0000000")
fun Project.versionName(): String =
System.getProperty("GIT_VERSION", "local/dev")
fun Project.buildNumber(): Int =
Integer.parseInt(System.getProperty("BUILD_NUMBER", "-1"))
fun Project.relocate(pattern: String) {
tasks.named<ShadowJar>("shadowJar") {
relocate(pattern, "org.geysermc.geyser.shaded.$pattern")
}
}
fun Project.exclude(group: String) {
tasks.named<ShadowJar>("shadowJar") {
exclude(group)
}
}
fun Project.platformRelocate(pattern: String) {
tasks.named<ShadowJar>("shadowJar") {
relocate(pattern, "org.geysermc.geyser.platform.${project.name}.shaded.$pattern")
}
}
val providedDependencies = mutableMapOf<String, MutableSet<String>>()
fun Project.provided(pattern: String, name: String, version: String, excludedOn: Int = 0b110) {
providedDependencies.getOrPut(project.name) { mutableSetOf() }
.add("${calcExclusion(pattern, 0b100, excludedOn)}:" +
"${calcExclusion(name, 0b10, excludedOn)}:" +
calcExclusion(version, 0b1, excludedOn))
dependencies.add("compileOnlyApi", "$pattern:$name:$version")
}
fun Project.provided(dependency: ProjectDependency) =
provided(dependency.group!!, dependency.name, dependency.version!!)
private fun calcExclusion(section: String, bit: Int, excludedOn: Int): String =
if (excludedOn and bit > 0) section else ""

View file

@ -0,0 +1,9 @@
plugins {
id("geyser.shadow-conventions")
}
tasks {
shadowJar {
archiveBaseName.set(archiveBaseName.get() + "-api")
}
}

View file

@ -0,0 +1,41 @@
plugins {
`java-library`
`maven-publish`
}
dependencies {
compileOnly("org.checkerframework", "checker-qual", Versions.checkerQualVersion)
}
tasks {
processResources {
filesMatching(listOf("plugin.yml", "bungee.yml", "velocity-plugin.json")) {
expand(
"id" to "Geyser",
"name" to "Geyser",
"version" to project.version,
"description" to project.description,
"url" to "https://geysermc.org",
"author" to "GeyserMC"
)
}
}
compileJava {
options.encoding = Charsets.UTF_8.name()
}
}
java {
sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16
withSourcesJar()
}
publishing {
publications.create<MavenPublication>("mavenJava") {
groupId = project.group as String
artifactId = project.name
version = project.version as String
}
}

View file

@ -0,0 +1,4 @@
plugins {
application
id("geyser.shadow-conventions")
}

View file

@ -0,0 +1,55 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id("geyser.base-conventions")
id("com.github.johnrengelman.shadow")
id("com.jfrog.artifactory")
}
tasks {
named<Jar>("jar") {
archiveClassifier.set("unshaded")
from(project.rootProject.file("LICENSE"))
}
val shadowJar = named<ShadowJar>("shadowJar") {
archiveBaseName.set(project.name)
archiveVersion.set("")
archiveClassifier.set("")
val sJar: ShadowJar = this
doFirst {
providedDependencies[project.name]?.forEach { string ->
sJar.dependencies {
println("Excluding $string from ${project.name}")
exclude(dependency(string))
}
}
}
}
named("build") {
dependsOn(shadowJar)
}
}
publishing {
publications.named<MavenPublication>("mavenJava") {
artifact(tasks["shadowJar"])
artifact(tasks["sourcesJar"])
}
}
artifactory {
publish {
repository {
setRepoKey("maven-snapshots")
setMavenCompatible(true)
}
defaults {
publishConfigs("archives")
setPublishArtifacts(true)
setPublishPom(true)
setPublishIvy(false)
}
}
}

43
build.gradle.kts Normal file
View file

@ -0,0 +1,43 @@
plugins {
`java-library`
id("geyser.build-logic")
id("io.freefair.lombok") version "6.3.0" apply false
}
allprojects {
group = "org.geysermc"
version = "2.1.0-SNAPSHOT"
description = "Allows for players from Minecraft: Bedrock Edition to join Minecraft: Java Edition servers."
}
val platforms = setOf(
projects.bungeecord,
projects.spigot,
projects.sponge,
projects.standalone,
projects.velocity
).map { it.dependencyProject }
val api: Project = projects.api.dependencyProject
subprojects {
apply {
plugin("java-library")
plugin("io.freefair.lombok")
plugin("geyser.build-logic")
}
val relativePath = projectDir.relativeTo(rootProject.projectDir).path
if (relativePath.contains("api")) {
group = rootProject.group as String + ".api"
plugins.apply("geyser.api-conventions")
} else {
group = rootProject.group as String + ".geyser"
when (this) {
in platforms -> plugins.apply("geyser.platform-conventions")
api -> plugins.apply("geyser.shadow-conventions")
else -> plugins.apply("geyser.base-conventions")
}
}
}

3
common/build.gradle.kts Normal file
View file

@ -0,0 +1,3 @@
dependencies {
api("org.geysermc.cumulus", "cumulus", Versions.cumulusVersion)
}

View file

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.geysermc</groupId>
<artifactId>geyser-parent</artifactId>
<version>2.0.1-SNAPSHOT</version>
</parent>
<artifactId>common</artifactId>
<!-- Floodgate is still targeting Java 8 -->
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.geysermc.cumulus</groupId>
<artifactId>cumulus</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
</dependencies>
</project>

86
core/build.gradle.kts Normal file
View file

@ -0,0 +1,86 @@
import net.kyori.blossom.BlossomExtension
plugins {
id("net.kyori.blossom")
}
dependencies {
api(projects.geyserApi)
api(projects.common)
// Jackson JSON and YAML serialization
api("com.fasterxml.jackson.core", "jackson-annotations", Versions.jacksonVersion)
api("com.fasterxml.jackson.core", "jackson-databind", Versions.jacksonVersion)
api("com.fasterxml.jackson.dataformat", "jackson-dataformat-yaml", Versions.jacksonVersion)
api("com.google.guava", "guava", Versions.guavaVersion)
api("com.nukkitx", "nbt", Versions.nbtVersion)
// Fastutil Maps
implementation("com.nukkitx.fastutil", "fastutil-int-int-maps", Versions.fastutilVersion)
implementation("com.nukkitx.fastutil", "fastutil-int-long-maps", Versions.fastutilVersion)
implementation("com.nukkitx.fastutil", "fastutil-int-byte-maps", Versions.fastutilVersion)
implementation("com.nukkitx.fastutil", "fastutil-int-boolean-maps", Versions.fastutilVersion)
implementation("com.nukkitx.fastutil", "fastutil-object-int-maps", Versions.fastutilVersion)
implementation("com.nukkitx.fastutil", "fastutil-object-object-maps", Versions.fastutilVersion)
// Network libraries
implementation("org.java-websocket", "Java-WebSocket", Versions.websocketVersion)
api("com.github.CloudburstMC.Protocol", "bedrock-v486", Versions.protocolVersion) {
exclude("com.nukkitx.network", "raknet")
exclude("com.nukkitx", "nbt")
}
api("com.github.RednedEpic", "MCAuthLib", Versions.mcauthlibVersion)
api("com.github.GeyserMC", "MCProtocolLib", Versions.mcprotocollibversion) {
exclude("com.github.steveice10", "packetlib")
exclude("com.github.steveice10", "mcauthlib")
}
api("com.github.steveice10", "packetlib", Versions.packetlibVersion) {
exclude("io.netty", "netty-all")
// This is still experimental - additionally, it could only really benefit standalone
exclude("io.netty.incubator", "netty-incubator-transport-native-io_uring")
}
implementation("com.nukkitx.network", "raknet", Versions.raknetVersion) {
exclude("io.netty", "*");
}
implementation("io.netty", "netty-resolver-dns", Versions.nettyVersion)
implementation("io.netty", "netty-resolver-dns-native-macos", Versions.nettyVersion, null, "osx-x86_64")
implementation("io.netty", "netty-codec-haproxy", Versions.nettyVersion)
// Network dependencies we are updating ourselves
api("io.netty", "netty-handler", Versions.nettyVersion)
implementation("io.netty", "netty-transport-native-epoll", Versions.nettyVersion, null, "linux-x86_64")
implementation("io.netty", "netty-transport-native-epoll", Versions.nettyVersion, null, "linux-aarch_64")
implementation("io.netty", "netty-transport-native-kqueue", Versions.nettyVersion, null, "osx-x86_64")
// Adventure text serialization
implementation("net.kyori", "adventure-text-serializer-legacy", Versions.adventureVersion)
implementation("net.kyori", "adventure-text-serializer-plain", Versions.adventureVersion)
// Kyori Misc
implementation("net.kyori", "event-api", Versions.eventVersion)
// Test
testImplementation("junit", "junit", Versions.junitVersion)
// Annotation Processors
annotationProcessor(projects.ap)
}
provided(projects.ap)
configure<BlossomExtension> {
val mainFile = "src/main/java/org/geysermc/geyser/GeyserImpl.java"
val gitVersion = "git-${branchName()}-${commitHashAbbrev()}"
replaceToken("\${version}", "${project.version} ($gitVersion)", mainFile)
replaceToken("\${gitVersion}", gitVersion, mainFile)
replaceToken("\${buildNumber}", buildNumber(), mainFile)
replaceToken("\${branch}", branchName(), mainFile)
}

View file

@ -1,374 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.geysermc</groupId>
<artifactId>geyser-parent</artifactId>
<version>2.0.1-SNAPSHOT</version>
</parent>
<artifactId>core</artifactId>
<properties>
<fastutil.version>8.5.2</fastutil.version>
<jackson.version>2.12.4</jackson.version>
<netty.version>4.1.66.Final</netty.version>
</properties>
<dependencies>
<dependency>
<groupId>org.geysermc</groupId>
<artifactId>ap</artifactId>
<version>2.0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.geysermc</groupId>
<artifactId>geyser-api</artifactId>
<version>2.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.geysermc</groupId>
<artifactId>common</artifactId>
<version>2.0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<!-- Jackson JSON and YAML serialization -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>${jackson.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>29.0-jre</version>
<scope>compile</scope>
</dependency>
<!-- fastutil maps -->
<dependency>
<groupId>com.nukkitx</groupId>
<artifactId>nbt</artifactId>
<!-- Used for key/value interning -->
<version>2.1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.nukkitx.fastutil</groupId>
<artifactId>fastutil-int-int-maps</artifactId>
<version>${fastutil.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.nukkitx.fastutil</groupId>
<artifactId>fastutil-int-long-maps</artifactId>
<version>${fastutil.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.nukkitx.fastutil</groupId>
<artifactId>fastutil-int-byte-maps</artifactId>
<version>${fastutil.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.nukkitx.fastutil</groupId>
<artifactId>fastutil-int-boolean-maps</artifactId>
<version>${fastutil.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.nukkitx.fastutil</groupId>
<artifactId>fastutil-object-int-maps</artifactId>
<version>${fastutil.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.nukkitx.fastutil</groupId>
<artifactId>fastutil-object-object-maps</artifactId>
<version>${fastutil.version}</version>
<scope>compile</scope>
</dependency>
<!-- Network libraries -->
<dependency>
<groupId>org.java-websocket</groupId>
<artifactId>Java-WebSocket</artifactId>
<version>1.5.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.CloudburstMC.Protocol</groupId>
<artifactId>bedrock-v486</artifactId>
<version>0cd24c0</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>com.nukkitx.network</groupId>
<artifactId>raknet</artifactId>
</exclusion>
<exclusion>
<groupId>com.nukkitx</groupId>
<artifactId>nbt</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.nukkitx.network</groupId>
<artifactId>raknet</artifactId>
<version>1.6.28-20211202.034102-5</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.github.RednedEpic</groupId>
<artifactId>MCAuthLib</artifactId>
<version>6c99331</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.GeyserMC</groupId>
<artifactId>MCProtocolLib</artifactId>
<version>6a23a780</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>com.github.steveice10</groupId>
<artifactId>packetlib</artifactId>
</exclusion>
<exclusion>
<groupId>com.github.steveice10</groupId>
<artifactId>mcauthlib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.github.steveice10</groupId>
<artifactId>packetlib</artifactId>
<version>2.1-SNAPSHOT</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
</exclusion>
<exclusion>
<!-- This is still experimental - additionally, it could only really benefit standalone -->
<groupId>io.netty.incubator</groupId>
<artifactId>netty-incubator-transport-native-io_uring</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-resolver-dns</artifactId>
<version>${netty.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-resolver-dns-native-macos</artifactId>
<version>${netty.version}</version>
<scope>compile</scope>
<classifier>osx-x86_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec-haproxy</artifactId>
<version>${netty.version}</version>
<scope>compile</scope>
</dependency>
<!-- Network dependencies we are updating ourselves -->
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-handler</artifactId>
<version>${netty.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<version>${netty.version}</version>
<scope>compile</scope>
<classifier>linux-x86_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-epoll</artifactId>
<version>${netty.version}</version>
<scope>compile</scope>
<classifier>linux-aarch_64</classifier>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport-native-kqueue</artifactId>
<version>${netty.version}</version>
<scope>compile</scope>
<classifier>osx-x86_64</classifier>
</dependency>
<!-- Adventure text serialization -->
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-legacy</artifactId>
<version>${adventure.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-plain</artifactId>
<version>${adventure.version}</version>
<scope>compile</scope>
</dependency>
<!-- Kyori Misc -->
<dependency>
<groupId>net.kyori</groupId>
<artifactId>event-api</artifactId>
<version>3.0.0</version>
<scope>compile</scope>
</dependency>
<!-- Other -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<excludes>
<exclude>**/services/javax.annotation.processing.Processor</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>4.0.0</version>
<executions>
<execution>
<id>get-the-git-infos</id>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
<configuration>
<generateGitPropertiesFile>true</generateGitPropertiesFile>
<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
<format>properties</format>
<failOnNoGitDirectory>false</failOnNoGitDirectory>
<failOnUnableToExtractRepoInfo>false</failOnUnableToExtractRepoInfo>
<runOnlyOnce>false</runOnlyOnce>
<verbose>true</verbose>
<skipPoms>false</skipPoms>
<excludeProperties>
<excludeProperty>git.user.*</excludeProperty>
<excludeProperty>git.*.user.*</excludeProperty>
<excludeProperty>git.closest.*</excludeProperty>
<excludeProperty>git.commit.id.describe</excludeProperty>
<excludeProperty>git.commit.id.describe-short</excludeProperty>
<excludeProperty>git.commit.message.short</excludeProperty>
</excludeProperties>
<commitIdGenerationMode>flat</commitIdGenerationMode>
<gitDescribe>
<always>true</always>
</gitDescribe>
</configuration>
</plugin>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.3</version>
<executions>
<execution>
<id>add-version</id>
<phase>process-sources</phase>
<goals>
<goal>replace</goal>
</goals>
<configuration>
<includes>
<include>${project.basedir}/src/main/java/org/geysermc/geyser/GeyserImpl.java</include>
</includes>
<replacements>
<replacement>
<token>String VERSION = ".*"</token>
<value>String VERSION = "${project.version} (" + GIT_VERSION + ")"</value>
</replacement>
<replacement>
<token>String GIT_VERSION = ".*"</token>
<!--suppress UnresolvedMavenProperty -->
<value>String GIT_VERSION = "git-${git.branch}-${git.commit.id.abbrev}"</value>
</replacement>
</replacements>
</configuration>
</execution>
<execution>
<id>remove-version</id>
<phase>process-classes</phase>
<goals>
<goal>replace</goal>
</goals>
<configuration>
<includes>
<include>${project.basedir}/src/main/java/org/geysermc/geyser/GeyserImpl.java</include>
</includes>
<replacements>
<replacement>
<token>String VERSION = ".*"</token>
<value>String VERSION = "DEV"</value>
</replacement>
<replacement>
<token>String GIT_VERSION = ".*"</token>
<value>String GIT_VERSION = "DEV"</value>
</replacement>
</replacements>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.0</version>
<configuration>
<!-- Force the right file encoding during unit testing -->
<argLine>-Dfile.encoding=${project.build.sourceEncoding}</argLine>
</configuration>
</plugin>
</plugins>
</build>
</project>

View file

@ -91,6 +91,6 @@ public class GeyserConnector {
}
public boolean isProductionEnvironment() {
return GeyserImpl.getInstance().productionEnvironment();
return GeyserImpl.getInstance().isProductionEnvironment();
}
}

View file

@ -99,8 +99,11 @@ public class GeyserImpl implements GeyserApi {
.enable(JsonParser.Feature.ALLOW_SINGLE_QUOTES);
public static final String NAME = "Geyser";
public static final String GIT_VERSION = "DEV"; // A fallback for running in IDEs
public static final String VERSION = "DEV"; // A fallback for running in IDEs
public static final String GIT_VERSION = "${gitVersion}"; // A fallback for running in IDEs
public static final String VERSION = "${version}"; // A fallback for running in IDEs
public static final int BUILD_NUMBER = Integer.parseInt("${buildNumber}");
public static final String BRANCH = "${branch}";
/**
* Oauth client ID for Microsoft authentication
@ -268,25 +271,7 @@ public class GeyserImpl implements GeyserApi {
}
}
String branch = "unknown";
int buildNumber = -1;
if (this.productionEnvironment()) {
try (InputStream stream = bootstrap.getResource("git.properties")) {
Properties gitProperties = new Properties();
gitProperties.load(stream);
branch = gitProperties.getProperty("git.branch");
String build = gitProperties.getProperty("git.build.number");
if (build != null) {
buildNumber = Integer.parseInt(build);
}
} catch (Throwable e) {
logger.error("Failed to read git.properties", e);
}
} else {
logger.debug("Not getting git properties for the news handler as we are in a development environment.");
}
this.newsHandler = new NewsHandler(branch, buildNumber);
this.newsHandler = new NewsHandler(BRANCH, BUILD_NUMBER);
CooldownUtils.setDefaultShowCooldown(config.getShowCooldown());
DimensionUtils.changeBedrockNetherId(config.isAboveBedrockNetherBuilding()); // Apply End dimension ID workaround to Nether
@ -499,9 +484,9 @@ public class GeyserImpl implements GeyserApi {
* @return true if the version number is not 'DEV'.
*/
@Override
public boolean productionEnvironment() {
//noinspection ConstantConditions - changes in production
return !"DEV".equals(GeyserImpl.VERSION);
public boolean isProductionEnvironment() {
// noinspection ConstantConditions - changes in production
return !"git-local/dev-0000000".equals(GeyserImpl.GIT_VERSION);
}
@Override

View file

@ -74,17 +74,14 @@ public class VersionCommand extends GeyserCommand {
GeyserImpl.NAME, GeyserImpl.VERSION, javaVersions, bedrockVersions));
// Disable update checking in dev mode and for players in Geyser Standalone
if (GeyserImpl.getInstance().productionEnvironment() && !(!sender.isConsole() && geyser.getPlatformType() == PlatformType.STANDALONE)) {
if (GeyserImpl.getInstance().isProductionEnvironment() && !(!sender.isConsole() && geyser.getPlatformType() == PlatformType.STANDALONE)) {
sender.sendMessage(GeyserLocale.getPlayerLocaleString("geyser.commands.version.checking", sender.locale()));
try (InputStream stream = GeyserImpl.getInstance().getBootstrap().getResource("git.properties")) {
Properties gitProp = new Properties();
gitProp.load(stream);
try {
String buildXML = WebUtils.getBody("https://ci.opencollab.dev/job/GeyserMC/job/Geyser/job/" +
URLEncoder.encode(gitProp.getProperty("git.branch"), StandardCharsets.UTF_8.toString()) + "/lastSuccessfulBuild/api/xml?xpath=//buildNumber");
URLEncoder.encode(GeyserImpl.BRANCH, StandardCharsets.UTF_8.toString()) + "/lastSuccessfulBuild/api/xml?xpath=//buildNumber");
if (buildXML.startsWith("<buildNumber>")) {
int latestBuildNum = Integer.parseInt(buildXML.replaceAll("<(\\\\)?(/)?buildNumber>", "").trim());
int buildNum = Integer.parseInt(gitProp.getProperty("git.build.number"));
int buildNum = GeyserImpl.BUILD_NUMBER;
if (latestBuildNum == buildNum) {
sender.sendMessage(GeyserLocale.getPlayerLocaleString("geyser.commands.version.no_updates", sender.locale()));
} else {
@ -94,7 +91,7 @@ public class VersionCommand extends GeyserCommand {
} else {
throw new AssertionError("buildNumber missing");
}
} catch (IOException | AssertionError | NumberFormatException e) {
} catch (IOException e) {
GeyserImpl.getInstance().getLogger().error(GeyserLocale.getLocaleStringLog("geyser.commands.version.failed"), e);
sender.sendMessage(ChatColor.RED + GeyserLocale.getPlayerLocaleString("geyser.commands.version.failed", sender.locale()));
}

@ -1 +1 @@
Subproject commit 94c1851931f2319a7e7f42c2fe9066b78235bc39
Subproject commit cef75b34461d195d50bfcd274b499bd9d641c5aa

6
gradle.properties Normal file
View file

@ -0,0 +1,6 @@
group=org.geysermc
version=2.1.0-SNAPSHOT
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.vfs.watch=false

View file

@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

234
gradlew vendored Normal file
View file

@ -0,0 +1,234 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_NAME="Gradle"
APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

89
gradlew.bat vendored Normal file
View file

@ -0,0 +1,89 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

95
pom.xml
View file

@ -1,95 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.geysermc</groupId>
<artifactId>geyser-parent</artifactId>
<version>2.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Geyser</name>
<description>Allows for players from Minecraft Bedrock Edition to join Minecraft Java Edition servers.</description>
<url>https://geysermc.org</url>
<properties>
<outputName>Geyser</outputName>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
<adventure.version>4.9.3</adventure.version>
</properties>
<organization>
<name>GeyserMC</name>
<url>https://github.com/GeyserMC/Geyser/blob/master/pom.xml</url>
</organization>
<scm>
<connection>scm:git:https://github.com/GeyserMC/Geyser.git</connection>
<developerConnection>scm:git:git@github.com:GeyserMC/Geyser.git</developerConnection>
<url>https://github.com/GeyserMC/Geyser</url>
</scm>
<modules>
<module>ap</module>
<module>api</module>
<module>bootstrap</module>
<module>common</module>
<module>core</module>
</modules>
<pluginRepositories>
<!-- Remove once maven-shade-plugin gets a stable release that supports Java 16 -->
<pluginRepository>
<id>apache.snapshots</id>
<url>https://repository.apache.org/snapshots/</url>
</pluginRepository>
</pluginRepositories>
<repositories>
<!-- Remove once maven-shade-plugin gets a stable release that supports Java 16 -->
<repository>
<id>apache.snapshots</id>
<url>https://repository.apache.org/snapshots/</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<id>opencollab-release-repo</id>
<url>https://repo.opencollab.dev/maven-releases/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>opencollab-snapshot-repo</id>
<url>https://repo.opencollab.dev/maven-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.20</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

73
settings.gradle.kts Normal file
View file

@ -0,0 +1,73 @@
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
// Floodgate, Cumulus etc.
maven("https://repo.opencollab.dev/maven-releases") {
mavenContent { releasesOnly() }
}
maven("https://repo.opencollab.dev/maven-snapshots") {
mavenContent { snapshotsOnly() }
}
// Paper, Velocity
maven("https://papermc.io/repo/repository/maven-public")
// Spigot
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots") {
mavenContent { snapshotsOnly() }
}
// BungeeCord
maven("https://oss.sonatype.org/content/repositories/snapshots") {
mavenContent { snapshotsOnly() }
}
// Minecraft
maven("https://libraries.minecraft.net") {
name = "minecraft"
mavenContent { releasesOnly() }
}
mavenLocal()
mavenCentral()
maven("https://jitpack.io") {
content { includeGroupByRegex("com\\.github\\..*") }
}
}
}
pluginManagement {
repositories {
gradlePluginPortal()
}
plugins {
id("net.kyori.blossom") version "1.2.0"
id("net.kyori.indra")
id("net.kyori.indra.git")
}
includeBuild("build-logic")
}
rootProject.name = "geyser-parent"
include(":ap")
include(":api")
include(":geyser-api")
include(":bungeecord")
include(":spigot")
include(":sponge")
include(":standalone")
include(":velocity")
include(":common")
include(":core")
// Specify project dirs
project(":api").projectDir = file("api/base")
project(":geyser-api").projectDir = file("api/geyser")
project(":bungeecord").projectDir = file("bootstrap/bungeecord")
project(":spigot").projectDir = file("bootstrap/spigot")
project(":sponge").projectDir = file("bootstrap/sponge")
project(":standalone").projectDir = file("bootstrap/standalone")
project(":velocity").projectDir = file("bootstrap/velocity")