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

Support for JDK 9 & 10 #119

Closed
winstonsimon opened this issue Aug 9, 2018 · 10 comments
Closed

Support for JDK 9 & 10 #119

winstonsimon opened this issue Aug 9, 2018 · 10 comments

Comments

@winstonsimon
Copy link

winstonsimon commented Aug 9, 2018

Looks like gradle clover plugin has no support for JDK 9 and JDK10.

unexpected token: enum
[clover] ** Error(s) occurred and the instrumentation process can't continue.

classpath "com.bmuschko:gradle-clover-plugin:2.2.1"
apply plugin: "com.bmuschko.clover"
clover 'org.openclover:clover:4.2.1'

clover {
    targetPercentage = '100.000%'
    report {
        html = true
        testResultsDir = project.tasks.getByName('test').reports.junitXml.destination
        testResultsInclude = 'TEST-*.xml'
    }
    compiler {
        debug = true
    }
}

[clover] Processing files at 1.3 source level.

Please look into it.

thanks!

@Alex-Vol-SV
Copy link
Collaborator

Alex-Vol-SV commented Aug 9, 2018

This is an issue with OpenClover version. Open an issue with the OpenClover project although I think this is already in their roadmap. Looks like it is coming in version 4.3.0

OpenClover support for Java 9

The plugin does not have control over this, we just provide the Gradle wrappers around the execution of the OpenClover Ant tasks behind the plugin tasks.

@winstonsimon
Copy link
Author

Thanks Alex for responding 👍

@joferguson
Copy link

I tried using openclover 4.3.1 to get support for Java 10, but doing so I get the following error.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':test'.

Class not found: com.atlassian.clover.ant.taskdefs.CloverCompilerAdapter

It might be related to this: https://bitbucket.org/openclover/clover/issues/75/431-ant-javac-task-is-unable-to-find

@Alex-Vol-SV
Copy link
Collaborator

Thank you for the note @joferguson
I will try to take a look at the required changes for JDK 9 or later to support this.
I do not have much time right now to spend on this plugin but I will do my best.

@taylorsmithgg
Copy link

This is still broken for my builds.

@qodjf
Copy link

qodjf commented Oct 21, 2019

Why source level is 1.3 here? Can we set source level to 1.5 or higher?

@Alex-Vol-SV
Copy link
Collaborator

@qodjf the source level is controlled by your own Gradle source level settings. This plugin does not set the source level. The plugin is compiled at Java 8 level but will instrument up to the level supported by the OpenClover library.

@mrdanpsmith
Copy link

@Alex-Vol-SV I'm seeing the same thing with regards to the version being set at 1.3 for source that is now at version 11.

I think the problem here is that if you use a higher source version than clover supports it drops it all the way down to 1.3 rather than falling back to the next highest supported version.

Is there a way to manually set the version the instrumentation is doing using this plugin? I would like to compile the project at 11 but I don't care if it winds up being compiled down to 8 for instrumentation purposes.

@Alex-Vol-SV
Copy link
Collaborator

Alex-Vol-SV commented Feb 7, 2020

I thought we were letting an override with default but we don't.
It could be added if that would help.

The code can be corrected in the plugin and the override exposed in the clover.compiler closure

@Alex-Vol-SV
Copy link
Collaborator

I am going to post 2.2.5 with the sourceCompatibility override to allow this to work as long as OpenClover can indeed process the source code at Java 9 level. I do not have any handy examples to prove it works in all cases but it does indeed override the setting so the Java compiler can be at Java 11 and OpenClover can be at 9 to work.

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

No branches or pull requests

6 participants