Android Studio 3/Kotlin code coverage

后端 未结 2 968
北荒
北荒 2021-01-04 23:04

My android app is multi module project:

include (android-app/kotlin-android)\':application\', (pure kotlin)\':presentation\', (pure kotlin)\':domain\', (andr         


        
2条回答
  •  情书的邮戳
    2021-01-04 23:21

    Solution is to add this this gradle task in build.gradle for module:

    task copyTestClasses(type: Copy) {
        from "build/tmp/kotlin-classes/debugUnitTest"
        into "build/intermediates/classes/debug"
    }
    

    And run:

    gradlew copyTestClasses
    

    Then generate code coverage report without problems.

提交回复
热议问题