Skip to content

Use versions catalog to manage dependencies #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions benchmarks/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
*/

import kotlinx.benchmark.gradle.JvmBenchmarkTarget
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeCompilation
import org.jetbrains.kotlin.konan.target.HostManager
import org.jetbrains.kotlin.konan.target.KonanTarget

plugins {
kotlin("multiplatform")
id("org.jetbrains.kotlinx.benchmark") version "0.4.8"
alias(libs.plugins.kotlinx.benchmark.plugin)
}

kotlin {
Expand All @@ -25,7 +24,7 @@ kotlin {
commonMain {
dependencies {
implementation(project(":kotlinx-io-core"))
implementation("org.jetbrains.kotlinx:kotlinx-benchmark-runtime:0.4.8")
implementation(libs.kotlinx.benchmark.runtime)
}
}

Expand All @@ -43,7 +42,7 @@ benchmark {
targets {
register("jvm") {
this as JvmBenchmarkTarget
jmhVersion = "1.36"
jmhVersion = libs.versions.jmh.get()
}
register("native")
}
Expand Down
8 changes: 4 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.tasks.KotlinNativeCompile

plugins {
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.13.2"
id("org.jetbrains.dokka") version "1.8.20"
alias(libs.plugins.bcv)
alias(libs.plugins.dokka)
`maven-publish`
signing
}

buildscript {
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.21")
classpath(libs.kotlin.gradle.plugin)
}

repositories {
Expand Down Expand Up @@ -77,4 +77,4 @@ subprojects {

apiValidation {
ignoredProjects.add("kotlinx-io-benchmarks")
}
}
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ repositories {
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.21")
implementation(libs.kotlin.gradle.plugin)
}
12 changes: 12 additions & 0 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
*/

dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}
4 changes: 2 additions & 2 deletions bytestring/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet

plugins {
kotlin("multiplatform")
id("org.jetbrains.kotlinx.kover") version "0.7.1"
id("org.jetbrains.dokka") version "1.8.20"
alias(libs.plugins.kover)
alias(libs.plugins.dokka)
}

kotlin {
Expand Down
4 changes: 2 additions & 2 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet

plugins {
kotlin("multiplatform")
id("org.jetbrains.kotlinx.kover") version "0.7.1"
id("org.jetbrains.dokka") version "1.8.20"
alias(libs.plugins.kover)
alias(libs.plugins.dokka)
}

kotlin {
Expand Down
19 changes: 19 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[versions]
kotlin = "1.8.21"
dokka = "1.8.20"
kover = "0.7.1"
bcv = "0.13.2"
benchmark = "0.4.8"
jmh = "1.36"

[libraries]

kotlinx-benchmark-runtime = { group = "org.jetbrains.kotlinx", name = "kotlinx-benchmark-runtime", version.ref = "benchmark" }
kotlin-gradle-plugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" }

[plugins]

dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
bcv = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "bcv" }
kotlinx-benchmark-plugin = { id = "org.jetbrains.kotlinx.benchmark", version.ref = "benchmark"}