Skip to content

Commit

Permalink
misc: Removed Caffeine runtime download and relocation
Browse files Browse the repository at this point in the history
Caffeine was recently updated in Velocity (to an even more updated version than the one included in KickRedirect), so there is no longer any need to download it on our own
  • Loading branch information
4drian3d committed Jan 9, 2023
1 parent 7d1ce2b commit 4af55ad
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 16 deletions.
11 changes: 8 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,28 @@ blossom {
replaceToken("{url}", property("url"))
replaceToken("{configurate}", libs.versions.configurate.get())
replaceToken("{geantyref}", libs.versions.geantyref.get())
replaceToken("{caffeine}", libs.versions.caffeine.get())
}

tasks {
build {
dependsOn(shadowJar)
}

clean {
delete("run")
}

shadowJar {
relocate("org.spongepowered", "me.dreamerzero.kickredirect.libs.sponge")
relocate("net.byteflux", "me.dreamerzero.kickredirect.libs.byteflux")
relocate("io.leangen.geantyref", "me.dreamerzero.kickredirect.libs.geantyref")
relocate("com.github.ben-manes.caffeine", "me.dreamerzero.kickredirect.libs.caffeine")
relocate("org.bstats", "me.dreamerzero.kickredirect.libs.bstats")

// TODO: Apply in a future release
/*listOf(
"org.spongepowered",
"net.byteflux",
"io.leangen.geantyref",
"com.github.ben-manes.caffeine",
"org.bstats"
).forEach {
relocate(it, "me.adrianed.kickredirect.libs.$it")
Expand All @@ -86,6 +87,10 @@ tasks {

options.release.set(11)
}




}

java.toolchain.languageVersion.set(JavaLanguageVersion.of(11))
22 changes: 19 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,45 @@ metadata.format.version = "1.1"

[versions]

# Compile only
velocity = "3.2.0-SNAPSHOT"
libby = "43d25ade72"
bstats = "3.0.0"
configurate = "4.1.2"
miniplaceholders = "1.3.1"
caffeine = "3.1.1"

# Plugins
blossom = "1.3.1"
shadow = "7.1.2"
runvelocity = "2.0.1"

# Test versions
slf4j = "2.0.5"
assertj = "3.23.1"

# Required by Configurate 4
geantyref = "1.3.13"

# Velocity dependencies included in classpath but not in API
caffeine = "3.1.2"

[libraries]

# Compile Only Dependencies
velocity = { group = "com.velocitypowered", name = "velocity-api", version.ref = "velocity" }
bstats = { module = "org.bstats:bstats-velocity", version.ref = "bstats" }
configurate = { module = "org.spongepowered:configurate-hocon", version.ref = "configurate" }
miniplaceholders = { group = "com.github.4drian3d", name = "MiniPlaceholders", version.ref = "miniplaceholders" }
caffeine = { module = "com.github.ben-manes.caffeine:caffeine", version.ref = "caffeine" }

# Included Dependencies
libby = { group = "com.github.AlessioDP.libby", name = "libby-velocity", version.ref = "libby" }

# Test Dependencies
slf4j = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
assetrj = { module = "org.assertj:assertj-core", version.ref = "assertj" }
libby = { group = "com.github.AlessioDP.libby", name = "libby-velocity", version.ref = "libby" }

# Velocity dependencies included in classpath but not in API
caffeine = { module = "com.github.ben-manes.caffeine:caffeine", version.ref = "caffeine" }

[plugins]

Expand Down
8 changes: 0 additions & 8 deletions src/main/java/me/dreamerzero/kickredirect/Dependencies.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,10 @@ static void loadDependencies(KickRedirect plugin, Logger logger, PluginManager m
.id("geantyref")
.relocate(geantyrefRelocation)
.build();
final Library caffeine = Library.builder()
.groupId("com{}github{}ben-manes{}caffeine")
.artifactId("caffeine")
.version(Constants.CAFFEINE)
.id("caffeine")
.relocate("com{}github{}ben-manes{}caffeine", "me.dreamerzero.kickredirect.libs.caffeine")
.build();

libraryManager.addMavenCentral();
libraryManager.loadLibrary(geantyref);
libraryManager.loadLibrary(hocon);
libraryManager.loadLibrary(confCore);
libraryManager.loadLibrary(caffeine);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ public class Constants {
/**Plugin ID */
public static final String ID = "{id}";

/**Caffeine Version */
public static final String CAFFEINE = "{caffeine}";
/**Configurate Version */
public static final String CONFIGURATE = "{configurate}";
/**Geantyref Version (Configurate Dependency)*/
Expand Down

0 comments on commit 4af55ad

Please sign in to comment.