Rename slf4j-hack module to unrelocate

This commit is contained in:
Vankka 2022-04-26 14:56:32 +03:00
parent 4d9f6ca198
commit 5b8a139836
No known key found for this signature in database
GPG Key ID: 6E50CB7A29B96AD0
7 changed files with 8 additions and 8 deletions

View File

@ -63,6 +63,6 @@ shadowJar {
relocate it, 'com.discordsrv.dependencies.' + it
}
// SLF4J hack
relocate('com.discordsrv.x.slf4j', 'org.slf4j')
// Unrelocate package, in case a platform uses something we normally relocate
relocate('com.discordsrv.unrelocate.', '')
}

View File

@ -55,7 +55,7 @@ dependencies {
runtimeDownloadApi(libs.configurate.hocon)
// Logging
compileOnlyApi project(':common:common-slf4j-hack')
compileOnlyApi project(':common:common-unrelocate')
compileOnly(libs.log4j.core)
// Adventure, MCDiscordReserializer, EnhancedLegacyText

View File

@ -25,9 +25,9 @@ import org.jetbrains.annotations.Nullable;
public class SLF4JLoggerImpl implements Logger {
private final com.discordsrv.x.slf4j.Logger logger;
private final com.discordsrv.unrelocate.org.slf4j.Logger logger;
public SLF4JLoggerImpl(com.discordsrv.x.slf4j.Logger logger) {
public SLF4JLoggerImpl(com.discordsrv.unrelocate.org.slf4j.Logger logger) {
this.logger = logger;
}

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.discordsrv.x.slf4j;
package com.discordsrv.unrelocate.org.slf4j;
/**
* A fake org.slf4j.Logger that is compileOnly scoped and relocated back to the real org.slf4j package.

View File

@ -127,7 +127,7 @@ dependencyResolutionManagement {
rootProject.name = 'DiscordSRV2'
[
'common', 'common:api', 'common:server', 'common:proxy', 'common:slf4j-hack',
'common', 'common:api', 'common:server', 'common:proxy', 'common:unrelocate',
'i18n',
'api',
'bukkit', 'bukkit:loader',

View File

@ -56,7 +56,7 @@ public class DiscordSRVVelocityBootstrap implements IBootstrap {
private VelocityDiscordSRV discordSRV;
@Inject
public DiscordSRVVelocityBootstrap(com.discordsrv.x.slf4j.Logger logger, ProxyServer proxyServer, PluginContainer pluginContainer, @DataDirectory Path dataDirectory) throws IOException {
public DiscordSRVVelocityBootstrap(com.discordsrv.unrelocate.org.slf4j.Logger logger, ProxyServer proxyServer, PluginContainer pluginContainer, @DataDirectory Path dataDirectory) throws IOException {
this.logger = new SLF4JLoggerImpl(logger);
this.classpathAppender = new VelocityClasspathAppender(this, proxyServer);
this.lifecycleManager = new LifecycleManager(