1
0
mirror of https://github.com/GeyserMC/Floodgate.git synced 2025-12-19 14:59:20 +00:00

Re-added relocations and excluded provided dependencies

This commit is contained in:
Tim203
2021-12-12 22:00:58 +01:00
parent 16a75e3c39
commit 3be603a837
23 changed files with 121 additions and 1024 deletions

2
.gitignore vendored
View File

@@ -219,3 +219,5 @@ nbdist/
.nb-gradle/
# End of https://www.gitignore.io/api/git,java,maven,eclipse,netbeans,jetbrains+all
gradle/
**/.gradle/

View File

@@ -1,7 +1,6 @@
dependencies {
api("org.geysermc", "common", Versions.geyserVersion)
api("org.geysermc.cumulus", "cumulus", Versions.cumulusVersion)
compileOnly("io.netty", "netty-transport", Versions.nettyVersion)
}
description = "api"

View File

@@ -1,78 +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>
<artifactId>parent</artifactId>
<groupId>org.geysermc.floodgate</groupId>
<version>2.1.1-SNAPSHOT</version>
</parent>
<artifactId>api</artifactId>
<dependencies>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId>
<version>${netty.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.geysermc</groupId>
<artifactId>common</artifactId>
<version>${geyser.version}</version>
</dependency>
<dependency>
<groupId>org.geysermc.cumulus</groupId>
<artifactId>cumulus</artifactId>
<version>${cumulus.version}</version>
</dependency>
</dependencies>
<repositories>
<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>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<finalName>${outputName}</finalName>
<shadedArtifactAttached>true</shadedArtifactAttached>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,28 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.Project
import org.gradle.api.artifacts.ProjectDependency
import org.gradle.kotlin.dsl.named
fun Project.relocate(pattern: String) {
tasks.named<ShadowJar>("shadowJar") {
relocate(pattern, "org.geysermc.floodgate.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 {
return if (excludedOn and bit > 0) section else ""
}

View File

@@ -4,6 +4,10 @@ plugins {
// id("net.ltgt.errorprone")
}
dependencies {
compileOnly("org.checkerframework", "checker-qual", Versions.checkerQual)
}
tasks {
processResources {
filesMatching(listOf("plugin.yml", "bungee.yml", "velocity-plugin.json")) {

View File

@@ -15,17 +15,23 @@ tasks {
archiveBaseName.set("floodgate-${project.name}")
archiveVersion.set("")
archiveClassifier.set("")
configureRelocations()
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)
}
}
fun ShadowJar.configureRelocations() {
//todo platform-independent relocations
}
publishing {
publications.named<MavenPublication>("mavenJava") {
artifact(tasks["shadowJar"])

View File

@@ -8,6 +8,7 @@ plugins {
allprojects {
group = "org.geysermc.floodgate"
version = "2.1.1-SNAPSHOT"
description = "Allows Bedrock players to join Java edition servers while keeping the server in online mode"
}
val platforms = setOf(
@@ -16,6 +17,9 @@ val platforms = setOf(
projects.velocity
).map { it.dependencyProject }
//todo re-add git properties (or at least build number, branch and commit)
// re-add pmd and organisation/license/sdcm/issuemanagement stuff
val api: Project = projects.api.dependencyProject
subprojects {
@@ -40,8 +44,4 @@ subprojects {
else -> plugins.apply("floodgate.base-conventions")
}
}
dependencies {
compileOnly("org.checkerframework", "checker-qual", Versions.checkerQual)
}
}

View File

@@ -1,16 +1,23 @@
var bungeeCommit = "bda1605";
var gsonVersion = "2.8.0";
var guavaVersion = "21.0";
var bungeeCommit = "bda1605"
var gsonVersion = "2.8.0"
var guavaVersion = "21.0"
dependencies {
api(project(":core"))
implementation("cloud.commandframework", "cloud-bungee", "1.5.0")
api(projects.core)
implementation("cloud.commandframework", "cloud-bungee", Versions.cloudVersion)
implementation("net.kyori", "adventure-text-serializer-gson", Versions.adventureApiVersion)
implementation("net.kyori", "adventure-text-serializer-bungeecord", Versions.adventurePlatformVersion)
compileOnly("com.github.SpigotMC.BungeeCord", "bungeecord-proxy", bungeeCommit)
compileOnly("com.google.code.gson", "gson", gsonVersion)
compileOnly("com.google.guava", "guava", guavaVersion)
compileOnly("org.yaml", "snakeyaml", Versions.snakeyamlVersion)
}
description = "bungee"
relocate("com.google.inject")
relocate("net.kyori")
relocate("cloud.commandframework")
// used in cloud
relocate("io.leangen.geantyref")
// these dependencies are already present on the platform
provided("com.github.SpigotMC.BungeeCord", "bungeecord-proxy", bungeeCommit)
provided("com.google.code.gson", "gson", gsonVersion)
provided("com.google.guava", "guava", guavaVersion)
provided("org.yaml", "snakeyaml", Versions.snakeyamlVersion)

View File

@@ -1,129 +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>
<artifactId>parent</artifactId>
<groupId>org.geysermc.floodgate</groupId>
<version>2.1.1-SNAPSHOT</version>
</parent>
<artifactId>bungee</artifactId>
<properties>
<bungeecord.commit>bda1605</bungeecord.commit>
<gson.version>2.8.0</gson.version>
<guava.version>21.0</guava.version>
</properties>
<dependencies>
<dependency>
<groupId>com.github.SpigotMC.BungeeCord</groupId>
<artifactId>bungeecord-proxy</artifactId>
<version>${bungeecord.commit}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.geysermc.floodgate</groupId>
<artifactId>core</artifactId>
<version>${project.version}</version>
</dependency>
<!-- following dependencies are relocated -->
<dependency>
<groupId>cloud.commandframework</groupId>
<artifactId>cloud-bungee</artifactId>
<version>${cloud.version}</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-gson</artifactId>
<version>${adventure-api.version}</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-bungeecord</artifactId>
<version>${adventure-platform.version}</version>
</dependency>
<!-- the following common dependencies are already present on the platform -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>${snakeyaml.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>bungeecord-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
<repository>
<id>jitpack</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>com.google.inject</pattern>
<shadedPattern>org.geysermc.floodgate.shaded.com.google.inject</shadedPattern>
</relocation>
<relocation>
<pattern>net.kyori</pattern>
<shadedPattern>org.geysermc.floodgate.shaded.net.kyori</shadedPattern>
</relocation>
<relocation>
<pattern>cloud.commandframework</pattern>
<shadedPattern>org.geysermc.floodgate.shaded.cloud.commandframework</shadedPattern>
</relocation>
<!-- used in cloud -->
<relocation>
<pattern>io.leangen.geantyref</pattern>
<shadedPattern>org.geysermc.floodgate.shaded.io.leangen.geantyref</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
<configuration>
<finalName>${outputName}</finalName>
<shadedArtifactAttached>true</shadedArtifactAttached>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,5 +1,6 @@
dependencies {
api(project(":api"))
api(projects.api)
api("com.google.inject", "guice", Versions.guiceVersion)
api("com.nukkitx.fastutil", "fastutil-short-object-maps", Versions.fastutilVersion)
api("com.nukkitx.fastutil", "fastutil-int-object-maps", Versions.fastutilVersion)
@@ -7,8 +8,8 @@ dependencies {
api("net.kyori", "adventure-api", Versions.adventureApiVersion)
api("cloud.commandframework", "cloud-core", Versions.cloudVersion)
api("org.yaml", "snakeyaml", Versions.snakeyamlVersion)
compileOnly("io.netty", "netty-transport", Versions.nettyVersion)
compileOnly("io.netty", "netty-codec", Versions.nettyVersion)
}
description = "core"
// present on all platforms
provided("io.netty", "netty-transport", Versions.nettyVersion)
provided("io.netty", "netty-codec", Versions.nettyVersion)

View File

@@ -1,133 +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>
<artifactId>parent</artifactId>
<groupId>org.geysermc.floodgate</groupId>
<version>2.1.1-SNAPSHOT</version>
</parent>
<artifactId>core</artifactId>
<properties>
<java-websocket.version>1.5.2</java-websocket.version>
</properties>
<dependencies>
<dependency>
<groupId>org.geysermc.floodgate</groupId>
<artifactId>api</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>org.geysermc.cumulus</groupId>
<artifactId>cumulus</artifactId>
<version>${cumulus.version}</version>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>${guice.version}</version>
</dependency>
<dependency>
<groupId>com.nukkitx.fastutil</groupId>
<artifactId>fastutil-short-object-maps</artifactId>
<version>${fastutil.version}</version>
</dependency>
<dependency>
<groupId>com.nukkitx.fastutil</groupId>
<artifactId>fastutil-int-object-maps</artifactId>
<version>${fastutil.version}</version>
</dependency>
<dependency>
<groupId>org.java-websocket</groupId>
<artifactId>Java-WebSocket</artifactId>
<version>${java-websocket.version}</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId>
<version>${adventure-api.version}</version>
</dependency>
<dependency>
<groupId>cloud.commandframework</groupId>
<artifactId>cloud-core</artifactId>
<version>${cloud.version}</version>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>${snakeyaml.version}</version>
</dependency>
<!-- present on all platforms -->
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId>
<version>${netty.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec</artifactId>
<version>${netty.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<repositories>
<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>minecraft-libraries</id>
<name>Minecraft Libraries</name>
<url>https://libraries.minecraft.net</url>
</repository>
<repository>
<id>paper repo</id>
<url>https://papermc.io/repo/repository/maven-public/</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<finalName>${outputName}</finalName>
<shadedArtifactAttached>true</shadedArtifactAttached>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@@ -47,7 +47,6 @@ import org.geysermc.floodgate.link.PlayerLinkLoader;
import org.geysermc.floodgate.module.ConfigLoadedModule;
import org.geysermc.floodgate.module.PostInitializeModule;
import org.geysermc.floodgate.news.NewsChecker;
import org.geysermc.floodgate.util.FloodgateInfoHolder;
import org.geysermc.floodgate.util.GitProperties;
import org.geysermc.floodgate.util.PrefixCheckTask;
@@ -106,7 +105,7 @@ public class FloodgatePlatform {
InstanceHolder.set(api, link, this.injector, packetHandlers, handshakeHandlers, KEY);
// for Geyser dump
FloodgateInfoHolder.setGitProperties(properties.getProperties());
// FloodgateInfoHolder.setGitProperties(properties.getProperties());
guice.getInstance(NewsChecker.class).start();
}

View File

@@ -31,7 +31,9 @@ public class GitProperties {
private final Properties properties;
public GitProperties() {
properties = Utils.readProperties("git.properties");
// properties = Utils.readProperties("git.properties");
properties = new Properties();
properties.setProperty("git.branch", "dev/2.1.1");
}
public Properties getProperties() {

View File

@@ -1,10 +1,10 @@
plugins {
war
}
val mariadbClientVersion = "2.7.4"
dependencies {
providedCompile(projects.core)
implementation("org.mariadb.jdbc:mariadb-java-client:2.7.4")
provided(projects.core)
implementation("org.mariadb.jdbc", "mariadb-java-client" , mariadbClientVersion)
}
description = "mysql"
description = "The Floodgate database extension for MySQL"
relocate("org.mariadb")

View File

@@ -1,69 +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>
<artifactId>parent</artifactId>
<groupId>org.geysermc.floodgate.database</groupId>
<version>2.1.1-SNAPSHOT</version>
</parent>
<artifactId>mysql</artifactId>
<properties>
<mariadb-client.version>2.7.4</mariadb-client.version>
</properties>
<dependencies>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>${mariadb-client.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.geysermc.floodgate</groupId>
<artifactId>core</artifactId>
<version>${parent.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources/</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>org.mariadb</pattern>
<shadedPattern>org.geysermc.floodgate.shaded.org.mariadb</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
<configuration>
<finalName>${outputName}</finalName>
<shadedArtifactAttached>true</shadedArtifactAttached>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@@ -1,28 +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>
<artifactId>parent</artifactId>
<groupId>org.geysermc.floodgate</groupId>
<version>2.1.1-SNAPSHOT</version>
</parent>
<groupId>org.geysermc.floodgate.database</groupId>
<artifactId>parent</artifactId>
<packaging>pom</packaging>
<name>database</name>
<description></description>
<modules>
<module>sqlite</module>
<module>mysql</module>
</modules>
<properties>
<outputName>floodgate-${project.name}-database</outputName>
</properties>
</project>

View File

@@ -1,10 +1,8 @@
plugins {
war
}
val sqliteJdbcVersion = "3.36.0.3"
dependencies {
providedCompile(projects.core)
implementation("org.xerial:sqlite-jdbc:3.36.0.3")
provided(projects.core)
implementation("org.xerial", "sqlite-jdbc", sqliteJdbcVersion)
}
description = "sqlite"
description = "The Floodgate database extension for SQLite"

View File

@@ -1,61 +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>
<artifactId>parent</artifactId>
<groupId>org.geysermc.floodgate.database</groupId>
<version>2.1.1-SNAPSHOT</version>
</parent>
<artifactId>sqlite</artifactId>
<properties>
<sqlite-jdbc.version>3.36.0.3</sqlite-jdbc.version>
</properties>
<dependencies>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>${sqlite-jdbc.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.geysermc.floodgate</groupId>
<artifactId>core</artifactId>
<version>${parent.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources/</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<finalName>${outputName}</finalName>
<shadedArtifactAttached>true</shadedArtifactAttached>
</configuration>
</plugin>
</plugins>
</build>
</project>

154
pom.xml
View File

@@ -1,154 +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.floodgate</groupId>
<artifactId>parent</artifactId>
<version>2.1.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>floodgate</name>
<description>Allows Bedrock players to join Java edition servers while keeping the server in online mode</description>
<url>https://github.com/GeyserMC/Floodgate</url>
<inceptionYear>2019</inceptionYear>
<organization>
<name>GeyserMC</name>
<url>https://geysermc.org/</url>
</organization>
<licenses>
<license>
<name>MIT License</name>
<url>https://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>
<modules>
<module>api</module>
<module>core</module>
<module>spigot</module>
<module>bungee</module>
<module>velocity</module>
<module>database</module>
</modules>
<scm>
<connection>scm:git:https://github.com/GeyserMC/Floodgate.git</connection>
<developerConnection>scm:git:git@github.com:GeyserMC/Floodgate.git</developerConnection>
<url>https://github.com/GeyserMC/Floodgate/</url>
</scm>
<issueManagement>
<system>GitHub Issues</system>
<url>https://github.com/GeyserMC/Floodgate/issues</url>
</issueManagement>
<properties>
<geyser.version>2.0.0-SNAPSHOT</geyser.version>
<cumulus.version>1.0-SNAPSHOT</cumulus.version>
<spigot.version>1.13-R0.1-SNAPSHOT</spigot.version>
<fastutil.version>8.5.3</fastutil.version>
<lombok.version>1.18.20</lombok.version>
<guice.version>5.0.1</guice.version>
<netty.version>4.1.49.Final</netty.version>
<snakeyaml.version>1.28</snakeyaml.version>
<cloud.version>1.5.0</cloud.version>
<adventure-api.version>4.9.1</adventure-api.version>
<adventure-platform.version>4.0.0</adventure-platform.version>
<outputName>floodgate-${project.name}</outputName>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.14.0</version>
<configuration>
<rulesets>
<ruleset>${session.executionRootDirectory}/ruleset.xml</ruleset>
</rulesets>
<printFailingErrors>true</printFailingErrors>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</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>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.14.0</version>
<configuration>
<rulesets>
<ruleset>${session.executionRootDirectory}/ruleset.xml</ruleset>
</rulesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.3</version>
</plugin>
</plugins>
</reporting>
</project>

View File

@@ -3,19 +3,30 @@ var guavaVersion = "21.0"
var gsonVersion = "2.8.5"
dependencies {
api(project(":core"))
api(projects.core)
// hack to make pre 1.12 work
implementation("com.google.guava", "guava", guavaVersion)
implementation("cloud.commandframework", "cloud-bukkit", Versions.cloudVersion)
implementation("net.kyori", "adventure-text-serializer-legacy", Versions.adventureApiVersion)
implementation("net.kyori", "adventure-text-serializer-gson", Versions.adventureApiVersion)
compileOnly("org.spigotmc", "spigot-api", Versions.spigotVersion)
compileOnly("com.mojang", "authlib", authlibVersion)
compileOnly("io.netty", "netty-transport", Versions.nettyVersion)
compileOnly("io.netty", "netty-codec", Versions.nettyVersion)
compileOnly("com.google.code.gson", "gson", gsonVersion)
compileOnly("org.yaml", "snakeyaml", Versions.snakeyamlVersion)
}
description = "spigot"
relocate("com.google.inject")
relocate("net.kyori")
relocate("cloud.commandframework")
relocate("io.leangen.geantyref") // used in cloud
// hack to make pre 1.12 work
relocate("com.google.common")
relocate("com.google.guava")
// hack to make (old versions? of) Paper work
relocate("it.unimi")
// these dependencies are already present on the platform
provided("org.spigotmc", "spigot-api", Versions.spigotVersion)
provided("com.mojang", "authlib", authlibVersion)
provided("io.netty", "netty-transport", Versions.nettyVersion)
provided("io.netty", "netty-codec", Versions.nettyVersion)
provided("com.google.code.gson", "gson", gsonVersion)
provided("org.yaml", "snakeyaml", Versions.snakeyamlVersion)

View File

@@ -1,163 +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.floodgate</groupId>
<artifactId>parent</artifactId>
<version>2.1.1-SNAPSHOT</version>
</parent>
<artifactId>spigot</artifactId>
<properties>
<authlib.version>1.5.21</authlib.version>
<guava.version>21.0</guava.version>
<gson.version>2.8.5</gson.version>
</properties>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>${spigot.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.mojang</groupId>
<artifactId>authlib</artifactId>
<version>${authlib.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId>
<version>${netty.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec</artifactId>
<version>${netty.version}</version>
<scope>provided</scope>
</dependency>
<!-- part of a hack to make pre 1.12 work -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
<scope>compile</scope>
</dependency>
<!-- end of hack -->
<dependency>
<groupId>org.geysermc.floodgate</groupId>
<artifactId>core</artifactId>
<version>${project.version}</version>
</dependency>
<!-- the following dependencies are (also) relocated -->
<dependency>
<groupId>cloud.commandframework</groupId>
<artifactId>cloud-bukkit</artifactId>
<version>${cloud.version}</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-legacy</artifactId>
<version>${adventure-api.version}</version>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-gson</artifactId>
<version>${adventure-api.version}</version>
</dependency>
<!-- the following common dependencies are already present on the platform -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>${snakeyaml.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>minecraft-libraries</id>
<url>https://libraries.minecraft.net/</url>
</repository>
</repositories>
<build>
<resources>
<resource>
<directory>src/main/resources/</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>com.google.inject</pattern>
<shadedPattern>org.geysermc.floodgate.shaded.com.google.inject</shadedPattern>
</relocation>
<relocation>
<pattern>net.kyori</pattern>
<shadedPattern>org.geysermc.floodgate.shaded.net.kyori</shadedPattern>
</relocation>
<relocation>
<pattern>cloud.commandframework</pattern>
<shadedPattern>org.geysermc.floodgate.shaded.cloud.commandframework</shadedPattern>
</relocation>
<!-- used in cloud -->
<relocation>
<pattern>io.leangen.geantyref</pattern>
<shadedPattern>org.geysermc.floodgate.shaded.io.leangen.geantyref</shadedPattern>
</relocation>
<!-- hack to make pre 1.12 work -->
<relocation>
<pattern>com.google.common</pattern>
<shadedPattern>org.geysermc.floodgate.shaded.com.google.common</shadedPattern>
</relocation>
<relocation>
<pattern>com.google.guava</pattern>
<shadedPattern>org.geysermc.floodgate.shaded.com.google.guava</shadedPattern>
</relocation>
<!-- hack to make (old versions? of) Paper work -->
<relocation>
<pattern>it.unimi</pattern>
<shadedPattern>org.geysermc.floodgate.shaded.it.unimi</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
<configuration>
<finalName>${outputName}</finalName>
<shadedArtifactAttached>true</shadedArtifactAttached>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@@ -4,17 +4,20 @@ var gsonVersion = "2.8.8"
var guavaVersion = "25.1-jre"
dependencies {
implementation(project(":core"))
api(projects.core)
api("cloud.commandframework", "cloud-velocity", Versions.cloudVersion)
compileOnly("net.kyori", "adventure-api", Versions.adventureApiVersion)
compileOnly("com.google.code.gson", "gson", gsonVersion)
compileOnly("com.google.guava", "guava", guavaVersion)
compileOnly("com.google.inject", "guice", Versions.guiceVersion)
compileOnly("org.yaml", "snakeyaml", Versions.snakeyamlVersion)
compileOnly("com.velocitypowered", "velocity-api", velocityVersion)
compileOnly("org.apache.logging.log4j", "log4j-core", log4jVersion)
compileOnly("io.netty", "netty-transport", Versions.nettyVersion)
compileOnly("io.netty", "netty-codec", Versions.nettyVersion)
}
description = "velocity"
relocate("cloud.commandframework")
// used in cloud
relocate("io.leangen.geantyref")
// these dependencies are already present on the platform
provided("net.kyori", "adventure-api", Versions.adventureApiVersion, 0b100)
provided("com.google.code.gson", "gson", gsonVersion)
provided("com.google.guava", "guava", guavaVersion)
provided("com.google.inject", "guice", Versions.guiceVersion)
provided("org.yaml", "snakeyaml", Versions.snakeyamlVersion) // included in Configurate
provided("com.velocitypowered", "velocity-api", velocityVersion)
provided("org.apache.logging.log4j", "log4j-core", log4jVersion)

View File

@@ -1,148 +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>
<artifactId>parent</artifactId>
<groupId>org.geysermc.floodgate</groupId>
<version>2.1.1-SNAPSHOT</version>
</parent>
<artifactId>velocity</artifactId>
<properties>
<velocity.version>3.0.1</velocity.version>
<log4j.version>2.11.2</log4j.version>
<gson.version>2.8.8</gson.version>
<guava.version>25.1-jre</guava.version>
</properties>
<dependencies>
<dependency>
<groupId>org.geysermc.floodgate</groupId>
<artifactId>core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>cloud.commandframework</groupId>
<artifactId>cloud-velocity</artifactId>
<version>${cloud.version}</version>
</dependency>
<!-- the following common dependencies are already present on the platform -->
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId>
<version>${adventure-api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>${gson.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>${guice.version}</version>
<scope>provided</scope>
</dependency>
<!-- SnakeYaml is included in Configurate -->
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>${snakeyaml.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.velocitypowered</groupId>
<artifactId>velocity-api</artifactId>
<version>${velocity.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-transport</artifactId>
<version>${netty.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-codec</artifactId>
<version>${netty.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>velocity-repo</id>
<url>https://repo.velocitypowered.com/snapshots/</url>
</repository>
<!-- Hotfix to support the newest velocity-api, because they depend on the minecraft repo
but for whatever reason they don't have it in the velocity-api -->
<repository>
<id>minecraft-repo</id>
<url>https://libraries.minecraft.net/</url>
</repository>
<repository>
<id>sponge-repo</id>
<url>https://repo.spongepowered.org/maven/</url>
</repository>
</repositories>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>cloud.commandframework</pattern>
<shadedPattern>org.geysermc.floodgate.shaded.cloud.commandframework</shadedPattern>
</relocation>
<!-- used in cloud -->
<relocation>
<pattern>io.leangen.geantyref</pattern>
<shadedPattern>org.geysermc.floodgate.shaded.io.leangen.geantyref</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
<configuration>
<finalName>${outputName}</finalName>
<shadedArtifactAttached>true</shadedArtifactAttached>
</configuration>
</plugin>
</plugins>
</build>
</project>