diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e031b0c..6865522 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,7 @@ jobs: - uses: actions/cache@v1 with: 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: | ${{ runner.os }}-gradle-caches- diff --git a/build.gradle.kts b/build.gradle.kts index 72ef73e..d476f0d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -10,13 +10,13 @@ description = "A Result monad for modelling success or failure operations." plugins { 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 - id("kotlinx.benchmark") version "0.2.0-dev-20" apply false - id("net.researchgate.release") version "2.8.1" apply false - id("org.jetbrains.dokka") version "0.10.1" apply false - id("org.jetbrains.kotlin.plugin.allopen") version "1.4.0" apply false + kotlin("multiplatform") version Versions.kotlin apply false + id("kotlinx.benchmark") version Versions.kotlinBenchmark apply false + id("net.researchgate.release") version Versions.releasePlugin apply false + id("org.jetbrains.dokka") version Versions.dokka apply false + id("org.jetbrains.kotlin.plugin.allopen") version Versions.kotlin apply false } tasks.withType { diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts new file mode 100644 index 0000000..876c922 --- /dev/null +++ b/buildSrc/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + `kotlin-dsl` +} + +repositories { + mavenCentral() +} diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts new file mode 100644 index 0000000..29744ec --- /dev/null +++ b/buildSrc/settings.gradle.kts @@ -0,0 +1 @@ +rootProject.name = "buildSrc" diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt new file mode 100644 index 0000000..3ad98db --- /dev/null +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -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" +} diff --git a/example/build.gradle.kts b/example/build.gradle.kts index ec21db0..442fafd 100644 --- a/example/build.gradle.kts +++ b/example/build.gradle.kts @@ -15,14 +15,12 @@ repositories { } dependencies { - val ktorVersion = "1.4.0" - implementation(project(":kotlin-result")) implementation(kotlin("stdlib-jdk8")) - implementation("ch.qos.logback:logback-classic:1.2.3") - implementation("io.ktor:ktor-server-core:$ktorVersion") - implementation("io.ktor:ktor-server-netty:$ktorVersion") - implementation("io.ktor:ktor-gson:$ktorVersion") + implementation("ch.qos.logback:logback-classic:${Versions.logback}") + implementation("io.ktor:ktor-server-core:${Versions.ktor}") + implementation("io.ktor:ktor-server-netty:${Versions.ktor}") + implementation("io.ktor:ktor-gson:${Versions.ktor}") } tasks.withType(KotlinCompile::class.java).all { diff --git a/kotlin-result-coroutines/build.gradle.kts b/kotlin-result-coroutines/build.gradle.kts index a25cf8d..4da59f4 100644 --- a/kotlin-result-coroutines/build.gradle.kts +++ b/kotlin-result-coroutines/build.gradle.kts @@ -16,7 +16,7 @@ kotlin { val commonMain by getting { dependencies { 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")) } } @@ -25,7 +25,7 @@ kotlin { dependencies { implementation(kotlin("test-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 { implementation(kotlin("test-junit")) implementation(kotlin("test")) - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:${Versions.kotlinCoroutines}") } } } diff --git a/kotlin-result/build.gradle.kts b/kotlin-result/build.gradle.kts index fd93687..1861393 100644 --- a/kotlin-result/build.gradle.kts +++ b/kotlin-result/build.gradle.kts @@ -67,7 +67,7 @@ kotlin { val jvmBenchmark by getting { dependsOn(jvmMain) dependencies { - implementation("org.jetbrains.kotlinx:kotlinx.benchmark.runtime-jvm:0.2.0-dev-8") + implementation("org.jetbrains.kotlinx:kotlinx.benchmark.runtime-jvm:${Versions.kotlinBenchmark}") } } }