Skip to content

Cannot config coverageType in scoverage block #120

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

Closed
gabearwin opened this issue Oct 18, 2019 · 2 comments · Fixed by #123
Closed

Cannot config coverageType in scoverage block #120

gabearwin opened this issue Oct 18, 2019 · 2 comments · Fixed by #123

Comments

@gabearwin
Copy link

gabearwin commented Oct 18, 2019

  • scala version = 2.11.8
  • gradlew version = 5.1
  • The version of the gradle-scoverage plugin I use is 3.2.0.
  • My project is a multi-module project organized by gradle.

I configured the coverage code block as follows in the README document, but the project will report an error.

scoverage {
    minimumRate = 0.8
    coverageType = "Line"
}

ERROR: Cannot set the value of a property of type org.scoverage.CoverageType using an instance of type java.lang.String.

I also tried to write like this coverageType = CoverageType.Line, but still not work.

I found relevant information on the Internet, basically it is no problem to write like the above. So I am confused, where is my problem? Can anyone please help me?

@eyalroth
Copy link
Contributor

This seems like a bug.

I even tried this but it doesn't work:

buildscript {
    repositories {
        maven { url "https://plugins.gradle.org/m2/" }
    }
    dependencies {
        classpath group: 'org.scoverage', name: 'org.scoverage.gradle.plugin', version: '3.2.0'
    }
}

plugins {
    id "org.scoverage" version "3.2.0"
}

scoverage {
    coverageType = org.scoverage.CoverageType.Line
}

I'm getting this error:

* What went wrong:
A problem occurred evaluating script.
> Cannot set the value of a property of type org.scoverage.CoverageType using an instance of type org.scoverage.CoverageType.

@eyalroth
Copy link
Contributor

May be related: gradle/gradle#9268

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

Successfully merging a pull request may close this issue.

2 participants