Skip to content

Commit 16044bb

Browse files
committed
build: Use version catalogs
1 parent cbe62f5 commit 16044bb

File tree

6 files changed

+44
-25
lines changed

6 files changed

+44
-25
lines changed

build.gradle.kts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import net.kyori.indra.gradle.IndraPluginPublishingExtension
66
import net.kyori.indra.licenser.spotless.IndraSpotlessLicenserExtension
77

88
plugins {
9-
id("com.gradle.plugin-publish") apply false
10-
id("net.kyori.indra") apply false
11-
id("com.diffplug.spotless") apply false
12-
id("net.kyori.indra.crossdoc") apply false
13-
id("net.kyori.indra.licenser.spotless") apply false
14-
id("net.kyori.indra.publishing.gradle-plugin") apply false
9+
alias(libs.plugins.gradlePluginPublish) apply false
10+
alias(libs.plugins.indra) apply false
11+
alias(libs.plugins.spotless) apply false
12+
alias(libs.plugins.indra.crossdoc) apply false
13+
alias(libs.plugins.indra.licenserSpotless) apply false
14+
alias(libs.plugins.indra.gradlePlugin) apply false
1515
}
1616

1717
group = "org.spongepowered"
@@ -38,14 +38,13 @@ subprojects {
3838

3939
extensions.configure(TestingExtension::class) {
4040
suites.withType(JvmTestSuite::class).configureEach {
41-
useJUnitJupiter("5.9.0")
41+
useJUnitJupiter(rootProject.libs.versions.junit.get())
4242
}
4343

4444
val functionalTest = suites.register("functionalTest", JvmTestSuite::class) {
4545
dependencies {
4646
implementation(project)
4747
implementation(project(":spongegradle-testlib"))
48-
implementation("com.google.code.gson:gson:2.9.1")
4948
}
5049
testType.set(TestSuiteType.FUNCTIONAL_TEST)
5150
}
@@ -60,7 +59,7 @@ subprojects {
6059

6160

6261
dependencies {
63-
"compileOnlyApi"("org.jetbrains:annotations:23.0.0")
62+
"compileOnlyApi"(rootProject.libs.jetbrainsAnnotations)
6463
}
6564

6665
val indraGit = extensions.getByType(net.kyori.indra.git.IndraGitExtension::class)

convention/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ tasks.withType(GroovyCompile::class).configureEach {
99
dependencies {
1010
api(project(":spongegradle-plugin-development"))
1111
implementation(localGroovy())
12-
api("net.kyori:indra-common:3.0.0")
13-
api("net.kyori:indra-licenser-spotless:3.0.0")
14-
api("com.google.code.gson:gson:2.9.1")
12+
api(libs.indra.common)
13+
api(libs.indra.licenserSpotless)
14+
api(libs.gson)
1515
}
1616

1717
indraPluginPublishing {

gradle/libs.versions.toml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[metadata]
2+
version = "1.0"
3+
4+
[versions]
5+
indra = "3.0.0"
6+
pluginPublish = "1.0.0"
7+
spotless = "6.11.0"
8+
junit = "5.9.0"
9+
mammoth = "1.2.0"
10+
11+
[libraries]
12+
gson = { module = "com.google.code.gson:gson", version = "2.9.1" }
13+
jetbrainsAnnotations = { module = "org.jetbrains:annotations", version = "23.0.0"}
14+
mammoth = { module = "net.kyori:mammoth", version.ref = "mammoth" }
15+
mammoth-test = { module = "net.kyori:mammoth-test", version.ref = "mammoth" }
16+
17+
# convention
18+
indra-common = { module = "net.kyori:indra-common", version.ref = "indra" }
19+
indra-licenserSpotless = { module = "net.kyori:indra-licenser-spotless", version.ref = "indra" }
20+
21+
# plugin-development
22+
pluginMeta = { module = "org.spongepowered:plugin-meta", version = "0.8.0"}
23+
24+
[plugins]
25+
gradlePluginPublish = { id = "com.gradle.plugin-publish", version.ref = "pluginPublish" }
26+
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
27+
indra = { id = "net.kyori.indra", version.ref = "indra" }
28+
indra-crossdoc = { id = "net.kyori.indra.crossdoc", version.ref = "indra" }
29+
indra-gradlePlugin = { id = "net.kyori.indra.publishing.gradle-plugin", version.ref = "indra" }
30+
indra-licenserSpotless = { id = "net.kyori.indra.licenser.spotless", version.ref = "indra" }

plugin-development/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dependencies {
2-
implementation("org.spongepowered:plugin-meta:0.8.0") {
2+
implementation(libs.pluginMeta) {
33
exclude(group = "org.checkerframework", module = "checker-qual")
44
}
55
// implementation("org.spongepowered:vanillagradle:0.2-SNAPSHOT")
@@ -8,7 +8,7 @@ dependencies {
88

99
testing.suites.named("functionalTest", JvmTestSuite::class) {
1010
dependencies {
11-
implementation("com.google.code.gson:gson:2.9.1")
11+
implementation(libs.gson)
1212
}
1313
}
1414

settings.gradle.kts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,6 @@ pluginManagement {
44
name = "sponge"
55
}
66
}
7-
8-
plugins {
9-
val indraVersion = "3.0.0"
10-
id("com.gradle.plugin-publish") version "1.0.0"
11-
id("com.diffplug.spotless") version "6.11.0"
12-
id("net.kyori.indra") version indraVersion
13-
id("net.kyori.indra.crossdoc") version indraVersion
14-
id("net.kyori.indra.publishing.gradle-plugin") version indraVersion
15-
id("net.kyori.indra.licenser.spotless") version indraVersion
16-
}
177
}
188

199
dependencyResolutionManagement {

testlib/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dependencies {
2-
api("net.kyori:mammoth-test:1.2.0")
2+
api(libs.mammoth.test)
33
}
44

55
tasks.javadoc {

0 commit comments

Comments
 (0)