Jelajahi Sumber

Unified junit version, update junit to 5.4.2

Him188 4 tahun lalu
induk
melakukan
ece455f79e

+ 0 - 33
build.gradle.kts

@@ -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")
-                        }
-                    }
-                }
-            }
-        }
-    }
 }

+ 4 - 4
buildSrc/src/main/kotlin/ProjectConfigure.kt

@@ -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}")
                     }
                 }
             }

+ 1 - 0
buildSrc/src/main/kotlin/Versions.kt

@@ -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