From e83e3876251e258cb1b251cb6fa8efad6a42ed10 Mon Sep 17 00:00:00 2001 From: duncte123 Date: Sat, 8 Jul 2023 08:57:34 +0200 Subject: [PATCH] Migrate to version catalogs --- README.md | 7 +++++ build.gradle.kts | 3 +- gradle/libs.versions.toml | 6 ---- settings.gradle.kts | 28 +++++++++++++++++++ .../lavalinkplugin/DuncteBotInjector.java | 4 ++- 5 files changed, 40 insertions(+), 8 deletions(-) delete mode 100644 gradle/libs.versions.toml diff --git a/README.md b/README.md index 9381f06..c22b28d 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,13 @@ Adding support for the following sources: - PornHub - soundgasm +## Lavalink version compatibility + +| Lavalink Version | Plugin Version | +|------------------|-------------------------| +| 3.x.x | 1.4.x (1.5 is untested) | +| 4.x.x | 1.4.x OR 1.5.x | + # Lavaplayer users If you need to add the source managers to your lavalink instance as well you can use this library to add them: https://github.com/DuncteBot/skybot-source-managers diff --git a/build.gradle.kts b/build.gradle.kts index 1228be0..257585d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -39,7 +39,8 @@ repositories { } dependencies { - implementation("com.dunctebot:sourcemanagers:1.8.3") + implementation(libs.sourcemanager) +// implementation(project(":skybot-source-managers")) } tasks.getByName("test") { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml deleted file mode 100644 index ea04ecd..0000000 --- a/gradle/libs.versions.toml +++ /dev/null @@ -1,6 +0,0 @@ -[versions] -lavalink-api = "4.0.0-beta.1" -lavalink-server = "1c0795bf156fe6559c9c0aed0412bcd8f323a3e0" - -[plugins] -lavalink = { id = "dev.arbjerg.lavalink.gradle-plugin", version = "1.0.7" } diff --git a/settings.gradle.kts b/settings.gradle.kts index 6fc0b63..d05fc2c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,2 +1,30 @@ rootProject.name = "lavalink-plugin" +//include(":skybot-source-managers") +//project(":skybot-source-managers").projectDir = File("../skybot-source-managers") +enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") + +dependencyResolutionManagement { + versionCatalogs { + create("libs") { + common() + plugins() + } + } +} + +fun VersionCatalogBuilder.common() { + library("sourcemanager", "com.dunctebot", "sourcemanagers").version("1.8.3") + + version("lavalink-api", "4.0.0-beta.1") + version("lavalink-server", "1c0795bf156fe6559c9c0aed0412bcd8f323a3e0") + +} + +fun VersionCatalogBuilder.plugins() { + plugin("lavalink", "dev.arbjerg.lavalink.gradle-plugin").version("1.0.7") +} + +fun VersionCatalogBuilder.testBot() { + // +} diff --git a/src/main/java/com/dunctebot/lavalinkplugin/DuncteBotInjector.java b/src/main/java/com/dunctebot/lavalinkplugin/DuncteBotInjector.java index d65bfff..58bac85 100644 --- a/src/main/java/com/dunctebot/lavalinkplugin/DuncteBotInjector.java +++ b/src/main/java/com/dunctebot/lavalinkplugin/DuncteBotInjector.java @@ -11,6 +11,7 @@ import com.dunctebot.sourcemanagers.tiktok.TikTokAudioSourceManager; import com.sedmelluq.discord.lavaplayer.player.AudioPlayerManager; import dev.arbjerg.lavalink.api.AudioPlayerManagerConfiguration; +import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; @@ -27,8 +28,9 @@ public DuncteBotInjector(DuncteBotConfig config, DuncteBotConfig.Sources sources this.sourcesConfig = sourcesConfig; } + @NotNull @Override - public AudioPlayerManager configure(AudioPlayerManager manager) { + public AudioPlayerManager configure(@NotNull AudioPlayerManager manager) { final Logger logger = LoggerFactory.getLogger(DuncteBotInjector.class); // register custom source managers