From fd0c2050d8f5599d0cc1b8f84be8dabca0603d3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20S=C3=B6derberg?= <4096670+Citymonstret@users.noreply.github.com> Date: Fri, 31 Dec 2021 15:49:11 +0100 Subject: [PATCH] =?UTF-8?q?Refactor:=20Replace=20R=C3=B6rledning=20with=20?= =?UTF-8?q?Cloud-Services=20(#3409)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Refactor: Replace Rörledning with Cloud-Services Cloud-Services is actually maintained, as opposed to Rörledning. Furthermore, Rörledning is available through Maven Central, whereas rörledning isn't. This is a semi-breaking change, but because we relocate, it might be fine? Either way, this is a necessary change. * build: Provide jsr at runtime * Merge branch 'v6' into refactor/v6/cloud-services Co-authored-by: NotMyFault --- Bukkit/build.gradle.kts | 4 +++- Core/build.gradle.kts | 6 ++---- Core/src/main/java/com/plotsquared/core/PlotPlatform.java | 2 +- Core/src/main/java/com/plotsquared/core/command/Auto.java | 6 +++--- .../plotsquared/core/inject/modules/PlotSquaredModule.java | 2 +- .../com/plotsquared/core/services/plots/AutoService.java | 2 +- build.gradle.kts | 5 +++++ gradle/libs.versions.toml | 6 +++--- 8 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Bukkit/build.gradle.kts b/Bukkit/build.gradle.kts index 68179e38a..b49c75652 100644 --- a/Bukkit/build.gradle.kts +++ b/Bukkit/build.gradle.kts @@ -75,7 +75,8 @@ tasks.named("shadowJar") { relocate("org.khelekore.prtree", "com.plotsquared.prtree") relocate("com.google.inject", "com.plotsquared.google") relocate("org.aopalliance", "com.plotsquared.core.aopalliance") - relocate("com.intellectualsites.services", "com.plotsquared.core.services") + relocate("cloud.commandframework.services", "com.plotsquared.core.services") + relocate("io.leangen.geantyref", "com.plotsquared.core.geantyref") relocate("com.intellectualsites.arkitektonika", "com.plotsquared.core.arkitektonika") relocate("com.intellectualsites.http", "com.plotsquared.core.http") relocate("com.intellectualsites.paster", "com.plotsquared.core.paster") @@ -83,6 +84,7 @@ tasks.named("shadowJar") { relocate("org.jetbrains", "com.plotsquared.core.annotations") relocate("org.intellij.lang", "com.plotsquared.core.intellij.annotations") relocate("javax.annotation", "com.plotsquared.core.annotation") + relocate("com.google.code.findbugs", "com.plotsquared.core.findbugs") relocate("javax.inject", "com.plotsquared.core.annotation.inject") // Get rid of all the libs which are 100% unused. diff --git a/Core/build.gradle.kts b/Core/build.gradle.kts index 35a49d32a..c1fdea943 100644 --- a/Core/build.gradle.kts +++ b/Core/build.gradle.kts @@ -22,7 +22,7 @@ dependencies { api(libs.guiceassistedinject) { exclude("com.google.inject", "guice") } - compileOnlyApi(libs.findbugs) + api(libs.findbugs) // Plugins compileOnly(libs.worldeditCore) { @@ -40,9 +40,7 @@ dependencies { // Other libraries api(libs.prtree) api(libs.aopalliance) - api(libs.rorledning) { - exclude(group = "com.google.guava") - } + api(libs.cloudServices) api(libs.arkitektonika) api(libs.paster) } diff --git a/Core/src/main/java/com/plotsquared/core/PlotPlatform.java b/Core/src/main/java/com/plotsquared/core/PlotPlatform.java index 6f1580a1b..54058d4a6 100644 --- a/Core/src/main/java/com/plotsquared/core/PlotPlatform.java +++ b/Core/src/main/java/com/plotsquared/core/PlotPlatform.java @@ -25,10 +25,10 @@ */ package com.plotsquared.core; +import cloud.commandframework.services.ServicePipeline; import com.google.inject.Injector; import com.google.inject.Key; import com.google.inject.TypeLiteral; -import com.intellectualsites.services.ServicePipeline; import com.plotsquared.core.backup.BackupManager; import com.plotsquared.core.configuration.caption.LocaleHolder; import com.plotsquared.core.generator.GeneratorWrapper; diff --git a/Core/src/main/java/com/plotsquared/core/command/Auto.java b/Core/src/main/java/com/plotsquared/core/command/Auto.java index 7d234a3bd..18ebbe90b 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Auto.java +++ b/Core/src/main/java/com/plotsquared/core/command/Auto.java @@ -25,9 +25,8 @@ */ package com.plotsquared.core.command; -import com.google.common.reflect.TypeToken; +import cloud.commandframework.services.ServicePipeline; import com.google.inject.Inject; -import com.intellectualsites.services.ServicePipeline; import com.plotsquared.core.PlotSquared; import com.plotsquared.core.configuration.Settings; import com.plotsquared.core.configuration.caption.TranslatableCaption; @@ -51,6 +50,7 @@ import com.plotsquared.core.util.PlotExpression; import com.plotsquared.core.util.task.AutoClaimFinishTask; import com.plotsquared.core.util.task.RunnableVal; import com.plotsquared.core.util.task.TaskManager; +import io.leangen.geantyref.TypeToken; import net.kyori.adventure.text.minimessage.Template; import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; @@ -84,7 +84,7 @@ public class Auto extends SubCommand { this.eventDispatcher = eventDispatcher; this.econHandler = econHandler; this.servicePipeline = servicePipeline; - this.servicePipeline.registerServiceType(TypeToken.of(AutoService.class), new AutoService.DefaultAutoService()); + this.servicePipeline.registerServiceType(TypeToken.get(AutoService.class), new AutoService.DefaultAutoService()); final AutoService.MultiPlotService multiPlotService = new AutoService.MultiPlotService(); this.servicePipeline.registerServiceImplementation(AutoService.class, multiPlotService, Collections.singletonList(multiPlotService) diff --git a/Core/src/main/java/com/plotsquared/core/inject/modules/PlotSquaredModule.java b/Core/src/main/java/com/plotsquared/core/inject/modules/PlotSquaredModule.java index bb83a0df7..f992506b9 100644 --- a/Core/src/main/java/com/plotsquared/core/inject/modules/PlotSquaredModule.java +++ b/Core/src/main/java/com/plotsquared/core/inject/modules/PlotSquaredModule.java @@ -25,8 +25,8 @@ */ package com.plotsquared.core.inject.modules; +import cloud.commandframework.services.ServicePipeline; import com.google.inject.AbstractModule; -import com.intellectualsites.services.ServicePipeline; import com.plotsquared.core.PlotSquared; import com.plotsquared.core.configuration.file.YamlConfiguration; import com.plotsquared.core.inject.annotations.BackgroundPipeline; diff --git a/Core/src/main/java/com/plotsquared/core/services/plots/AutoService.java b/Core/src/main/java/com/plotsquared/core/services/plots/AutoService.java index 765e3394a..41535fda1 100644 --- a/Core/src/main/java/com/plotsquared/core/services/plots/AutoService.java +++ b/Core/src/main/java/com/plotsquared/core/services/plots/AutoService.java @@ -25,9 +25,9 @@ */ package com.plotsquared.core.services.plots; +import cloud.commandframework.services.types.Service; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; -import com.intellectualsites.services.types.Service; import com.plotsquared.core.player.PlotPlayer; import com.plotsquared.core.plot.Plot; import com.plotsquared.core.plot.PlotArea; diff --git a/build.gradle.kts b/build.gradle.kts index faa058a53..1712d0051 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -32,6 +32,11 @@ allprojects { url = uri("https://oss.sonatype.org/content/repositories/snapshots/") } + maven { + name = "Sonatype OSS (S01)" + url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots") + } + maven { name = "Jitpack" url = uri("https://jitpack.io") diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d84d2eed6..2b4c815ed 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -18,7 +18,7 @@ adventure-platform-bukkit = "4.0.1" # Plugins worldedit = "7.2.8" -fawe = "1.17-419" +fawe = "2.0.0-SNAPSHOT" vault = "1.7.1" placeholderapi = "2.11.1" luckperms = "5.3" @@ -29,7 +29,7 @@ mvdwapi = "3.1.1" # Third party prtree = "2.0.0" aopalliance = "1.0" -rorledning = "1.4.0-SNAPSHOT" +cloud-services = "1.6.0" arkitektonika = "2.1.1" paster = "1.1.3" bstats = "2.2.1" @@ -78,7 +78,7 @@ hyperverse = { group = "se.hyperver.hyperverse", name = "Core", version.ref = "h # Third party prtree = { group = "com.intellectualsites.prtree", name = "PRTree", version.ref = "prtree" } aopalliance = { group = "aopalliance", name = "aopalliance", version.ref = "aopalliance" } -rorledning = { group = "com.intellectualsites", name = "Pipeline", version.ref = "rorledning" } +cloudServices = { group = "cloud.commandframework", name = "cloud-services", version.ref = "cloud-services" } mvdwapi = { group = "com.intellectualsites.mvdwplaceholderapi", name = "MVdWPlaceholderAPI", version.ref = "mvdwapi" } squirrelid = { group = "org.enginehub", name = "squirrelid", version.ref = "squirrelid" } serverlib = { group = "dev.notmyfault.serverlib", name = "ServerLib", version.ref = "serverlib" }