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

Plugin fails on gradle 4.10 snapshots #110

Closed
tomdcc opened this issue Jul 27, 2018 · 3 comments
Closed

Plugin fails on gradle 4.10 snapshots #110

tomdcc opened this issue Jul 27, 2018 · 3 comments
Labels

Comments

@tomdcc
Copy link

tomdcc commented Jul 27, 2018

Trying our build that applies the ktlin plugin version 4.1.0 in our buildSrc project against a Gradle 4.10 snapshot gives the following error:

> Task :buildSrc:ktlintMainCheck FAILED
Exception in thread "main" java.lang.NoClassDefFoundError: org/jetbrains/kotlin/preprocessor/PreprocessorKt
        at com.github.shyiko.ktlint.Main$loadReporter$2.invoke(Main.kt:396)
        at com.github.shyiko.ktlint.Main.loadReporter(Main.kt:410)
        at com.github.shyiko.ktlint.Main.main(Main.kt:262)
Caused by: java.lang.ClassNotFoundException: org.jetbrains.kotlin.preprocessor.PreprocessorKt
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        ... 3 more

Inspecting the buildSrc dependencies, it looks like the snapshot is using a Kotlin 1.2.60-eap build:

org.jetbrains.kotlin:kotlin-reflect:1.2.60-eap-44
org.jetbrains.kotlin:kotlin-stdlib:1.2.60-eap-44
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.60-eap-44

I presume that the error is due to changes in the Kotlin libs.

Not necessarily advocating for an immediate fix, but more a head-up that as it currently stands, this plugin will break with Gradle 4.10 if it ships with kotlin libs based on 1.2.60 or later.

@eskatos @bamboo I presume that we're unlikely to roll this back to 1.2.41 at this point, right?

@eskatos
Copy link
Contributor

eskatos commented Jul 27, 2018

That error comes from ktlint itself and it has been fixed in 0.24, see pinterest/ktlint#226

@Tapchicoma Tapchicoma added the bug label Jul 30, 2018
@Tapchicoma
Copy link
Collaborator

Will update default version in Ktlint for the next release. Workaround is set ktlint version in plugin configuration to 0.24.0.

@Tapchicoma
Copy link
Collaborator

Next 5.1.0 release sets latest 0.27.0 ktlint version as default.

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

No branches or pull requests

3 participants