Skip to content

Commit

Permalink
Store versions in version catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
duncte123 committed Nov 30, 2023
1 parent 21ffd33 commit 1512429
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 17 deletions.
32 changes: 16 additions & 16 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ plugins {
java
`java-library`
`maven-publish`
kotlin("jvm") version "1.9.21"
kotlin("plugin.serialization") version "1.9.21"
id("org.jetbrains.dokka") version "1.9.10"
id("org.ajoberstar.grgit") version "5.2.0"
id("com.vanniktech.maven.publish.base") version "0.25.3"
kotlin("jvm") version libs.versions.kotlin
kotlin("plugin.serialization") version libs.versions.kotlin
id("org.jetbrains.dokka") version libs.versions.dokka
id("org.ajoberstar.grgit") version libs.versions.grgit
id("com.vanniktech.maven.publish.base") version libs.versions.maven.publish
}

val (gitVersion, release) = versionFromGit()
Expand All @@ -42,21 +42,21 @@ repositories {
dependencies {
// package libraries
api(kotlin("stdlib"))
api("dev.arbjerg.lavalink:protocol:47201924be7d5a459753fc85f00ca30e49ba3cd1-SNAPSHOT")
api("com.squareup.okhttp3:okhttp:4.10.0")
api("io.projectreactor:reactor-core:3.5.6")
api("io.projectreactor.kotlin:reactor-kotlin-extensions:1.2.2")
api("org.slf4j:slf4j-api:2.0.7")
api(libs.kotlin)
api(libs.lavalink.protocol)
api(libs.okhttp)
api(libs.bundles.reactor)
api(libs.logger.api)

// Discord library support
compileOnly("net.dv8tion:JDA:5.0.0-beta.11")
compileOnly("com.discord4j:discord4j-core:3.2.3")
compileOnly(libs.jda)
compileOnly(libs.d4j)

testImplementation(kotlin("test"))
testImplementation("net.dv8tion:JDA:5.0.0-beta.11")
testImplementation("com.discord4j:discord4j-core:3.2.3")
testImplementation("org.slf4j:slf4j-simple:2.0.7")
testImplementation("com.github.topi314.lavasearch:lavasearch-protocol:1.0.0-beta.2")
testImplementation(libs.jda)
testImplementation(libs.d4j)
testImplementation(libs.logger.impl)
testImplementation(libs.lavasearch)
}

val sourcesForRelease = task<Copy>("sourcesForRelease") {
Expand Down
44 changes: 43 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@

rootProject.name = "lavalink-client"

enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

dependencyResolutionManagement {
versionCatalogs {
create("libs") {
versionRefs()
common()
discordLibs()
testLibs()
}
}
}

fun VersionCatalogBuilder.versionRefs() {
version("kotlin", "1.9.21")
version("dokka", "1.9.10")
version("grgit", "5.2.0")
version("maven-publish", "0.25.3")

version("logger", "2.0.7")
}

fun VersionCatalogBuilder.common() {
library("kotlin", "org.jetbrains.kotlin", "kotlin-stdlib").versionRef("kotlin")
library("lavalink-protocol", "dev.arbjerg.lavalink", "protocol").version("47201924be7d5a459753fc85f00ca30e49ba3cd1-SNAPSHOT")
library("okhttp", "com.squareup.okhttp3", "okhttp").version("4.10.0")
library("reactor-core", "io.projectreactor", "reactor-core").version("3.5.6")
library("reactor-kotlin", "io.projectreactor.kotlin", "reactor-kotlin-extensions").version("1.2.2")

bundle("reactor", listOf("reactor-core", "reactor-kotlin"))

library("logger-api", "org.slf4j", "slf4j-api").versionRef("logger")
}

fun VersionCatalogBuilder.discordLibs() {
library("jda", "net.dv8tion", "JDA").version("5.0.0-beta.11")
library("d4j", "com.discord4j", "discord4j-core").version("3.2.3")
}

fun VersionCatalogBuilder.testLibs() {
library("logger-impl", "org.slf4j", "slf4j-simple").versionRef("logger")
library("lavasearch", "com.github.topi314.lavasearch", "lavasearch-protocol").version("1.0.0-beta.2")
}

0 comments on commit 1512429

Please sign in to comment.