Extract dependency versions to Versions object in buildSrc

This commit is contained in:
Michael Bull 2020-08-26 19:52:18 +01:00
parent a662ebc0a7
commit 41269f06d3
8 changed files with 33 additions and 17 deletions

View File

@ -19,7 +19,7 @@ jobs:
- uses: actions/cache@v1 - uses: actions/cache@v1
with: with:
path: ~/.gradle/caches path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle.kts') }} }} key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle.kts') }}-${{ hashFiles('buildSrc/src/main/kotlin/Versions.kt') }}
restore-keys: | restore-keys: |
${{ runner.os }}-gradle-caches- ${{ runner.os }}-gradle-caches-

View File

@ -10,13 +10,13 @@ description = "A Result monad for modelling success or failure operations."
plugins { plugins {
base base
id("com.github.ben-manes.versions") version "0.29.0" id("com.github.ben-manes.versions") version Versions.versionsPlugin
kotlin("multiplatform") version "1.4.0" apply false kotlin("multiplatform") version Versions.kotlin apply false
id("kotlinx.benchmark") version "0.2.0-dev-20" apply false id("kotlinx.benchmark") version Versions.kotlinBenchmark apply false
id("net.researchgate.release") version "2.8.1" apply false id("net.researchgate.release") version Versions.releasePlugin apply false
id("org.jetbrains.dokka") version "0.10.1" apply false id("org.jetbrains.dokka") version Versions.dokka apply false
id("org.jetbrains.kotlin.plugin.allopen") version "1.4.0" apply false id("org.jetbrains.kotlin.plugin.allopen") version Versions.kotlin apply false
} }
tasks.withType<DependencyUpdatesTask> { tasks.withType<DependencyUpdatesTask> {

View File

@ -0,0 +1,7 @@
plugins {
`kotlin-dsl`
}
repositories {
mavenCentral()
}

View File

@ -0,0 +1 @@
rootProject.name = "buildSrc"

View File

@ -0,0 +1,10 @@
object Versions {
const val dokka = "0.10.1"
const val kotlin = "1.4.0"
const val kotlinBenchmark = "0.2.0-dev-20"
const val kotlinCoroutines = "1.3.8"
const val ktor = "1.4.0"
const val logback = "1.2.3"
const val releasePlugin = "2.8.1"
const val versionsPlugin = "0.29.0"
}

View File

@ -15,14 +15,12 @@ repositories {
} }
dependencies { dependencies {
val ktorVersion = "1.4.0"
implementation(project(":kotlin-result")) implementation(project(":kotlin-result"))
implementation(kotlin("stdlib-jdk8")) implementation(kotlin("stdlib-jdk8"))
implementation("ch.qos.logback:logback-classic:1.2.3") implementation("ch.qos.logback:logback-classic:${Versions.logback}")
implementation("io.ktor:ktor-server-core:$ktorVersion") implementation("io.ktor:ktor-server-core:${Versions.ktor}")
implementation("io.ktor:ktor-server-netty:$ktorVersion") implementation("io.ktor:ktor-server-netty:${Versions.ktor}")
implementation("io.ktor:ktor-gson:$ktorVersion") implementation("io.ktor:ktor-gson:${Versions.ktor}")
} }
tasks.withType(KotlinCompile::class.java).all { tasks.withType(KotlinCompile::class.java).all {

View File

@ -16,7 +16,7 @@ kotlin {
val commonMain by getting { val commonMain by getting {
dependencies { dependencies {
implementation(kotlin("stdlib-common")) implementation(kotlin("stdlib-common"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-native:1.3.8") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-native:${Versions.kotlinCoroutines}")
implementation(project(":kotlin-result")) implementation(project(":kotlin-result"))
} }
} }
@ -25,7 +25,7 @@ kotlin {
dependencies { dependencies {
implementation(kotlin("test-common")) implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common")) implementation(kotlin("test-annotations-common"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-native:1.3.8") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-native:${Versions.kotlinCoroutines}")
} }
} }
@ -33,7 +33,7 @@ kotlin {
dependencies { dependencies {
implementation(kotlin("test-junit")) implementation(kotlin("test-junit"))
implementation(kotlin("test")) implementation(kotlin("test"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.kotlinCoroutines}")
} }
} }
} }

View File

@ -67,7 +67,7 @@ kotlin {
val jvmBenchmark by getting { val jvmBenchmark by getting {
dependsOn(jvmMain) dependsOn(jvmMain)
dependencies { dependencies {
implementation("org.jetbrains.kotlinx:kotlinx.benchmark.runtime-jvm:0.2.0-dev-8") implementation("org.jetbrains.kotlinx:kotlinx.benchmark.runtime-jvm:${Versions.kotlinBenchmark}")
} }
} }
} }