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

Add jvmTarget change into documentation #2157

Closed
imanushin opened this issue Dec 2, 2019 · 2 comments · Fixed by #2183
Closed

Add jvmTarget change into documentation #2157

imanushin opened this issue Dec 2, 2019 · 2 comments · Fixed by #2183

Comments

@imanushin
Copy link
Contributor

Expected Behavior

Extend documentation and show ability to put JVM target into task

Current Behavior

At my project (which is built for JVM 11) the following error is appeared:

error: cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option

Context

This happens in case, when Detect thinks, that project is built for default JVM (e.g. 1.6), however actual version is later one. It means, that Kapt compiler tries to do unsupported operations.

Solution

Add the following line into gradle.build.kts:

tasks {
    withType<Detekt> {
        this.jvmTarget = "11"
    }
}
@schalkms
Copy link
Member

Thanks for providing a fix for the mentioned problem!
I think this fix should be added to the docs on detekt's homepage, in order to have this persisted.
@imanushin Would you mind submitting a PR that add's this snippet and the fantastic problem description you gave to detekt's Getting started guide? That would be highly appreciated.

@imanushin
Copy link
Contributor Author

@schalkms , agree. I will try to do PR at the nearest weekend.

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

Successfully merging a pull request may close this issue.

4 participants