-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
use shaded libs to improve detekt stability #496
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
build.gradle.kts
Outdated
} | ||
} | ||
|
||
tasks.withType<PrepareSandboxTask> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this line triggers the shadowJar task eagerly.
tasks.withType<PrepareSandboxTask>.configure {
build.gradle.kts
Outdated
@@ -54,6 +57,20 @@ tasks.publishPlugin { | |||
channels.set(listOf(project.version.toString().split('-').getOrElse(1) { "default" }.split('.').first())) | |||
} | |||
|
|||
tasks { | |||
withType<ShadowJar> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
.