How do I use the native JUnit 5 support in Gradle with the Kotlin DSL?

前端 未结 2 754
旧时难觅i
旧时难觅i 2021-02-18 18:38

I want to use the built-in JUnit 5 with the Gradle Kotlin DSL, because during build I get this warning:

WARNING: The junit-platform-gradle-plugin is deprecated a         


        
2条回答
  •  耶瑟儿~
    2021-02-18 19:28

    Adding on top of accepted answer, it is also possible to use typed task configuration like:

    tasks.withType {
        useJUnitPlatform()
    }
    

    Update:

    Gradle docs for reference here. Specifically Example 19 which has:

    tasks.withType {
        options.isWarnings = true
        // ...
    }
    

提交回复
热议问题