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

Unable to use ktlint 0.38.0-alpha01 (Kotlin 1.4 compatibility) #152

Closed
ephemient opened this issue Aug 18, 2020 · 7 comments
Closed

Unable to use ktlint 0.38.0-alpha01 (Kotlin 1.4 compatibility) #152

ephemient opened this issue Aug 18, 2020 · 7 comments

Comments

@ephemient
Copy link

buildscript {
    configurations.classpath.resolutionStrategy.dependencySubstitution.all {
        val requested = requested as? ModuleComponentSelector ?: return@all
        if (requested.group == "com.pinterest.ktlint") {
            useTarget("${requested.moduleIdentifier}:0.38.0-alpha01", "Kotlin 1.4 compatibility")
        }
    }
}
$ ./gradlew lintKotlin
Execution failed for task ':lintKotlin'.
> There was a failure while executing work items
   > A failure occurred while executing org.jmailen.gradle.kotlinter.tasks.lint.LintWorkerRunnable
      > kotlin.jvm.internal.FunctionReferenceImpl.<init>(ILjava/lang/Object;Ljava/lang/Class;Ljava/lang/String;Ljava/lang/String;I)V

Kotlinter itself has compatibility problems with Kotlin 1.4?

@jeremymailen
Copy link
Owner

Probably another manifestation of this: pinterest/ktlint#830 (comment)
I'm watching the threads, but haven't worked through the upgrade yet. It may be that there are still some incompatibilities in alpha01.

@ephemient
Copy link
Author

Experimenting with some workarounds, I think this might actually require #58. We're trying to use Kotlin 1.4 compiled classes, but because it's mixed with Gradle classpath containing Kotlin 1.3 stdlib, we end up with incompatibilities.

@jeremymailen
Copy link
Owner

Yeah, I tried the upgrade this evening and the issue is that if you are using the Gradle Kotlin DSL, that implementation is still pinned to kotlin 1.3 and causes a clash with this plugin would need 1.4.

I guess the options are to wait for a version of gradle which upgrades to kotlin 1.4 or implement isolation of kotlinter's classloader.

@jeremymailen
Copy link
Owner

See discussion here: #144 (comment)

@henrik242
Copy link

0.38 is released: pinterest/ktlint#846

@jeremymailen
Copy link
Owner

3.0.0 is now available with kotlin 1.4.0 support.

@ssp
Copy link

ssp commented Aug 25, 2020

Thanks for the update @jeremymailen !

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

No branches or pull requests

4 participants