Skip to content

Commit

Permalink
Introduce Version Catalogs to track all dependencies centrally in `li…
Browse files Browse the repository at this point in the history
…bs.versions.toml`
  • Loading branch information
chimbori committed Jul 15, 2023
1 parent fc67fd1 commit a22f677
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 13 deletions.
24 changes: 11 additions & 13 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode.Strict
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.8.21"
id("com.github.ben-manes.versions") version "0.45.0"
id("com.vanniktech.maven.publish") version "0.24.0"
alias(libs.plugins.kotlin.jvm)
alias(libs.plugins.ben.manes.versions)
alias(libs.plugins.maven.publish)
}

repositories {
Expand All @@ -16,22 +16,20 @@ buildscript {
mavenCentral()
}
dependencies {
classpath(kotlin("gradle-plugin", version = "1.8.21"))
classpath("com.github.ben-manes:gradle-versions-plugin:0.45.0")
classpath("com.vanniktech:gradle-maven-publish-plugin:0.25.2")
classpath(libs.kotlin.plugin)
}
}

dependencies {
api("org.jsoup:jsoup:1.16.1")
api("com.squareup.okhttp3:okhttp:4.10.0")
api(libs.jsoup)
api(libs.okhttp)

implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.0")
implementation("com.beust:klaxon:5.6")
implementation(libs.coroutines.core)
implementation(libs.klaxon)

testImplementation("com.squareup.okhttp3:logging-interceptor:4.10.0")
testImplementation("com.squareup.okhttp3:mockwebserver:4.10.0")
testImplementation("junit:junit:4.13.2")
testImplementation(libs.okhttp.mockwebserver)
testImplementation(libs.okhttp.logging)
testImplementation(libs.junit)
}

configurations.all {
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"
coroutines = "1.7.2"
okhttp = "4.10.0"

[libraries]
kotlin-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
jsoup = "org.jsoup:jsoup:1.16.1"
klaxon = "com.beust:klaxon:5.6"
okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
junit = "junit:junit:4.13.2"
okhttp-logging = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttp" }
okhttp-mockwebserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "okhttp" }

[plugins]
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
ben-manes-versions = { id = "com.github.ben-manes.versions", version = "0.45.0" }
maven-publish = { id = "com.vanniktech.maven.publish", version = "0.24.0" }

0 comments on commit a22f677

Please sign in to comment.