Switch to JUnit5

This commit is contained in:
Alexander Nozik 2020-04-07 12:49:40 +03:00
parent 796b40b74f
commit f2a5d0715c
4 changed files with 16 additions and 18 deletions

View File

@ -7,7 +7,7 @@ plugins {
}
group = "scientifik"
version = "0.4.1"
version = "0.4.2"
repositories {
gradlePluginPortal()

View File

@ -9,6 +9,7 @@ import org.gradle.api.plugins.JavaPluginExtension
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.tasks.bundling.Jar
import org.gradle.api.tasks.testing.Test
import org.gradle.kotlin.dsl.*
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.dsl.KotlinJvmProjectExtension
@ -44,9 +45,9 @@ open class ScientifikJVMPlugin : Plugin<Project> {
languageSettings.applySettings()
dependencies {
implementation(kotlin("test"))
implementation(kotlin("test-junit"))
// implementation(kotlin("test-junit5"))
// implementation("org.junit.jupiter:junit-jupiter:5.5.2")
// implementation(kotlin("test-junit"))
implementation(kotlin("test-junit5"))
implementation("org.junit.jupiter:junit-jupiter:5.6.1")
}
}
@ -92,9 +93,9 @@ open class ScientifikJVMPlugin : Plugin<Project> {
}
}
}
// tasks.withType<Test>(){
// useJUnitPlatform()
// }
tasks.withType<Test>(){
useJUnitPlatform()
}
}
}

View File

@ -7,6 +7,7 @@ import org.gradle.api.plugins.JavaBasePlugin
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.tasks.bundling.Jar
import org.gradle.api.tasks.testing.Test
import org.gradle.kotlin.dsl.*
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
@ -60,9 +61,9 @@ open class ScientifikMPPlugin : Plugin<Project> {
val jvmTest by getting {
dependencies {
implementation(kotlin("test"))
implementation(kotlin("test-junit"))
// implementation(kotlin("test-junit5"))
// implementation("org.junit.jupiter:junit-jupiter:5.5.2")
// implementation(kotlin("test-junit"))
implementation(kotlin("test-junit5"))
implementation("org.junit.jupiter:junit-jupiter:5.6.1")
}
}
val jsMain by getting {
@ -127,13 +128,9 @@ open class ScientifikMPPlugin : Plugin<Project> {
}
group = "distribution"
}
// findByName("assemble")?.dependsOn(installJsDist)
// withType<Test>(){
// useJUnitPlatform()
// }
// }
withType<Test>() {
useJUnitPlatform()
}
}
}

View File

@ -8,7 +8,7 @@ import java.io.File
internal fun LanguageSettingsBuilder.applySettings(): Unit {
progressiveMode = true
//enableLanguageFeature("InlineClasses")
enableLanguageFeature("InlineClasses")
useExperimentalAnnotation("kotlin.Experimental")
useExperimentalAnnotation("kotlin.ExperimentalUnsignedTypes")
useExperimentalAnnotation("kotlin.ExperimentalStdlibApi")