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

[WIP] Kotlin 2.0 support (2.0.0-RC3) #6640

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft

Conversation

3flex
Copy link
Member

@3flex 3flex commented Nov 23, 2023

Unless I've missed something it seems that the classic method of running detekt is compatible with K2 but the compiler plugin isn't.

Testing & experimentation is encouraged.

Fixes #6715

@detekt-ci detekt-ci added rules build dependencies Pull requests that update a dependency file compiler-plugin labels Nov 23, 2023
@3flex 3flex changed the title [WIP] Kotlin 2 [WIP] Kotlin 2.0 support Nov 23, 2023
@detekt-ci detekt-ci added the api label Nov 26, 2023
@jarroyoesp
Copy link

Hey @3flex after trying the commit 429a178 as you mentioned here #6715 (comment). I've been able to compile your branch and generate the library on my MavenLocal. But when I've run detekt in my project, I am getting the following errors:

> Task :build-conventions:compileKotlin FAILED
e: Pre-release classes were found in dependencies. Remove them from the classpath, recompile with a release compiler or use '-Xskip-prerelease-check' to suppress errors
e: file:///Users/javierarroyo/Projects/Personal/Forlago/build-conventions/build/generated-sources/kotlin-dsl-accessors/kotlin/gradle/kotlin/dsl/accessors/_2fb462c0d2ba107f613d15985247d494/Accessors32ikgp1isdd8mwexzgbe6rirl.kt:65:44 Class 'io.gitlab.arturbosch.detekt.extensions.DetektExtension' is compiled by a pre-release version of Kotlin and cannot be loaded by this version of the compiler

Thanks :)

@3flex
Copy link
Member Author

3flex commented Dec 20, 2023

You probably need to follow steps here: https://docs.gradle.org/8.3/release-notes.html#kotlin_k2 and be sure to use Gradle 8.3 or higher.

Also have a read of https://kotlinlang.org/docs/whatsnew-eap.html#current-k2-compiler-limitations

@3flex 3flex force-pushed the kotlin-2 branch 2 times, most recently from 8652daa to 68f3cc7 Compare December 22, 2023 05:17
Copy link

codecov bot commented Dec 22, 2023

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 84.37%. Comparing base (fa596fd) to head (8a9b77f).
Report is 34 commits behind head on main.

❗ Current head 8a9b77f differs from pull request most recent head 7b415b4. Consider uploading reports for the commit 7b415b4 to get more accurate results

Files Patch % Lines
...lin/io/github/detekt/parser/BindingContextUtils.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6640      +/-   ##
============================================
- Coverage     84.70%   84.37%   -0.34%     
- Complexity     3992     4163     +171     
============================================
  Files           578      578              
  Lines         12163    12082      -81     
  Branches       2495     2478      -17     
============================================
- Hits          10303    10194     -109     
- Misses          626      644      +18     
- Partials       1234     1244      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@3flex 3flex changed the title [WIP] Kotlin 2.0 support [WIP] Kotlin 2.0 support (2.0.0-RC2) Apr 29, 2024
3flex added 2 commits May 11, 2024 12:44
Kotlin 2.0.0-RC3 increased its min supported AGP version to 7.1.3. Bumping in detekt to match.
@3flex 3flex changed the title [WIP] Kotlin 2.0 support (2.0.0-RC2) [WIP] Kotlin 2.0 support (2.0.0-RC3) May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api build compiler-plugin core dependencies Pull requests that update a dependency file formatting gradle-plugin notable changes Marker for notable changes in the changelog parser rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

K2 compiler crashes Detekt
4 participants