mirror of
https://github.com/lax1dude/eaglerxserver
synced 2025-06-05 15:51:59 -09:00
Further improve the eaglermotd gradle project
This commit is contained in:
parent
aa162d9ddc
commit
7fcaa308fe
@ -1,29 +1,63 @@
|
||||
|
||||
plugins {
|
||||
id "java"
|
||||
id "java-library"
|
||||
id "com.gradleup.shadow" version "8.3.6"
|
||||
}
|
||||
|
||||
configurations {
|
||||
platformBukkit
|
||||
platformBungee
|
||||
platformVelocity
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(":eaglermotd:eaglermotd-common")
|
||||
runtimeOnly project(":eaglermotd:eaglermotd-platform-bukkit")
|
||||
runtimeOnly project(":eaglermotd:eaglermotd-platform-bungee")
|
||||
runtimeOnly project(":eaglermotd:eaglermotd-platform-velocity")
|
||||
platformBukkit project(":eaglermotd:eaglermotd-platform-bukkit")
|
||||
platformBungee project(":eaglermotd:eaglermotd-platform-bungee")
|
||||
platformVelocity project(":eaglermotd:eaglermotd-platform-velocity")
|
||||
compileOnly project(":api")
|
||||
compileOnly(libs.guava)
|
||||
compileOnly(libs.gson)
|
||||
compileOnly(libs.slf4j)
|
||||
}
|
||||
|
||||
jar {
|
||||
dependsOn ":eaglermotd:eaglermotd-common:jar" // Workaround
|
||||
dependsOn ":eaglermotd:eaglermotd-platform-bukkit:jar" // Workaround
|
||||
dependsOn ":eaglermotd:eaglermotd-platform-bungee:jar" // Workaround
|
||||
dependsOn ":eaglermotd:eaglermotd-platform-velocity:jar" // Workaround
|
||||
|
||||
tasks.named("shadowJar", com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
|
||||
group "shadow"
|
||||
description "Builds the JAR for all supported platforms"
|
||||
configurations = [
|
||||
project.configurations.runtimeClasspath,
|
||||
project.configurations.platformBukkit,
|
||||
project.configurations.platformBungee,
|
||||
project.configurations.platformVelocity
|
||||
]
|
||||
archiveFileName = "EaglerMOTD.jar"
|
||||
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
|
||||
from {
|
||||
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register("shadowJarBukkit", com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
|
||||
group "shadow"
|
||||
description "Builds the JAR for Bukkit platforms"
|
||||
configurations = [
|
||||
project.configurations.runtimeClasspath,
|
||||
project.configurations.platformBukkit
|
||||
]
|
||||
archiveFileName = "EaglerMOTD-Bukkit.jar"
|
||||
}
|
||||
|
||||
tasks.register("shadowJarBungee", com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
|
||||
group "shadow"
|
||||
description "Builds the JAR for Bungee platforms"
|
||||
configurations = [
|
||||
project.configurations.runtimeClasspath,
|
||||
project.configurations.platformBungee
|
||||
]
|
||||
archiveFileName = "EaglerMOTD-Bungee.jar"
|
||||
}
|
||||
|
||||
tasks.register("shadowJarVelocity", com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
|
||||
group "shadow"
|
||||
description "Builds the JAR for Velocity platforms"
|
||||
configurations = [
|
||||
project.configurations.runtimeClasspath,
|
||||
project.configurations.platformVelocity
|
||||
]
|
||||
archiveFileName = "EaglerMOTD-Velocity.jar"
|
||||
}
|
||||
|
@ -1,9 +0,0 @@
|
||||
|
||||
plugins {
|
||||
id "java-library"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly project(":api")
|
||||
compileOnly(libs.slf4j)
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2025 lax1dude. All Rights Reserved.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
package net.lax1dude.eaglercraft.backend.eaglermotd.base;
|
||||
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.adapter.IEaglerMOTDImpl;
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.adapter.IEaglerMOTDPlatform;
|
||||
|
||||
/**
|
||||
* Class to invoke the EaglerMOTD constructor without a static dependency
|
||||
*/
|
||||
public class EaglerMOTDFactory {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static <PlayerObject> IEaglerMOTDImpl<PlayerObject> create(IEaglerMOTDPlatform<PlayerObject> platform) {
|
||||
try {
|
||||
Class<?> clz = Class.forName("net.lax1dude.eaglercraft.backend.eaglermotd.base.EaglerMOTD");
|
||||
return (IEaglerMOTDImpl<PlayerObject>) clz.getConstructor(IEaglerMOTDPlatform.class).newInstance(platform);
|
||||
} catch (ReflectiveOperationException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -4,7 +4,7 @@ plugins {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(":eaglermotd:eaglermotd-common")
|
||||
api project(":eaglermotd")
|
||||
compileOnly project(":api-bukkit")
|
||||
compileOnly(libs.paper.api)
|
||||
compileOnly(libs.pluginannotations)
|
||||
|
@ -29,7 +29,7 @@ import net.lax1dude.eaglercraft.backend.eaglermotd.adapter.IEaglerMOTDImpl;
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.adapter.IEaglerMOTDLogger;
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.adapter.IEaglerMOTDPlatform;
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.adapter.JavaLogger;
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.base.EaglerMOTDFactory;
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.base.EaglerMOTD;
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.base.EaglerMOTDVersion;
|
||||
import net.lax1dude.eaglercraft.backend.server.api.bukkit.EaglerXServerAPI;
|
||||
import net.lax1dude.eaglercraft.backend.server.api.event.IEaglercraftMOTDEvent;
|
||||
@ -62,7 +62,7 @@ public class PlatformPluginBukkit extends JavaPlugin implements IEaglerMOTDPlatf
|
||||
@Override
|
||||
public void onLoad() {
|
||||
logger = new JavaLogger(getLogger());
|
||||
eaglermotd = EaglerMOTDFactory.create(this);
|
||||
eaglermotd = new EaglerMOTD<>(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -4,7 +4,7 @@ plugins {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(":eaglermotd:eaglermotd-common")
|
||||
api project(":eaglermotd")
|
||||
compileOnly project(":api-bungee")
|
||||
compileOnly(libs.bungeecord.api)
|
||||
compileOnly(libs.pluginannotations)
|
||||
|
@ -25,7 +25,7 @@ import net.lax1dude.eaglercraft.backend.eaglermotd.adapter.IEaglerMOTDImpl;
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.adapter.IEaglerMOTDLogger;
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.adapter.IEaglerMOTDPlatform;
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.adapter.JavaLogger;
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.base.EaglerMOTDFactory;
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.base.EaglerMOTD;
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.base.EaglerMOTDVersion;
|
||||
import net.lax1dude.eaglercraft.backend.server.api.bungee.EaglerXServerAPI;
|
||||
import net.lax1dude.eaglercraft.backend.server.api.event.IEaglercraftMOTDEvent;
|
||||
@ -54,7 +54,7 @@ public class PlatformPluginBungee extends Plugin implements IEaglerMOTDPlatform<
|
||||
@Override
|
||||
public void onLoad() {
|
||||
logger = new JavaLogger(getLogger());
|
||||
eaglermotd = EaglerMOTDFactory.create(this);
|
||||
eaglermotd = new EaglerMOTD<>(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -4,7 +4,7 @@ plugins {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(":eaglermotd:eaglermotd-common")
|
||||
api project(":eaglermotd")
|
||||
compileOnly project(":api-velocity")
|
||||
compileOnly(libs.velocity.api)
|
||||
annotationProcessor(libs.velocity.api)
|
||||
|
@ -36,7 +36,7 @@ import net.lax1dude.eaglercraft.backend.eaglermotd.adapter.IEaglerMOTDImpl;
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.adapter.IEaglerMOTDLogger;
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.adapter.IEaglerMOTDPlatform;
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.adapter.SLF4JLogger;
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.base.EaglerMOTDFactory;
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.base.EaglerMOTD;
|
||||
import net.lax1dude.eaglercraft.backend.eaglermotd.base.EaglerMOTDVersion;
|
||||
import net.lax1dude.eaglercraft.backend.server.api.event.IEaglercraftMOTDEvent;
|
||||
import net.lax1dude.eaglercraft.backend.server.api.velocity.EaglerXServerAPI;
|
||||
@ -73,7 +73,7 @@ public class PlatformPluginVelocity implements IEaglerMOTDPlatform<Player> {
|
||||
logger = loggerIn;
|
||||
dataDir = dataDirIn.toFile();
|
||||
rewindLogger = new SLF4JLogger(loggerIn);
|
||||
eaglermotd = EaglerMOTDFactory.create(this);
|
||||
eaglermotd = new EaglerMOTD<>(this);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
@ -24,7 +24,6 @@ include "rewind_v1_5:rewind_v1_5-platform-bukkit"
|
||||
include "rewind_v1_5:rewind_v1_5-platform-bungee"
|
||||
include "rewind_v1_5:rewind_v1_5-platform-velocity"
|
||||
include "eaglermotd"
|
||||
include "eaglermotd:eaglermotd-common"
|
||||
include "eaglermotd:eaglermotd-platform-bukkit"
|
||||
include "eaglermotd:eaglermotd-platform-bungee"
|
||||
include "eaglermotd:eaglermotd-platform-velocity"
|
||||
|
Loading…
x
Reference in New Issue
Block a user