Skip to content

Commit

Permalink
Gradle version management
Browse files Browse the repository at this point in the history
  • Loading branch information
iiAhmedYT committed Sep 26, 2024
1 parent c1ad07d commit 383bf5e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
22 changes: 19 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
plugins {
id 'java'
id 'maven-publish'
id "net.kyori.blossom" version "2.1.0"
id "io.github.goooler.shadow" version "8.1.7"
id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.9"
}

group = 'to.itsme'
Expand Down Expand Up @@ -39,20 +41,23 @@ repositories {
}

def lampVersion = "4.0.0-beta.7"

def adventureVersion = "4.17.0"
def adventurePlatformVersion = "4.3.4"
dependencies {
// lamp ->
implementation "io.github.revxrsal:lamp.common:${lampVersion}"
implementation "io.github.revxrsal:lamp.bukkit:${lampVersion}"
implementation "com.alessiodp.libby:libby-bukkit:2.0.0-SNAPSHOT"

// other ->
implementation "org.bstats:bstats-bukkit:3.0.2"
implementation "com.github.Redempt:Crunch:2.0.3"
implementation "com.github.technicallycoded:FoliaLib:0.4.3"
implementation "com.alessiodp.libby:libby-bukkit:2.0.0-SNAPSHOT"

compileOnly "io.papermc.paper:paper-api:1.20.6-R0.1-SNAPSHOT"
compileOnly "net.kyori:adventure-platform-bukkit:$adventurePlatformVersion"
compileOnly "com.comphenix.protocol:ProtocolLib:5.3.0-SNAPSHOT"
compileOnly "net.kyori:adventure-platform-bukkit:4.3.4"
compileOnly "io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT"
compileOnly "me.clip:placeholderapi:2.11.6"
}

Expand All @@ -72,6 +77,17 @@ processResources {
}
}

sourceSets {
main {
blossom {
javaSources {
property("adventureVersion", adventureVersion)
property("adventurePlatformVersion", adventurePlatformVersion)
}
}
}
}

def shadePath = "to.itsme.itsmyconfig.shade."
shadowJar {
relocate("com.tcoded.folialib", "${shadePath}folialib")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package to.itsme.itsmyconfig.util;

class BuildParameters {

public static final String ADVENTURE_VERSION = "{# @pebvariable name="adventureVersion" type="" #}{{ adventureVersion }}";
public static final String ADVENTURE_PLATFORM_VERSION = "{# @pebvariable name="adventurePlatformVersion" type="" #}{{ adventurePlatformVersion }}";

}
6 changes: 3 additions & 3 deletions src/main/java/to/itsme/itsmyconfig/util/LibraryLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public enum LibraryLoader {
ADVENTURE(
"net.kyori",
"adventure-text-minimessage",
"4.17.0",
BuildParameters.ADVENTURE_VERSION,
() -> !Reflections.findClass("net.kyori.adventure.text.Component")
),
// ========================================================= //
Expand All @@ -27,15 +27,15 @@ public enum LibraryLoader {
ADVENTURE_PLATFORM(
"net.kyori",
"adventure-platform-bukkit",
"4.3.4",
BuildParameters.ADVENTURE_PLATFORM_VERSION,
() -> !Audience.class.isAssignableFrom(CommandSender.class)
),
// ========================================================= //
// Adventure Components & MiniMessage //
ADVENTURE_BUNGEE_SERIALIZER(
"net.kyori",
"adventure-text-serializer-bungeecord",
"4.3.4",
BuildParameters.ADVENTURE_PLATFORM_VERSION,
() -> !Reflections.findClass("net.kyori.adventure.text.serializer.bungeecord")
)
// ========================================================= //
Expand Down

0 comments on commit 383bf5e

Please sign in to comment.