2rabs/nito-app

View on GitHub
build-logic/src/main/kotlin/club/nito/primitive/KotestPlugin.kt

Summary

Maintainability
A
3 hrs
Test Coverage
package club.nito.primitive

import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.kotlin.dsl.dependencies

@Suppress("unused")
class KotestPlugin : Plugin<Project> {
    override fun apply(target: Project) {
        with(target) {
            with(pluginManager) {
                apply("io.kotest.multiplatform")
            }
            android {
                testOptions {
                    unitTests.all {
                        it.useJUnitPlatform()
                    }
                }
            }
            kotlin {
                with(sourceSets) {
                    getByName("commonTest").apply {
                        dependencies {
                            implementation(platform(libs.library("kotestBom")))
                            implementation(libs.library("kotestAssertionsCore"))
                            implementation(libs.library("kotestFrameworkEngine"))
                            implementation(libs.library("kotestFrameworkDatatest"))
                        }
                    }
                }
            }
            dependencies {
                testImplementation(libs.library("kotestRunnerJunit5"))
            }
        }
    }
}