mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2024-11-01 08:39:31 +01:00
Couple fixes, remove runtime dependency on error prone annotations
This commit is contained in:
parent
1f6cefebac
commit
c6cbf2dfc3
@ -3,12 +3,13 @@ apply from: rootProject.file('buildscript/relocations.gradle')
|
||||
dependencies {
|
||||
// Annotations
|
||||
compileOnlyApi 'org.jetbrains:annotations:22.0.0'
|
||||
api 'com.google.code.findbugs:jsr305:3.0.2'
|
||||
compileOnlyApi 'com.google.code.findbugs:jsr305:3.0.2'
|
||||
|
||||
// JDA
|
||||
api('net.dv8tion:JDA:' + rootProject.jdaVersion) {
|
||||
// Annotations are suppose to be compile time only
|
||||
exclude group: 'org.jetbrains', module: 'annotations'
|
||||
exclude group: 'com.google.code.findbugs', module: 'jsr305'
|
||||
|
||||
// We don't use audio
|
||||
exclude module: 'opus-java'
|
||||
|
@ -43,7 +43,9 @@ dependencies {
|
||||
runtimeDownloadApi 'commons-io:commons-io:2.10.0'
|
||||
|
||||
// Caffeine
|
||||
runtimeDownloadApi 'com.github.ben-manes.caffeine:caffeine:2.9.2'
|
||||
runtimeDownloadApi('com.github.ben-manes.caffeine:caffeine:2.9.2') {
|
||||
exclude group: 'com.google.errorprone', module: 'error_prone_annotations'
|
||||
}
|
||||
|
||||
// Config
|
||||
runtimeDownloadApi 'org.spongepowered:configurate-yaml:' + rootProject.configurateVersion
|
||||
|
@ -47,7 +47,6 @@ import com.discordsrv.common.exception.StorageException;
|
||||
import com.discordsrv.common.function.CheckedFunction;
|
||||
import com.discordsrv.common.function.CheckedRunnable;
|
||||
import com.discordsrv.common.groupsync.GroupSyncModule;
|
||||
import com.discordsrv.common.integration.LuckPermsIntegration;
|
||||
import com.discordsrv.common.invite.DiscordInviteModule;
|
||||
import com.discordsrv.common.linking.LinkProvider;
|
||||
import com.discordsrv.common.linking.impl.MemoryLinker;
|
||||
@ -453,7 +452,6 @@ public abstract class AbstractDiscordSRV<C extends MainConfig, CC extends Connec
|
||||
registerModule(GlobalChannelLookupModule::new);
|
||||
registerModule(DiscordAPIEventModule::new);
|
||||
registerModule(GroupSyncModule::new);
|
||||
registerModule(LuckPermsIntegration::new);
|
||||
registerModule(DiscordChatMessageModule::new);
|
||||
registerModule(DiscordMessageMirroringModule::new);
|
||||
registerModule(JoinMessageModule::new);
|
||||
|
@ -35,11 +35,12 @@ public final class ApiInstanceUtil {
|
||||
public static void setInstance(@NotNull DiscordSRV discordSRV) {
|
||||
// Avoids illegal access
|
||||
try {
|
||||
Class<?> apiProviderClass = Class.forName("com.discordsrv.api.InstanceHolder");
|
||||
Class<?> apiProviderClass = Class.forName("com.discordsrv.api.ApiInstanceHolder");
|
||||
Method provideMethod = apiProviderClass.getDeclaredMethod("provide", DiscordSRVApi.class);
|
||||
provideMethod.setAccessible(true);
|
||||
provideMethod.invoke(null, discordSRV);
|
||||
} catch (ClassNotFoundException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
discordSRV.logger().error("Failed to set API instance", e);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user