Chores & Migrate to libs.versions.toml (#243)

* update dependenices & workflows

* Migrate to libs.versions.toml
This commit is contained in:
蛟龙 2025-02-11 17:26:19 +08:00 committed by GitHub
parent cd73603e3f
commit a1a7285df0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 89 additions and 41 deletions

View File

@ -14,18 +14,13 @@ jobs:
steps: steps:
- name: Checkout Repository - name: Checkout Repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Cache Gradle Packages
uses: actions/cache@v4
with:
key: ${{ runner.os }}-Build-Cache
path: |
~/.gradle/caches
~/.gradle/wrapper
- name: Setup Java - name: Setup Java
uses: actions/setup-java@v4 uses: actions/setup-java@v4
with: with:
distribution: temurin
java-version: 21 java-version: 21
distribution: temurin
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Make Gradle Wrapper Executable - name: Make Gradle Wrapper Executable
run: chmod +x ./gradlew run: chmod +x ./gradlew
- name: Build - name: Build

View File

View File

@ -37,57 +37,57 @@ repositories {
dependencies { dependencies {
// Spigot API, https://www.spigotmc.org/ // Spigot API, https://www.spigotmc.org/
compileOnly("org.spigotmc:spigot-api:1.20.6-R0.1-SNAPSHOT") compileOnly("org.spigotmc:spigot-api:1.20.6-R0.1-SNAPSHOT")
// Adventure API
implementation(libs.adventure.text.minimessage)
implementation(libs.adventure.platform.bukkit)
implementation(libs.adventure.text.serializer.gson)
// Java Libraries // Java Libraries
compileOnly("org.geysermc.floodgate:api:2.2.2-SNAPSHOT") compileOnly("org.geysermc.floodgate:api:2.2.2-SNAPSHOT")
// Jalu Injector // Jalu Injector
implementation("ch.jalu:injector:1.0") implementation(libs.injector)
// String comparison library. Used for dynamic help system. // String comparison library. Used for dynamic help system.
implementation("net.ricecode:string-similarity:1.0.0") implementation(libs.string.similarity)
// MaxMind GEO IP with our modifications to use GSON in replacement of the big Jackson dependency // MaxMind GEO IP with our modifications to use GSON in replacement of the big Jackson dependency
// GSON is already included and therefore it reduces the file size in comparison to the original version // GSON is already included and therefore it reduces the file size in comparison to the original version
implementation("com.maxmind.db:maxmind-db-gson:2.0.3") { implementation(libs.maxmind.db.gson) {
exclude("com.google.code.gson", "gson") exclude("com.google.code.gson", "gson")
} }
// Library for tar archives // Library for tar archives
implementation("javatar:javatar:2.5") implementation(libs.javatar)
// Java Email Library // Java Email Library
implementation("org.apache.commons:commons-email:1.6-SNAPSHOT") implementation(libs.commons.email)
// Log4J Logger (required by the console filter) // Log4J Logger (required by the console filter)
compileOnly("org.apache.logging.log4j:log4j-core:2.20.0") // Log4J version bundled in 1.12.2 compileOnly(libs.log4j.core) // Log4J version bundled in 1.12.2
// Libby // Libby
implementation("com.alessiodp.libby:libby-bukkit:2.0.0-SNAPSHOT") implementation(libs.libby.bukkit)
// Database Connection Pool // Database Connection Pool
implementation("com.zaxxer:HikariCP:4.0.3" /* Latest java 8 release */) { implementation(libs.hikaricp) {
exclude("org.slf4j", "slf4j-api") exclude("org.slf4j", "slf4j-api")
} }
// HikariCP Logger // HikariCP Logger
implementation("org.slf4j:slf4j-simple:1.7.36") // We can't update to 2.x as long as we use HikariCP for java 8 implementation(libs.slf4j.simple) // We can't update to 2.x as long as we use HikariCP for java 8
// PBKDF2 implementation // PBKDF2 implementation
implementation("de.rtner:PBKDF2:1.1.4") implementation(libs.pbkdf2)
// MySQL connector, shaded into the legacy jar // MySQL connector, shaded into the legacy jar
implementation("com.mysql:mysql-connector-j:8.4.0") implementation(libs.mysql.connector.j)
implementation("org.mariadb.jdbc:mariadb-java-client:3.3.3") implementation(libs.mariadb.java.client)
// Argon2 implementation // Argon2 implementation
implementation("de.mkammerer:argon2-jvm-nolibs:2.11") implementation(libs.argon2.jvm.nolibs)
// TOTP client // TOTP client
implementation("com.warrenstrange:googleauth:1.5.0") implementation(libs.googleauth)
// Keep in sync with spigot 1.19 // Keep in sync with spigot 1.19
implementation("com.google.guava:guava:33.2.1-jre") { implementation(libs.guava) {
exclude("org.checkerframework", "checker-qual") exclude("org.checkerframework", "checker-qual")
} }
implementation("com.google.code.gson:gson:2.10.1") implementation(libs.gson)
// ConfigMe // ConfigMe
implementation("ch.jalu:configme:1.3.1") { implementation(libs.configme) {
exclude("org.yaml", "snakeyaml") exclude("org.yaml", "snakeyaml")
} }
// bStats metrics // bStats metrics
implementation("org.bstats:bstats-bukkit:3.0.2") implementation("org.bstats:bstats-bukkit:3.0.2")
// ProtocolLib // ProtocolLib
compileOnly("com.comphenix.protocol:ProtocolLib:5.1.0") compileOnly("com.comphenix.protocol:ProtocolLib:5.3.0")
// Adventure API
implementation("net.kyori:adventure-text-minimessage:4.17.0")
implementation("net.kyori:adventure-platform-bukkit:4.3.2")
implementation("net.kyori:adventure-text-serializer-gson:4.17.0")
// LuckPerms plugin // LuckPerms plugin
compileOnly("net.luckperms:api:5.4") compileOnly("net.luckperms:api:5.4")
// PermissionsEx plugin // PermissionsEx plugin
@ -105,22 +105,22 @@ dependencies {
exclude("io.papermc", "paperlib") exclude("io.papermc", "paperlib")
} }
// BCrypt implementation // BCrypt implementation
implementation("at.favre.lib:bcrypt:0.10.2") implementation(libs.bcrypt)
// PlaceholderAPI // PlaceholderAPI
compileOnly("me.clip:placeholderapi:2.11.6") compileOnly("me.clip:placeholderapi:2.11.6")
// XAuth, another authentication plugin, required by the database converter // XAuth, another authentication plugin, required by the database converter
compileOnly("de.luricos.bukkit:xAuth:2.6.1-SNAPSHOT") compileOnly("de.luricos.bukkit:xAuth:2.6.1-SNAPSHOT")
implementation("ch.jalu:datasourcecolumns:0.1.1-SNAPSHOT") implementation(libs.datasourcecolumns)
implementation("org.postgresql:postgresql:42.7.3") { implementation(libs.postgresql) {
exclude("org.checkerframework", "checker-qual") exclude("org.checkerframework", "checker-qual")
} }
// Required to mock the LuckPerms API // Required to mock the LuckPerms API
testImplementation("org.checkerframework:checker-qual:3.48.0") testImplementation(libs.checker.qual)
// Universal Scheduler // Universal Scheduler
implementation("com.github.Anon8281:UniversalScheduler:0.1.6") implementation(libs.universalscheduler)
// JDBC drivers for datasource integration tests // JDBC drivers for datasource integration tests
testImplementation("org.xerial:sqlite-jdbc:3.47.1.0") testImplementation(libs.sqlite.jdbc)
compileOnly("com.h2database:h2:2.2.224") compileOnly(libs.h2)
} }
tasks { tasks {
@ -169,10 +169,7 @@ tasks {
// bStats metrics class // bStats metrics class
relocate("org.bstats", "fr.xephi.authme.libs.org.bstats") relocate("org.bstats", "fr.xephi.authme.libs.org.bstats")
relocate("org.mariadb.jdbc", "fr.xephi.authme.libs.org.mariadb.jdbc") relocate("org.mariadb.jdbc", "fr.xephi.authme.libs.org.mariadb.jdbc")
relocate( relocate("com.github.Anon8281.universalScheduler", "fr.xephi.authme.libs.com.github.Anon8281.universalScheduler")
"com.github.Anon8281.universalScheduler",
"fr.xephi.authme.libs.com.github.Anon8281.universalScheduler"
)
relocate("com.mysql", "fr.xephi.authme.libs.com.mysql") relocate("com.mysql", "fr.xephi.authme.libs.com.mysql")
relocate("com.google.protobuf", "fr.xephi.authme.libs.com.google.protobuf") relocate("com.google.protobuf", "fr.xephi.authme.libs.com.google.protobuf")
relocate("io.netty", "fr.xephi.authme.libs.io.netty") relocate("io.netty", "fr.xephi.authme.libs.io.netty")

56
gradle/libs.versions.toml Normal file
View File

@ -0,0 +1,56 @@
[versions]
adventureApi = "4.18.0"
adventurePlatform = "4.3.4"
injector = "1.0"
string-similarity = "1.0.0"
maxmind-db-gson = "2.0.3"
javatar = "2.5"
commons-email = "1.6-SNAPSHOT"
log4j-core = "2.20.0"
libby-bukkit = "2.0.0-SNAPSHOT"
hikaricp = "4.0.3"
slf4j-simple = "1.7.36"
pbkdf2 = "1.1.4"
mysql-connector-j = "9.1.0"
mariadb-java-client = "3.5.1"
argon2-jvm-nolibs = "2.11"
googleauth = "1.5.0"
guava = "33.2.1-jre"
gson = "2.10.1"
configme = "1.3.1"
bcrypt = "0.10.2"
datasourcecolumns = "0.1.1-SNAPSHOT"
postgresql = "42.7.4"
checker-qual = "3.48.0"
universalscheduler = "0.1.6"
sqlite-jdbc = "3.47.1.0"
h2 = "2.2.224"
[libraries]
adventure-text-minimessage = { group = "net.kyori", name = "adventure-text-minimessage", version.ref = "adventureApi" }
adventure-platform-bukkit = { group = "net.kyori", name = "adventure-platform-bukkit", version.ref = "adventurePlatform" }
adventure-text-serializer-gson = { group = "net.kyori", name = "adventure-text-serializer-gson", version.ref = "adventureApi" }
injector = { group = "ch.jalu", name = "injector", version.ref = "injector" }
string-similarity = { group = "net.ricecode", name = "string-similarity", version.ref = "string-similarity" }
maxmind-db-gson = { group = "com.maxmind.db", name = "maxmind-db-gson", version.ref = "maxmind-db-gson" }
javatar = { group = "javatar", name = "javatar", version.ref = "javatar" }
commons-email = { group = "org.apache.commons", name = "commons-email", version.ref = "commons-email" }
log4j-core = { group = "org.apache.logging.log4j", name = "log4j-core", version.ref = "log4j-core" }
libby-bukkit = { group = "com.alessiodp.libby", name = "libby-bukkit", version.ref = "libby-bukkit" }
hikaricp = { group = "com.zaxxer", name = "HikariCP", version.ref = "hikaricp" }
slf4j-simple = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4j-simple" }
pbkdf2 = { group = "de.rtner", name = "PBKDF2", version.ref = "pbkdf2" }
mysql-connector-j = { group = "com.mysql", name = "mysql-connector-j", version.ref = "mysql-connector-j" }
mariadb-java-client = { group = "org.mariadb.jdbc", name = "mariadb-java-client", version.ref = "mariadb-java-client" }
argon2-jvm-nolibs = { group = "de.mkammerer", name = "argon2-jvm-nolibs", version.ref = "argon2-jvm-nolibs" }
googleauth = { group = "com.warrenstrange", name = "googleauth", version.ref = "googleauth" }
guava = { group = "com.google.guava", name = "guava", version.ref = "guava" }
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
configme = { group = "ch.jalu", name = "configme", version.ref = "configme" }
bcrypt = { group = "at.favre.lib", name = "bcrypt", version.ref = "bcrypt" }
datasourcecolumns = { group = "ch.jalu", name = "datasourcecolumns", version.ref = "datasourcecolumns" }
postgresql = { group = "org.postgresql", name = "postgresql", version.ref = "postgresql" }
checker-qual = { group = "org.checkerframework", name = "checker-qual", version.ref = "checker-qual" }
universalscheduler = { group = "com.github.Anon8281", name = "UniversalScheduler", version.ref = "universalscheduler" }
sqlite-jdbc = { group = "org.xerial", name = "sqlite-jdbc", version.ref = "sqlite-jdbc" }
h2 = { group = "com.h2database", name = "h2", version.ref = "h2" }