File tree Expand file tree Collapse file tree
src/test/kotlin/io/gitlab/arturbosch/detekt/idea Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,8 +5,10 @@ import org.jetbrains.intellij.tasks.RunPluginVerifierTask.FailureLevel.INVALID_P
55project.group = " io.gitlab.arturbosch.detekt"
66project.version = libs.versions.detektIJ.get()
77
8- repositories {
9- mavenCentral()
8+ allprojects {
9+ repositories {
10+ mavenCentral()
11+ }
1012}
1113
1214plugins {
@@ -17,13 +19,12 @@ plugins {
1719}
1820
1921dependencies {
20- implementation(libs.detekt.api)
21- implementation(libs.detekt.tooling)
22-
23- runtimeOnly(libs.detekt.core)
24- runtimeOnly(libs.detekt.rules)
25- runtimeOnly(libs.detekt.formatting)
22+ // Required for IDE
23+ compileOnly(project(" :libs" ))
24+ // use shadowed libs
25+ implementation(project(" :libs" , " shadow" ))
2626
27+ testCompileOnly(project(" :libs" ))
2728 testRuntimeOnly(libs.junit.platform)
2829
2930 testImplementation(libs.detekt.testUtils)
Original file line number Diff line number Diff line change 1+ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2+
3+ /* *
4+ * shaded libs for detekt-intellij-plugin
5+ *
6+ * detekt requires the kotlin-compiler-embeddable which is correct version,
7+ * but it conflicts with kotlin intellij plugins.
8+ */
9+ plugins {
10+ kotlin(" jvm" )
11+ `java- library`
12+ id(" com.github.johnrengelman.shadow" ) version " 8.1.1"
13+ }
14+
15+ dependencies {
16+ api(libs.detekt.api)
17+ api(libs.detekt.tooling)
18+
19+ api(libs.detekt.core)
20+ api(libs.detekt.rules)
21+ api(libs.detekt.formatting)
22+ }
23+
24+ kotlin {
25+ jvmToolchain(11 )
26+ }
27+
28+ tasks {
29+ withType<ShadowJar > {
30+ archiveBaseName = " detekt-intellij-plugin-libs-shaded"
31+ mergeServiceFiles()
32+ relocate(" org.jetbrains.kotlin.psi" , " detekt.shadow.org.jetbrains.kotlin.psi" )
33+ }
34+ }
Original file line number Diff line number Diff line change @@ -28,3 +28,5 @@ gradleEnterprise {
2828 }
2929 }
3030}
31+
32+ include(" :libs" )
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ import io.gitlab.arturbosch.detekt.api.Severity
2020import io.gitlab.arturbosch.detekt.api.SourceLocation
2121import io.gitlab.arturbosch.detekt.api.TextLocation
2222import org.jetbrains.kotlin.com.intellij.openapi.util.Key
23- import org.jetbrains.kotlin.psi.KtFile
23+ import detekt.shadow. org.jetbrains.kotlin.psi.KtFile
2424import org.jetbrains.kotlin.resolve.BindingContext
2525import java.nio.file.Path
2626import java.nio.file.Paths
You can’t perform that action at this time.
0 commit comments