use shaded libs to improve detekt stability#496
Conversation
| tasks.withType<PrepareSandboxTask> { | ||
| pluginJar = project.tasks.withType<ShadowJar>().getByName("shadowJar").archiveFile | ||
| // disable to collect libraries located in runtime classpath (replace with empty file collection) | ||
| runtimeClasspathFiles = project.objects.fileCollection() |
There was a problem hiding this comment.
https://github.com/JetBrains/gradle-intellij-plugin/blob/a10fd139467dd34c8e292296b563edfed14fea9d/src/main/kotlin/org/jetbrains/intellij/IntelliJPlugin.kt#L611
runtimeClasspathFiles uses to include depended libraries and plugins.
From this changes applied, we use shadow jar, which included libraries, so we can replace runtimeClasspathFiles empty.
|
Hi, You think this change also fix showing Kotlin compiler errors as detekt plugin errors #271 ? Unfortunately shading the compiler lib does not help with using the normal compiler classes: #271 |
| } | ||
| } | ||
|
|
||
| tasks.withType<PrepareSandboxTask> { |
There was a problem hiding this comment.
I think this line triggers the shadowJar task eagerly.
tasks.withType<PrepareSandboxTask>.configure {
| } | ||
|
|
||
| tasks { | ||
| withType<ShadowJar> { |
There was a problem hiding this comment.
| withType<ShadowJar> { | |
| tasks.withType<ShadowJar>.configure { |
|
sorry for too late response.
#271. (but after upgrade the plugin to 2.2.0, running in IntelliJ IDEA 2023.2.4 + Kotlin plugin 232-1.9.20-release-507-IJ10072.2, these error is not occurring...)
I think kotlin plugin picking up the kotlin compiler from detekt plugin wrongly.
Thus,I think we can mitigate #271 with relocating the classes which uses in kotlin plugin. JFYI, kotlin-intellij-plugin is relocating kotlin PSI files, Anyway, I've applied your review comments to this pull request. thank you for your review! |
Motivation:
detekt-intellij-plugin.Modification:
detekt-intellij-plugin.