bmuschko / gradle-clover-plugin

Gradle plugin for generating a code coverage report using Clover
Apache License 2.0
74 stars 49 forks source link

unexpected token: enum on JDK10 #138

Closed taylorsmithgg closed 5 years ago

taylorsmithgg commented 5 years ago

119 Says this was fixed, but I am still experiencing an issue.

Using

    dependencies {
        clover 'org.openclover:clover:4.3.1'
    }

and

classpath "com.bmuschko:gradle-clover-plugin:2.2.3"
Alex-Vol-SV commented 5 years ago

This is not an issue I can fix. Relies on changes from OpenClover.

Alex-Vol-SV commented 5 years ago

This is caused by OpenClover version selection. 4.3.0 or later I believe makes it work.

Alex-Vol-SV commented 5 years ago

By the way, if you want me to take any different action prove that it is this plugin that failed and not OpenClover with a reproducer and a stack trace. I do not have enough time to research this when all indications are this failed during the instrumentation step inside OpenClover code.

taylorsmithgg commented 5 years ago

I'll get you a sample.

Alex-Vol-SV commented 4 years ago

OpenClover does not support Java version 10 or later yet. I Added a new feature in the plugin to allow dropping down to Java 9 for the Clover compilation only. This solves the problem because in the original code the OpenClover library will auto-select the minimum Java version when the choice is not a supported Java version. As a result selecting Java 10 make Clover use Java 1.3 level which does not have enum as a keyword.

sourceCompatbility = '10'
targetCompatibility = '10'

clover {
   compiler {
       sourceCompatbility = '1.9'
       targetCompatibility = '1.9'
   }
}