Repository: Kotlin/kotlinx-io (kotlin)

Issue:
Use Gradle versions catalog to manage dependencies
Currently, dependency versions are specified ad hoc, which may lead to incorrect/inconsistent versions among different modules (see 
Having all dependencies and their versions specified in a single place would be nice, and Gradle version catalogs provide such functionality.

Pull request description:
Fixes https://github.com/Kotlin/kotlinx-io/issues/180

Patch:
diff --git a/benchmarks/build.gradle.kts b/benchmarks/build.gradle.kts
index 62659ed45..dc713c91d 100644
--- a/benchmarks/build.gradle.kts
+++ b/benchmarks/build.gradle.kts
@@ -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 {
@@ -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)
             }
         }
 
@@ -43,7 +42,7 @@ benchmark {
     targets {
         register("jvm") {
             this as JvmBenchmarkTarget
-            jmhVersion = "1.36"
+            jmhVersion = libs.versions.jmh.get()
         }
         register("native")
     }
diff --git a/build.gradle.kts b/build.gradle.kts
index a759a940b..0b2367485 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -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 {
@@ -77,4 +77,4 @@ subprojects {
 
 apiValidation {
     ignoredProjects.add("kotlinx-io-benchmarks")
-}
\ No newline at end of file
+}
diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts
index 699c35fe8..53ac73b2e 100644
--- a/buildSrc/build.gradle.kts
+++ b/buildSrc/build.gradle.kts
@@ -12,5 +12,5 @@ repositories {
 }
 
 dependencies {
-  implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.21")
+  implementation(libs.kotlin.gradle.plugin)
 }
diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts
new file mode 100644
index 000000000..785b51e5b
--- /dev/null
+++ b/buildSrc/settings.gradle.kts
@@ -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"))
+        }
+    }
+}
diff --git a/core/build.gradle.kts b/core/build.gradle.kts
index 9dac96609..8a1ce84b7 100644
--- a/core/build.gradle.kts
+++ b/core/build.gradle.kts
@@ -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 {
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
new file mode 100644
index 000000000..2d7833c14
--- /dev/null
+++ b/gradle/libs.versions.toml
@@ -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"}


Test patch:
diff --git a/bytestring/build.gradle.kts b/bytestring/build.gradle.kts
index c0be1e677..b58a57412 100644
--- a/bytestring/build.gradle.kts
+++ b/bytestring/build.gradle.kts
@@ -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 {