scoverage / gradle-scoverage

A plugin to enable the use of Scoverage in a gradle Scala project
Apache License 2.0
53 stars 38 forks source link

Cannot config coverageType in scoverage block #120

Closed gabearwin closed 5 years ago

gabearwin commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

May be related: https://github.com/gradle/gradle/issues/9268