diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 3adc68f..9a7b1af 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -14,11 +14,11 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Set up JDK 8 + - name: Set up JDK 11 uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '8' + java-version: '11' - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 @@ -29,7 +29,7 @@ jobs: path: | ~/.gradle/caches ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/libs.versions.toml') }} restore-keys: | ${{ runner.os }}-gradle- diff --git a/build.gradle.kts b/build.gradle.kts index bb521b0..aea2dfc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,10 +4,10 @@ import com.vanniktech.maven.publish.SonatypeHost import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { - kotlin("multiplatform") version "2.1.0" - id("org.jetbrains.dokka") version "2.0.0" - id("org.jetbrains.kotlinx.kover") version "0.9.0" - id("com.vanniktech.maven.publish") version "0.30.0" + alias(libs.plugins.kotlinMultiplatform) + alias(libs.plugins.dokka) + alias(libs.plugins.kover) + alias(libs.plugins.mavenPublish) } group = "com.jsoizo" @@ -47,14 +47,12 @@ kotlin { jvm().compilations["main"].defaultSourceSet { dependencies { - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.1") + implementation(libs.kotlinx.coroutines.core) } } jvm().compilations["test"].defaultSourceSet { dependencies { - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.1") - implementation("io.kotest:kotest-runner-junit5:5.9.1") - implementation("io.kotest:kotest-assertions-core:5.9.1") + implementation(libs.bundles.kotest) } } js().compilations["main"].defaultSourceSet { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 0000000..03bd3a9 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,22 @@ +[versions] +kotlin = "2.1.0" +coroutines = "1.10.1" +maven-publish = "0.30.0" +kover = "0.8.2" +dokka = "2.0.0" +kotest = "5.9.1" + +[libraries] +#kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" } +kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" } +kotest-runner-junit5 = { module = "io.kotest:kotest-runner-junit5", version.ref = "kotest" } +kotest-assertions-core = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" } + +[bundles] +kotest = ["kotest-runner-junit5", "kotest-assertions-core"] + +[plugins] +kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } +kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" } +dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } +mavenPublish = { id = "com.vanniktech.maven.publish", version.ref = "maven-publish" }