diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c92c568..e061068 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,61 +2,76 @@ name: CI on: push: - branches: [ master ] + branches: [ main, renovate/** ] pull_request: jobs: build: - name: Build + name: Assemble & Test runs-on: ${{ matrix.os }} + + permissions: + contents: read + strategy: matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] - java-version: [ 8, 11, 16 ] + java-version: [ 17, 21, 25 ] fail-fast: false steps: - name: Checkout - uses: actions/checkout@v4 - - name: Cache - uses: actions/cache@v4 - with: - path: | - ~/.gradle/wrapper - ~/.gradle/caches - key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle.*') }} - restore-keys: | - gradle-${{ runner.os }} - gradle- - - name: Set up JDK ${{ matrix.java-version }} - uses: actions/setup-java@v4 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + + - name: Set Up JDK ${{ matrix.java-version }} + uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 with: java-version: ${{ matrix.java-version }} - distribution: adopt - - name: Prepare - run: ./gradlew clean dependencies + distribution: temurin + + - name: Set Up Gradle + uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5 + with: + build-scan-publish: true + build-scan-terms-of-use-url: "https://gradle.com/terms-of-service" + build-scan-terms-of-use-agree: "yes" + - name: Build - run: ./gradlew assemble testClasses - - name: Test - run: ./gradlew test - - name: Publish Test Report - uses: scacap/action-surefire-report@v1 - if: failure() + run: ./gradlew build --scan + + - name: Upload Test Results + if: ${{ !cancelled() }} + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - report_paths: '**/build/test-results/test/TEST-*.xml' - check_name: Test Results (${{ matrix.os }}, ${{ matrix.java-version }}) + name: test-results-${{ matrix.os }}-java-${{ matrix.java-version }} + path: "**/build/test-results/" + + - name: Generate Documentation + if: matrix.os == 'ubuntu-latest' && matrix.java-version == 25 + run: ./gradlew dokkaGeneratePublicationHtml + env: + ORG_GRADLE_PROJECT_githubRepository: ${{ github.repository }} + + - name: Upload Documentation + if: matrix.os == 'ubuntu-latest' && matrix.java-version == 25 + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 + with: + name: documentation + path: ./build/dokka/html release: name: Release Check runs-on: ubuntu-latest needs: build + if: github.ref == 'refs/heads/main' steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 with: node-version: lts/* + - name: Release Check env: GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} diff --git a/.github/workflows/dependency-graph.yml b/.github/workflows/dependency-graph.yml new file mode 100644 index 0000000..1e005c1 --- /dev/null +++ b/.github/workflows/dependency-graph.yml @@ -0,0 +1,26 @@ +name: Dependency Graph + +on: + push: + branches: [main] + +permissions: + contents: write + +jobs: + submit: + name: Submit Dependency Graph + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + + - name: Set Up Java + uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 + with: + java-version-file: '.sdkmanrc' + distribution: temurin + + - name: Generate and Submit Dependency Graph + uses: gradle/actions/dependency-submission@0723195856401067f7a2779048b490ace7a47d7c # v5 diff --git a/.github/workflows/pull-request-title.yml b/.github/workflows/pull-request-title.yml new file mode 100644 index 0000000..39cf3d8 --- /dev/null +++ b/.github/workflows/pull-request-title.yml @@ -0,0 +1,23 @@ +name: Pull Request Title + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + - reopened + +jobs: + check: + name: Check Title Format + runs-on: ubuntu-latest + + permissions: + pull-requests: read + + steps: + - name: Check Pull Request Title + uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e3de663..7e268c5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,34 +4,40 @@ on: release: types: [ published ] +env: + ORG_GRADLE_PROJECT_version: ${{ github.event.release.tag_name }} + jobs: release: name: Release Artefacts runs-on: ubuntu-latest + + permissions: + contents: read + pages: write + id-token: write + + environment: + name: github-pages + steps: - name: Checkout - uses: actions/checkout@v4 - - name: Cache - uses: actions/cache@v4 - with: - path: | - ~/.gradle/wrapper - ~/.gradle/caches - key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle.*') }} - restore-keys: | - gradle-${{ runner.os }} - gradle- - - name: Set up JDK 11 - uses: actions/setup-java@v4 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + + - name: Set Up JDK + uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5 with: - java-version: 11 - distribution: adopt - - name: Prepare - run: ./gradlew clean dependencies + java-version-file: '.sdkmanrc' + distribution: temurin + + - name: Set Up Gradle + uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5 + - name: Assemble Artefacts run: ./gradlew assemble env: ORG_GRADLE_PROJECT_githubRepository: ${{ github.repository }} + - name: Release Artefacts run: ./gradlew release env: @@ -42,35 +48,15 @@ jobs: ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }} ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }} - docs: - name: Publish Documentation - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Cache - uses: actions/cache@v4 - with: - path: | - ~/.gradle/wrapper - ~/.gradle/caches - key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle.*') }} - restore-keys: | - gradle-${{ runner.os }} - gradle- - - name: Set up JDK 11 - uses: actions/setup-java@v4 - with: - java-version: 11 - distribution: adopt - - name: Prepare - run: ./gradlew clean dependencies - name: Generate Documentation - run: ./gradlew dokkaHtmlCollector + run: ./gradlew dokkaGeneratePublicationHtml env: ORG_GRADLE_PROJECT_githubRepository: ${{ github.repository }} - - name: Publish Documentation - uses: peaceiris/actions-gh-pages@v3.9.3 + + - name: Upload Documentation + uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0 with: - publish_dir: ./build/dokka/htmlCollector - deploy_key: ${{ secrets.GH_PAGES_DEPLOY_KEY }} + path: ./build/dokka/html + + - name: Deploy to GitHub Pages + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 diff --git a/.github/workflows/test-report.yml b/.github/workflows/test-report.yml new file mode 100644 index 0000000..3792bf2 --- /dev/null +++ b/.github/workflows/test-report.yml @@ -0,0 +1,30 @@ +# See https://github.com/dorny/test-reporter?tab=readme-ov-file#recommended-setup-for-public-repositories +# for more info on this workflow + +name: Test Report + +on: + workflow_run: + workflows: [CI] + types: + - completed + +permissions: + contents: read + actions: read + checks: write + +jobs: + add_report: + name: Annotate Test Results on Pull Request + runs-on: ubuntu-latest + + steps: + - uses: dorny/test-reporter@b082adf0eced0765477756c2a610396589b8c637 # v2 + with: + artifact: /test-results-.*/ + name: Test Results + path: "**/*.xml" + reporter: java-junit + max-annotations: "50" + fail-on-error: "false" diff --git a/.sdkmanrc b/.sdkmanrc new file mode 100644 index 0000000..34521d7 --- /dev/null +++ b/.sdkmanrc @@ -0,0 +1 @@ +java=25.0.2-tem diff --git a/base/build.gradle.kts b/base/build.gradle.kts index 6afa7fa..b60b431 100644 --- a/base/build.gradle.kts +++ b/base/build.gradle.kts @@ -1,6 +1,5 @@ -import org.gradle.api.JavaVersion.VERSION_1_8 -import org.jetbrains.kotlin.config.KotlinCompilerVersion -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import org.gradle.api.JavaVersion.VERSION_17 +import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { kotlin("jvm") @@ -11,41 +10,36 @@ val artifactId by extra("testfiles") val description by extra("Manage test files and directories neatly!") dependencies { - val spekVersion = "2.0.17" - - testImplementation(name = "spek-dsl-jvm", version = spekVersion, group = "org.spekframework.spek2") - testImplementation(name = "atrium-fluent-en_GB", version = "0.16.0", group = "ch.tutteli.atrium") - testRuntimeOnly(name = "spek-runner-junit5", version = spekVersion, group = "org.spekframework.spek2") + testImplementation("org.spekframework.spek2:spek-dsl-jvm:2.0.17") + testImplementation("ch.tutteli.atrium:atrium-fluent-en_GB:0.16.0") + testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:2.0.17") + testRuntimeOnly("org.junit.platform:junit-platform-launcher") constraints { - testImplementation(kotlin("reflect", version = KotlinCompilerVersion.VERSION)) + testImplementation(kotlin("reflect")) } } java { - sourceCompatibility = VERSION_1_8 - targetCompatibility = VERSION_1_8 + sourceCompatibility = VERSION_17 + targetCompatibility = VERSION_17 } kotlin { explicitApi() -} - -tasks.withType { - kotlinOptions { - jvmTarget = "1.8" - freeCompilerArgs += "-Xopt-in=kotlin.io.path.ExperimentalPathApi" + compilerOptions { + jvmTarget = JvmTarget.JVM_17 } } tasks.withType { useJUnitPlatform() - val testPwd = buildDir.resolve("test-pwd") + val testPwd = layout.buildDirectory.dir("test-pwd") doFirst { - testPwd.mkdirs() + testPwd.get().asFile.mkdirs() } - workingDir = testPwd + workingDir = testPwd.get().asFile } diff --git a/base/src/main/kotlin/DefaultTestFiles.kt b/base/src/main/kotlin/DefaultTestFiles.kt index edccfb3..c84a011 100644 --- a/base/src/main/kotlin/DefaultTestFiles.kt +++ b/base/src/main/kotlin/DefaultTestFiles.kt @@ -159,7 +159,7 @@ public class DefaultTestFiles: TestFiles { private val unixInvalidCharacters get() = Regex("[/\u0000]") private val windowsInvalidCharacters get() = Regex("[/\\\\<>:\"|?*\u0000]") private val invalidFileNameCharacters by lazy(PUBLICATION) { - val osName = System.getProperty("os.name").toLowerCase() + val osName = System.getProperty("os.name").lowercase() if (setOf("nix", "nux", "aix", "mac").any { osName.contains(it) }) unixInvalidCharacters else windowsInvalidCharacters // default to windows because it is the most restrictive } diff --git a/build.gradle.kts b/build.gradle.kts index a716c8c..cd86adb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,19 +1,18 @@ -import org.jetbrains.dokka.gradle.DokkaTask +import org.jetbrains.dokka.gradle.DokkaExtension plugins { - kotlin("jvm") version "1.9.25" - id("org.jetbrains.dokka") version "1.9.20" - id("com.palantir.git-version") version "3.4.0" + kotlin("jvm") version "2.3.10" + id("org.jetbrains.dokka") version "2.1.0" + id("org.jetbrains.dokka-javadoc") version "2.1.0" apply false `maven-publish` signing - id("io.github.gradle-nexus.publish-plugin") version "1.3.0" + id("io.github.gradle-nexus.publish-plugin") version "2.0.0" idea } group = "de.joshuagleitze" -version = if (isSnapshot) versionDetails.gitHash else versionDetails.lastTag.drop("v") -status = if (isSnapshot) "snapshot" else "release" -val gitRef = if (isSnapshot) versionDetails.gitHash else versionDetails.lastTag +version = if (version == "unspecified") "local" else version.toString().removePrefix("v") +status = if (version == "local") "snapshot" else "release" subprojects { group = rootProject.group @@ -53,6 +52,7 @@ subprojects { afterEvaluate { apply { plugin("org.jetbrains.dokka") + plugin("org.jetbrains.dokka-javadoc") plugin("org.gradle.maven-publish") plugin("org.gradle.signing") } @@ -64,14 +64,13 @@ subprojects { from(sourceSets.main.map { it.allSource }) } - tasks.withType { + val projectPath = projectDir.absoluteFile.relativeTo(rootProject.projectDir.absoluteFile) + configure { dokkaSourceSets.named("main") { - this.DokkaSourceSetID(if (extra.has("artifactId")) extra["artifactId"] as String else project.name) sourceLink { - val projectPath = projectDir.absoluteFile.relativeTo(rootProject.projectDir.absoluteFile) - localDirectory.set(file("src/main/kotlin")) - remoteUrl.set(uri("https://github.com/$githubRepository/blob/$gitRef/$projectPath/src/main/kotlin").toURL()) - remoteLineSuffix.set("#L") + localDirectory = file("src/main/kotlin") + remoteUrl = uri("https://github.com/$githubRepository/blob/main/$projectPath/src/main/kotlin") + remoteLineSuffix = "#L" } } } @@ -80,7 +79,7 @@ subprojects { group = "build" description = "Assembles the Kotlin docs with Dokka" archiveClassifier.set("javadoc") - from(tasks.named("dokkaJavadoc")) + from(tasks.named("dokkaGeneratePublicationJavadoc")) } artifacts { @@ -151,14 +150,11 @@ subprojects { tasks.register("release") { group = "release" description = "Releases the project to all remote repositories" - dependsOn(publishToGithub, publishToMavenCentral, rootProject.tasks.closeAndReleaseStagingRepository) + dependsOn(publishToGithub, publishToMavenCentral, rootProject.tasks.closeAndReleaseStagingRepositories) } - rootProject.tasks.closeAndReleaseStagingRepository { mustRunAfter(publishToMavenCentral) } + rootProject.tasks.closeAndReleaseStagingRepositories { mustRunAfter(publishToMavenCentral) } } } -val Project.isSnapshot get() = versionDetails.commitDistance != 0 -fun String.drop(prefix: String) = if (this.startsWith(prefix)) this.drop(prefix.length) else this fun String.firstUpper() = this.replaceFirstChar { it.titlecase() } -val Project.versionDetails get() = (this.extra["versionDetails"] as groovy.lang.Closure<*>)() as com.palantir.gradle.gitversion.VersionDetails diff --git a/gradle.properties b/gradle.properties index 0c5042f..fa8759f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,7 @@ org.gradle.parallel=true -## TODO: Required because the dokka task runs out of Metaspace. Remove as soon as possible! -org.gradle.jvmargs=-XX:MaxMetaspaceSize=384m +org.gradle.caching = true +org.gradle.configuration-cache = true +org.gradle.configuration-cache.parallel = true + +org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled +org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 1b33c55..61285a6 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index aaaabb3..5f38436 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 23d15a9..adff685 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -114,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -172,7 +171,6 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -212,7 +210,6 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" diff --git a/gradlew.bat b/gradlew.bat index 5eed7ee..e509b2d 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -70,11 +70,10 @@ goto fail :execute @rem Setup the command line -set CLASSPATH= @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/kotest/build.gradle.kts b/kotest/build.gradle.kts index ed62857..d1e4320 100644 --- a/kotest/build.gradle.kts +++ b/kotest/build.gradle.kts @@ -1,7 +1,5 @@ -import org.gradle.api.JavaVersion.VERSION_1_8 -import org.jetbrains.dokka.gradle.DokkaTask -import org.jetbrains.kotlin.config.KotlinCompilerVersion -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import org.gradle.api.JavaVersion.VERSION_17 +import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { kotlin("jvm") @@ -12,44 +10,34 @@ val artifactId by extra("kotest-files") val description by extra("Manage test files and directories neatly when testing with Kotest!") dependencies { - val kotestVersion = "4.6.2" - api(project(":base")) // Kotest is a peer dependency - compileOnly(name = "kotest-framework-api", version = kotestVersion, group = "io.kotest") + compileOnly("io.kotest:kotest-framework-api:4.6.2") - testImplementation(name = "kotest-runner-junit5", version = kotestVersion, group = "io.kotest") - testImplementation(name = "atrium-fluent-en_GB", version = "0.16.0", group = "ch.tutteli.atrium") + testImplementation("io.kotest:kotest-runner-junit5:4.6.2") + testImplementation("ch.tutteli.atrium:atrium-fluent-en_GB:0.16.0") + testRuntimeOnly("org.junit.platform:junit-platform-launcher") constraints { - testImplementation(kotlin("reflect", version = KotlinCompilerVersion.VERSION)) + testImplementation(kotlin("reflect")) } } java { - sourceCompatibility = VERSION_1_8 - targetCompatibility = VERSION_1_8 + sourceCompatibility = VERSION_17 + targetCompatibility = VERSION_17 } kotlin { explicitApi() -} - -tasks.withType { - kotlinOptions { - jvmTarget = "1.8" - } -} - -tasks.compileTestKotlin { - kotlinOptions { - freeCompilerArgs += "-Xopt-in=kotlin.io.path.ExperimentalPathApi" + compilerOptions { + jvmTarget = JvmTarget.JVM_17 } } -tasks.withType { - dokkaSourceSets.named("main") { - samples.from("src/test/kotlin/samples/ExampleSpek.kt") +dokka { + dokkaSourceSets.main { + samples.from("src/test/kotlin/samples/ExampleSpec.kt") } } diff --git a/renovate.json b/renovate.json deleted file mode 100644 index 5e4d16c..0000000 --- a/renovate.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "extends": [ - "config:base", - ":disableDependencyDashboard" - ], - "assignees": [ - "jGleitz" - ], - "pinVersions": true, - "lockFileMaintenance": { - "enabled": true - }, - "packageRules": [ - { - "updateTypes": [ - "minor", - "patch", - "pin", - "digest", - "lockFileMaintenance" - ], - "automerge": true - } - ] -} diff --git a/renovate.json5 b/renovate.json5 new file mode 100644 index 0000000..871a99f --- /dev/null +++ b/renovate.json5 @@ -0,0 +1,13 @@ +{ + /* Simulate this configuration locally by running: + podman run --rm \ + --mount type=bind,src="$(pwd)",dst=/repo \ + --workdir /repo \ + --user 0 \ + --env RENOVATE_GITHUB_COM_TOKEN=$(secret-tool lookup service renovate-dry-run) \ + --env LOG_LEVEL=debug \ + renovate/renovate --dry-run=full --platform=local + */ + $schema: "https://docs.renovatebot.com/renovate-schema.json", + extends: ["github>jGleitz/renovate-config:default.json5"], +} diff --git a/settings.gradle.kts b/settings.gradle.kts index 8b8139b..3005386 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,3 +1,13 @@ rootProject.name = "testfiles" +plugins { + id("com.gradle.develocity") version "4.3.2" +} + include("base", "kotest", "spek") + +develocity { + buildScan { + publishing.onlyIf { false } + } +} diff --git a/spek/build.gradle.kts b/spek/build.gradle.kts index 9ea2e5b..9f4d84c 100644 --- a/spek/build.gradle.kts +++ b/spek/build.gradle.kts @@ -1,7 +1,5 @@ -import org.gradle.api.JavaVersion.VERSION_1_8 -import org.jetbrains.dokka.gradle.DokkaTask -import org.jetbrains.kotlin.config.KotlinCompilerVersion -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import org.gradle.api.JavaVersion.VERSION_17 +import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { kotlin("jvm") @@ -12,46 +10,36 @@ val artifactId by extra("spek-testfiles") val description by extra("Manage test files and directories neatly when testing with Spek!") dependencies { - val spekVersion = "2.0.17" - // Spek is a peer dependency - compileOnly(name = "spek-dsl-jvm", group = "org.spekframework.spek2", version = spekVersion) - compileOnly(name = "spek-runtime-jvm", group = "org.spekframework.spek2", version = spekVersion) + compileOnly("org.spekframework.spek2:spek-dsl-jvm:2.0.17") + compileOnly("org.spekframework.spek2:spek-runtime-jvm:2.0.17") api(project(":base")) - testImplementation(name = "spek-dsl-jvm", version = spekVersion, group = "org.spekframework.spek2") - testImplementation(name = "atrium-fluent-en_GB", version = "0.16.0", group = "ch.tutteli.atrium") - testRuntimeOnly(name = "spek-runner-junit5", version = spekVersion, group = "org.spekframework.spek2") + testImplementation("org.spekframework.spek2:spek-dsl-jvm:2.0.17") + testImplementation("ch.tutteli.atrium:atrium-fluent-en_GB:0.16.0") + testRuntimeOnly("org.spekframework.spek2:spek-runner-junit5:2.0.17") + testRuntimeOnly("org.junit.platform:junit-platform-launcher") constraints { - testImplementation(kotlin("reflect", version = KotlinCompilerVersion.VERSION)) + testImplementation(kotlin("reflect")) } } java { - sourceCompatibility = VERSION_1_8 - targetCompatibility = VERSION_1_8 + sourceCompatibility = VERSION_17 + targetCompatibility = VERSION_17 } kotlin { explicitApi() -} - -tasks.withType { - kotlinOptions { - jvmTarget = "1.8" - } -} - -tasks.compileTestKotlin { - kotlinOptions { - freeCompilerArgs += "-Xopt-in=kotlin.io.path.ExperimentalPathApi" + compilerOptions { + jvmTarget = JvmTarget.JVM_17 } } -tasks.withType { - dokkaSourceSets.named("main") { - samples.from("src/test/kotlin/samples/ExampleSpek.kt") +dokka { + dokkaSourceSets.main { + samples.from("src/test/kotlin/samples/ExampleSpec.kt") } }