Skip to content

Commit d15ac8c

Browse files
committed
move dependencies to libs.versions.toml
1 parent 8408a3e commit d15ac8c

File tree

8 files changed

+49
-17
lines changed

8 files changed

+49
-17
lines changed

buildSrc/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ plugins {
55
repositories {
66
gradlePluginPortal()
77
}
8+
9+
dependencies {
10+
compileOnly(files(libs::class.java.protectionDomain.codeSource.location))
11+
}

buildSrc/settings.gradle.kts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
dependencyResolutionManagement {
2+
versionCatalogs {
3+
register("libs") {
4+
from(files("../gradle/libs.versions.toml")) // include from parent project
5+
}
6+
}
7+
}

buildSrc/src/main/kotlin/net.megavex.scoreboardlibrary.base-conventions.gradle.kts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,23 @@ plugins {
66
`java-library`
77
}
88

9+
// expose version catalog
10+
val libs = extensions.getByType(org.gradle.accessors.dm.LibrariesForLibs::class)
11+
912
repositories {
1013
mavenCentral()
1114
maven("https://oss.sonatype.org/content/repositories/snapshots")
1215
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
1316
}
1417

1518
dependencies {
16-
compileOnly("org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT")
17-
testImplementation("org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT")
18-
19-
val adventureVersion = "4.16.0"
20-
compileOnly("net.kyori:adventure-api:$adventureVersion")
21-
compileOnly("net.kyori:adventure-text-serializer-legacy:$adventureVersion")
22-
compileOnly("net.kyori:adventure-text-serializer-gson:$adventureVersion")
23-
testImplementation("net.kyori:adventure-api:$adventureVersion")
19+
compileOnly(libs.spigotApi)
20+
compileOnly(libs.bundles.adventure)
2421

25-
val jupiterVersion = "5.10.2"
26-
testImplementation("org.junit.jupiter:junit-jupiter-api:$jupiterVersion")
27-
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$jupiterVersion")
22+
testImplementation(libs.spigotApi)
23+
testImplementation(libs.bundles.adventure)
24+
testImplementation(libs.junitJupiterApi)
25+
testRuntimeOnly(libs.junitJupiterEngine)
2826
}
2927

3028
tasks.withType<JavaCompile>().configureEach {

extra-kotlin/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
33
plugins {
44
id("net.megavex.scoreboardlibrary.base-conventions")
55
id("net.megavex.scoreboardlibrary.publish-conventions")
6-
kotlin("jvm") version "1.9.23"
6+
alias(libs.plugins.kotlin)
77
}
88

99
kotlin {

gradle/libs.versions.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[versions]
2+
adventure = "4.16.0"
3+
junitJupiter = "5.10.2"
4+
devBundle = "1.20.4-R0.1-SNAPSHOT" # modern packet adapter
5+
6+
[libraries]
7+
spigotApi = "org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT" # do not update
8+
onePointEightPointEightNms = "org.github.spigot:1.8.8:1.8.8"
9+
packetEvents = "com.github.retrooper.packetevents:spigot:2.2.1"
10+
11+
adventureApi = { module = "net.kyori:adventure-api", version.ref = "adventure" }
12+
adventureTextSerializerGson = { module = "net.kyori:adventure-text-serializer-gson", version.ref = "adventure" }
13+
adventureTextSerializerLegacy = { module = "net.kyori:adventure-text-serializer-legacy", version.ref = "adventure" }
14+
15+
junitJupiterApi = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junitJupiter" }
16+
junitJupiterEngine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junitJupiter" }
17+
18+
[plugins]
19+
kotlin = "org.jetbrains.kotlin.jvm:1.9.23"
20+
paperweight = "io.papermc.paperweight.userdev:1.5.12"
21+
22+
[bundles]
23+
adventure = [ "adventureApi", "adventureTextSerializerGson", "adventureTextSerializerLegacy" ]

versions/modern/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
plugins {
22
`maven-publish`
33
id("net.megavex.scoreboardlibrary.base-conventions")
4-
id("io.papermc.paperweight.userdev") version "1.5.11"
4+
alias(libs.plugins.paperweight)
55
}
66

77
dependencies {
88
compileOnly(project(":scoreboard-library-packet-adapter-base"))
9-
paperweight.paperDevBundle("1.20.4-R0.1-SNAPSHOT")
9+
paperweight.paperDevBundle(libs.versions.devBundle.get())
1010
}
1111

1212
tasks {

versions/packetevents/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ repositories {
99

1010
dependencies {
1111
compileOnly(project(":scoreboard-library-packet-adapter-base"))
12-
compileOnly("com.github.retrooper.packetevents:spigot:2.2.1")
12+
compileOnly(libs.packetEvents)
1313
}

versions/v1_8_R3/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ repositories {
99

1010
dependencies {
1111
compileOnly(project(":scoreboard-library-packet-adapter-base"))
12-
compileOnly("org.github.spigot:1.8.8:1.8.8")
13-
testImplementation("org.github.spigot:1.8.8:1.8.8")
12+
compileOnly(libs.onePointEightPointEightNms)
13+
testImplementation(libs.onePointEightPointEightNms)
1414
}

0 commit comments

Comments
 (0)