Skip to content

Commit

Permalink
use shaded libs to improve detekt stability
Browse files Browse the repository at this point in the history
  • Loading branch information
litols committed Oct 27, 2023
1 parent 9db322a commit e1fd5e9
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.intellij.tasks.PrepareSandboxTask
import org.jetbrains.intellij.tasks.RunPluginVerifierTask.FailureLevel.DEPRECATED_API_USAGES
import org.jetbrains.intellij.tasks.RunPluginVerifierTask.FailureLevel.INVALID_PLUGIN

Expand All @@ -14,6 +16,7 @@ plugins {
alias(libs.plugins.intellij)
alias(libs.plugins.versions)
alias(libs.plugins.github.release)
alias(libs.plugins.shadow)
}

dependencies {
Expand Down Expand Up @@ -54,6 +57,20 @@ tasks.publishPlugin {
channels.set(listOf(project.version.toString().split('-').getOrElse(1) { "default" }.split('.').first()))
}

tasks {
withType<ShadowJar> {
archiveBaseName = "detekt-intellij-plugin-shaded"
mergeServiceFiles()
relocate("org.jetbrains.kotlin", "detekt.shadow.org.jetbrains.kotlin")
}
}

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()
}

intellij {
pluginName.set("Detekt IntelliJ Plugin")
version.set("2022.1.4")
Expand Down

0 comments on commit e1fd5e9

Please sign in to comment.