Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo in the README for Android setup #101

Closed
mezpahlan opened this issue Dec 21, 2021 · 1 comment
Closed

Typo in the README for Android setup #101

mezpahlan opened this issue Dec 21, 2021 · 1 comment

Comments

@mezpahlan
Copy link

The README contains the following snippet under the section Example of configuring test task for build type debug in Android:

android {
    // other Android declarations

    testOptions {
        unitTests.all {
            if (it.name == "testDebugUnitTest") {
                extensions.configure(kotlinx.kover.api.KoverTaskExtension::class) {
                    isEnabled = true
                    binaryReportFile.set(file("$buildDir/custom/debug-report.bin"))
                    includes = listOf("com.example.*")
                    excludes = listOf("com.example.subpackage.*")
                }
            }
        }
    }
}

When I copied this into my project it wouldn't build with the following error:

> Extension of type 'KoverTaskExtension' does not exist.

Is this missing an it? Perhaps like this (changes in bold)?

android {
    // other Android declarations

    testOptions {
        unitTests.all {
            if (it.name == "testDebugUnitTest") {
                it.extensions.configure(kotlinx.kover.api.KoverTaskExtension::class) {
                    isEnabled = true
                    binaryReportFile.set(file("$buildDir/custom/debug-report.bin"))
                    includes = listOf("com.example.*")
                    excludes = listOf("com.example.subpackage.*")
                }
            }
        }
    }
}

This ensures that the KoverTaskExtension is configured on the Test task rather than the Android project. If you agree, let me know I can raise a quick PR. Thanks.

@shanshin
Copy link
Contributor

Thanks for the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants