Skip to content

Commit

Permalink
Use Gradle version catalogs (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
twyatt authored Dec 2, 2021
1 parent 4102a0b commit 56a59f1
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 57 deletions.
18 changes: 8 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL

buildscript {
repositories {
mavenCentral()
}
}

plugins {
kotlin("multiplatform") version "1.5.10" apply false
kotlin("js") version "1.5.10" apply false
kotlin("plugin.serialization") version "1.5.10" apply false
id("org.jmailen.kotlinter") version "3.2.0" apply false
id("com.vanniktech.maven.publish") version "0.14.0" apply false
id("org.jetbrains.dokka") version "1.4.32"
id("binary-compatibility-validator") version "0.6.0"
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.kotlin.js) apply false
alias(libs.plugins.kotlinx.serialization) apply false
alias(libs.plugins.kotlinter) apply false
alias(libs.plugins.maven.publish) apply false
alias(libs.plugins.dokka)
alias(libs.plugins.binary.compatibility.validator)
}

allprojects {
Expand All @@ -25,7 +23,7 @@ allprojects {
tasks.withType<Test>().configureEach {
testLogging {
events("started", "passed", "skipped", "failed", "standardOut", "standardError")
exceptionFormat = FULL
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
showExceptions = true
showStackTraces = true
showCauses = true
Expand Down
7 changes: 0 additions & 7 deletions buildSrc/build.gradle.kts

This file was deleted.

31 changes: 0 additions & 31 deletions buildSrc/src/main/kotlin/Dependencies.kt

This file was deleted.

21 changes: 21 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[versions]
kotlin = "1.5.10"
okio = "3.0.0-alpha.6"
jacoco = "0.8.7"

[libraries]
kotlinx-coroutines-js = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core-js", version = "1.4.2" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version = "1.0.1" }
okio-multiplatform = { module = "com.squareup.okio:okio-multiplatform", version.ref = "okio" }
okio-js = { module = "com.squareup.okio:okio-js", version.ref = "okio" }
mockk = { module = "io.mockk:mockk", version = "1.10.0" }
equalsverifier = { module = "nl.jqno.equalsverifier:equalsverifier", version = "3.4" }

[plugins]
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-js = { id = "org.jetbrains.kotlin.js", version.ref = "kotlin" }
kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
kotlinter = { id = "org.jmailen.kotlinter", version = "3.2.0" }
maven-publish = { id = "com.vanniktech.maven.publish", version = "0.14.0" }
dokka = { id = "org.jetbrains.dokka", version = "1.4.32" }
binary-compatibility-validator = { id = "binary-compatibility-validator", version = "0.6.0" }
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-6.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
8 changes: 4 additions & 4 deletions koap/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ plugins {
apply(from = rootProject.file("gradle/jacoco.gradle.kts"))

jacoco {
toolVersion = "0.8.7"
toolVersion = libs.versions.jacoco.get()
}

kotlin {
Expand All @@ -20,7 +20,7 @@ kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation(square("okio-multiplatform"))
implementation(libs.okio.multiplatform)
}
}

Expand All @@ -40,8 +40,8 @@ kotlin {
val jvmTest by getting {
dependencies {
implementation(kotlin("test-junit"))
implementation(mockk())
implementation(equalsverifier())
implementation(libs.mockk)
implementation(libs.equalsverifier)
}
}

Expand Down
4 changes: 3 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
enableFeaturePreview("VERSION_CATALOGS")

pluginManagement {
repositories {
gradlePluginPortal()
Expand All @@ -15,5 +17,5 @@ pluginManagement {

include(
":koap",
":webapp"
":webapp",
)
6 changes: 3 additions & 3 deletions webapp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ kotlin {
val main by getting {
dependencies {
implementation(project(":koap"))
implementation(kotlinx("coroutines-core-js"))
implementation(kotlinx("serialization-json"))
implementation(square("okio-js"))
implementation(libs.kotlinx.coroutines.js)
implementation(libs.kotlinx.serialization.json)
implementation(libs.okio.js)
implementation(npm("cbor", "6.0.1"))
}
}
Expand Down

0 comments on commit 56a59f1

Please sign in to comment.