Skip to content

Commit

Permalink
Dependency updates
Browse files Browse the repository at this point in the history
### What's done:
* Update gradle to 7.2
* Enable version catalog, add libs.versions.toml
* Update kotlin and other dependencies
* Fix build
  • Loading branch information
petertrr committed Aug 28, 2021
1 parent 98dc28a commit db3ec4f
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 29 deletions.
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ repositories {
}

dependencies {
implementation(kotlin("gradle-plugin", "1.5.21"))
implementation(kotlin("gradle-plugin", "1.5.30"))
}
9 changes: 0 additions & 9 deletions buildSrc/src/main/kotlin/Versions.kt

This file was deleted.

4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/code-coverage.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tasks.named<Test>("test") {
tasks.named<JacocoReport>("jacocoTestReport") {
dependsOn(tasks.named<Test>("test"))
reports {
xml.isEnabled = true
html.isEnabled = true
xml.required.set(true)
html.required.set(true)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@ import org.gradle.kotlin.dsl.dependencies
import org.gradle.kotlin.dsl.kotlin
import org.gradle.kotlin.dsl.version
import org.gradle.kotlin.dsl.withType
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompile

plugins {
kotlin("jvm")
}

dependencies {
testImplementation(kotlin("test-junit5"))
testImplementation("org.junit.jupiter:junit-jupiter-api:${Versions.junit}")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${Versions.junit}")
val junit = "5.7.2"
testImplementation("org.junit.jupiter:junit-jupiter-api:$junit")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junit")
}

tasks.withType<KotlinCompile<*>>().configureEach {
tasks.withType<KotlinJvmCompile>().configureEach {
kotlinOptions.jvmTarget = "14"
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
}

Expand Down
24 changes: 24 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[versions]
kotlin = "1.5.30"
kotlinx-coroutines = "1.5.1"
junit = "5.7.2"
mockito = "3.11.2"
discord4j = "3.1.5"
reactor = "1.1.4"
slf4j = "1.7.30"
logback = "1.2.3"

[plugins]
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }

[libraries]
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-reactor = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-reactor", version.ref = "kotlinx-coroutines" }
mockito-core = { module = "org.mockito:mockito-core", version.ref = "mockito" }
mockito-junit-jupiter = { module = "org.mockito:mockito-junit-jupiter", version.ref = "mockito" }
microutils-logging = { module = "io.github.microutils:kotlin-logging", version = "2.0.11" }
reactor-kotlin-extensions = { module = "io.projectreactor.kotlin:reactor-kotlin-extensions", version.ref = "reactor" }
discord4j-core = { module = "com.discord4j:discord4j-core", version.ref = "discord4j" }
logback-core = { module = "ch.qos.logback:logback-core", version.ref = "logback" }
logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "logback" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 2 additions & 2 deletions initiative-bot-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ plugins {
}

dependencies {
testImplementation("org.mockito:mockito-core:${Versions.mockito}")
testImplementation("org.mockito:mockito-junit-jupiter:${Versions.mockito}")
testImplementation(libs.mockito.core)
testImplementation(libs.mockito.junit.jupiter)
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CommandParserTest {
"round" to Round,
"roll +2" to Roll(defaultName, 2),
"roll +2 Tom" to Roll("Tom", 2),
"next" to Countdown(60),
"next" to Countdown(45),
).forEach { (rawCommand, expectedCommand) ->
Assertions.assertEquals(expectedCommand, Command.parse(rawCommand, defaultName, defaultRoundDuration))
}
Expand Down
18 changes: 9 additions & 9 deletions initiative-bot-discord/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ plugins {
}

dependencies {
implementation(project(":initiative-bot-core"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.coroutines}")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor:${Versions.coroutines}")
implementation("io.projectreactor.kotlin:reactor-kotlin-extensions:1.1.3")
implementation("com.discord4j:discord4j-core:${Versions.discord4j}")
implementation("io.github.microutils:kotlin-logging:2.0.8")
implementation("ch.qos.logback:logback-core:${Versions.logback}")
runtimeOnly("ch.qos.logback:logback-classic:${Versions.logback}")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:${Versions.coroutines}")
implementation(projects.initiativeBotCore)
implementation(libs.kotlinx.coroutines.core)
implementation(libs.kotlinx.coroutines.reactor)
implementation(libs.reactor.kotlin.extensions)
implementation(libs.discord4j.core)
implementation(libs.microutils.logging)
implementation(libs.logback.core)
implementation(libs.logback.classic)
testImplementation(libs.kotlinx.coroutines.test)
}

application {
Expand Down
2 changes: 2 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
rootProject.name = "initiative-bot"
enableFeaturePreview("VERSION_CATALOGS")
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

include("initiative-bot-core")
include("initiative-bot-discord")

0 comments on commit db3ec4f

Please sign in to comment.