Use Gradle's dependency catalogue feature (#3305)

Move all of our dependencies to a single catalogue file to make maintenance of them easier.
This commit is contained in:
SupremeMortal 2022-09-26 16:43:17 +01:00 committed by GitHub
parent 2c5c72f85f
commit e491cf8a17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 134 additions and 101 deletions

View file

@ -1,45 +0,0 @@
/*
* Copyright (c) 2019-2022 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @author GeyserMC
* @link https://github.com/GeyserMC/Geyser
*/
object Versions {
const val jacksonVersion = "2.13.2"
const val fastutilVersion = "8.5.2"
const val nettyVersion = "4.1.80.Final"
const val guavaVersion = "29.0-jre"
const val gsonVersion = "2.3.1" // Provided by Spigot 1.8.8
const val websocketVersion = "1.5.1"
const val protocolVersion = "fed46166"
const val raknetVersion = "1.6.28-20220125.214016-6"
const val mcauthlibVersion = "d9d773e"
const val mcprotocollibversion = "9f78bd5"
const val packetlibVersion = "3.0"
const val adventureVersion = "4.12.0-20220629.025215-9"
const val adventurePlatformVersion = "4.1.2"
const val junitVersion = "4.13.1"
const val checkerQualVersion = "3.19.0"
const val cumulusVersion = "1.1.1"
const val eventsVersion = "1.0-SNAPSHOT"
const val log4jVersion = "2.17.1"
}

View file

@ -25,7 +25,9 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.Project
import org.gradle.api.artifacts.MinimalExternalModuleDependency
import org.gradle.api.artifacts.ProjectDependency
import org.gradle.api.provider.Provider
import org.gradle.kotlin.dsl.named
fun Project.isSnapshot(): Boolean =
@ -64,5 +66,11 @@ fun Project.provided(pattern: String, name: String, version: String, excludedOn:
fun Project.provided(dependency: ProjectDependency) =
provided(dependency.group!!, dependency.name, dependency.version!!)
fun Project.provided(dependency: MinimalExternalModuleDependency) =
provided(dependency.module.group, dependency.module.name, dependency.versionConstraint.requiredVersion)
fun Project.provided(provider: Provider<MinimalExternalModuleDependency>) =
provided(provider.get())
private fun calcExclusion(section: String, bit: Int, excludedOn: Int): String =
if (excludedOn and bit > 0) section else ""

View file

@ -4,7 +4,7 @@ plugins {
}
dependencies {
compileOnly("org.checkerframework", "checker-qual", Versions.checkerQualVersion)
compileOnly("org.checkerframework", "checker-qual", "3.19.0")
}
tasks {