1
0
mirror of https://github.com/mamoe/mirai.git synced 2025-04-02 05:00:35 +08:00

Unified junit version, update junit to 5.4.2

This commit is contained in:
Him188 2021-04-06 00:11:12 +08:00
parent 620771211e
commit ece455f79e
3 changed files with 5 additions and 37 deletions

View File

@ -209,37 +209,4 @@ fun Project.configureMppShadow() {
}*/
}
}
fun Project.configureEncoding() {
tasks.withType(JavaCompile::class.java) {
options.encoding = "UTF8"
}
}
fun Project.configureKotlinTestSettings() {
tasks.withType(Test::class) {
useJUnitPlatform()
}
when {
isKotlinJvmProject -> {
dependencies {
testImplementation(kotlin("test-junit5"))
testApi("org.junit.jupiter:junit-jupiter-api:5.2.0")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.2.0")
}
}
isKotlinMpp -> {
kotlinSourceSets?.forEach { sourceSet ->
if (sourceSet.name.endsWith("test", ignoreCase = true)) {
sourceSet.dependencies {
api(kotlin("test-junit5"))
api("org.junit.jupiter:junit-jupiter-api:5.2.0")
runtimeOnly("org.junit.jupiter:junit-jupiter-engine:5.2.0")
}
}
}
}
}
}
}

View File

@ -75,8 +75,8 @@ fun Project.configureKotlinTestSettings() {
dependencies {
"testImplementation"(kotlin("test-junit5"))
"testApi"("org.junit.jupiter:junit-jupiter-api:5.2.0")
"testRuntimeOnly"("org.junit.jupiter:junit-jupiter-engine:5.2.0")
"testApi"("org.junit.jupiter:junit-jupiter-api:${Versions.junit}")
"testRuntimeOnly"("org.junit.jupiter:junit-jupiter-engine:${Versions.junit}")
}
}
isKotlinMpp -> {
@ -90,8 +90,8 @@ fun Project.configureKotlinTestSettings() {
sourceSet.dependencies {
implementation(kotlin("test-junit5"))
implementation("org.junit.jupiter:junit-jupiter-api:5.2.0")
implementation("org.junit.jupiter:junit-jupiter-engine:5.2.0")
implementation("org.junit.jupiter:junit-jupiter-api:${Versions.junit}")
implementation("org.junit.jupiter:junit-jupiter-engine:${Versions.junit}")
}
}
}

View File

@ -45,6 +45,7 @@ object Versions {
const val asm = "9.1"
const val difflib = "1.3.0"
const val junit = "5.4.2"
// If you the versions below, you need to sync changes to mirai-console/buildSrc/src/main/kotlin/Versions.kt