Skip to content

Register compiler plugin services in Analysis API session#9331

Draft
3flex wants to merge 9 commits into
detekt:mainfrom
3flex:7531-fix
Draft

Register compiler plugin services in Analysis API session#9331
3flex wants to merge 9 commits into
detekt:mainfrom
3flex:7531-fix

Conversation

@3flex

@3flex 3flex commented May 18, 2026

Copy link
Copy Markdown
Member

Fixes #7531. Check the final commit for the changes.

The implementation is fairly simple, except that I've had to copy a fair bit of code into KotlinEnvironmentUtils.kt as loadPlugins in CliCompiler is protected and can't be called directly. There's probably a better way to do this but it works for now.

I used this test (which I've cherry-picked in this PR) #7531 (comment) and also the sample project (updated to newer Gradle & Kotlin versions) here to verify: #7531 (comment)

I haven't tested with any other compiler plugins, though I have confirmed that the compiler options are correctly parsed and passed to detekt's CompilerConfiguration so hopefully no additional work is required for other plugins.

@github-advanced-security github-advanced-security AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

detekt found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@codecov

codecov Bot commented May 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 43.03797% with 45 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.46%. Comparing base (accfb58) to head (cbed46b).

Files with missing lines Patch % Lines
...n/dev/detekt/core/parser/KotlinEnvironmentUtils.kt 40.78% 32 Missing and 13 partials ⚠️

❌ Your patch check has failed because the patch coverage (43.03%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #9331      +/-   ##
============================================
- Coverage     84.72%   84.46%   -0.27%     
  Complexity     4486     4486              
============================================
  Files           571      571              
  Lines         12423    12501      +78     
  Branches       2767     2788      +21     
============================================
+ Hits          10526    10559      +33     
- Misses          696      728      +32     
- Partials       1201     1214      +13     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@BraisGabin

Copy link
Copy Markdown
Member

Is this going to support all the compiler plugins? Should we create more tests with different plugins to ensure that it works (I can implement them)?

For example, I think that we should have tests for Compose and Metro.

@3flex

3flex commented May 22, 2026

Copy link
Copy Markdown
Member Author

If you coud check and add tests that would be fantastic. I don't use either.

@BraisGabin

Copy link
Copy Markdown
Member

Do you want me to add the tests on this branch directly or do you prefer that I add them to a new branch with @Disabled?

@3flex

3flex commented May 22, 2026

Copy link
Copy Markdown
Member Author

Happy to add to this branch, thank you!

@BraisGabin

Copy link
Copy Markdown
Member

Checking on my project I realised that Compose and Metro doesn't generate any issue. But, on the other hand, pacelize, viewbinding and BuildConfig does. So I just pushed 3 new tests. One for each of those.

I'm pretty sure that viewbinding and BuildConfig are not kotlin compiler plugins so if you prefer I can move them to a separated PR.

On my project SQLDelight also generates problems but I'm not able to make SQLDelight work with GradleRunner. I will work on that later and if I make it work I will push that test too.

@3flex

3flex commented May 25, 2026

Copy link
Copy Markdown
Member Author

There's a new flag for Kotlin compiler in 2.4 which prints compiler plugin config (among other info) so you can confirm which compiler plugins are in use. Add -Xprint-configuration to the compiler args.

I don't see any value in adding tests for things like BuildConfig that I'm 99% certain doesn't use a compiler plugin, either in this PR or any other.

@3flex

3flex commented May 26, 2026

Copy link
Copy Markdown
Member Author

You can also check source for CompilerPluginRegistrar. SQLDelight isn't a compiler plugin.

I think for our purposes only plugins that interact with the front end plugin API would ever be in scope for detekt to analyse, see https://kotlinlang.org/docs/custom-compiler-plugins.html#frontend-plugin-api.

On my reading this would include:

And possibly others.

So I think the best approach to ensure coverage would be:

  1. Find a plugin that uses each of the APIs above (and any others from my first link that would result in compiler errors if not applied)
  2. Confirm that without this PR, there are compiler errors when that plugin is used
  3. Confirm that with this PR, there are no longer any compiler errors
  4. Optional: Add tests for that plugin

As long as there's at least one test that checks that the compiler plugin infrastructure is working correctly I don't think we need to test for a plugin that checks every type of compiler front end usage. That means more maintenance, particularly as the compiler plugin API is not stable. One test with serialization plugin should suffice, since compiler plugin updates are shipped with Kotlin itself, and will continue working with new compiler versions.

@BraisGabin

BraisGabin commented May 26, 2026

Copy link
Copy Markdown
Member

One test with serialization plugin should suffice, since compiler plugin updates are shipped with Kotlin itself, and will continue working with new compiler versions.

Parcelize is also shipped with kotlin so we can keep it. I'm going to move the other 2 to other PR and I'm going to create three issues: BuildConfig, ViewBinding and SQLDelight. Even if they are not compiler plugins somehow kotlin see them while compiling. And they generate compiler errors in our side. So we should try to suppor them.

About test with more plugins I guess that we can wait for users to raise issues about incompatible plugins once we support at least some of them.

@FletchMcKee

Copy link
Copy Markdown
Contributor

Wanted to try this out on a sample project I've used for testing since I had looked into this earlier, but I'm running into two issues.

Not sure if this is only an issue since I add detekt-gradle-plugin to a build-logic convention plugin, but the project fails to sync with this error:

Execution failed for task ':build-logic:convention:compileKotlin'.
> Could not resolve all files for configuration ':build-logic:convention:compileClasspath'.
   > Could not find org.gradle.experimental:gradle-public-api:8.14.3.
     Searched in the following locations:
       - https://repo.maven.apache.org/maven2/org/gradle/experimental/gradle-public-api/8.14.3/gradle-public-api-8.14.3.pom
       - https://central.sonatype.com/repository/maven-snapshots/org/gradle/experimental/gradle-public-api/8.14.3/gradle-public-api-8.14.3.pom

Changing compileOnlyApi(libs.gradle.publicApi) to compileOnly(libs.gradle.publicApi) allowed the project to run the Detekt task and it passed in modules that didn't have the compose plugin, but would fail with an error like this in those that did:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':sample:ui:detektDebug'.
> 'void org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar$ExtensionStorage.registerExtension(org.jetbrains.kotlin.extensions.ProjectExtensionDescriptor, java.lang.Object)'
stacktrace
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':sample:ui:detektDebug'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:135)
        at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:288)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:133)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:121)
        at org.gradle.api.internal.tasks.execution.ProblemsTaskPathTrackingTaskExecuter.execute(ProblemsTaskPathTrackingTaskExecuter.java:41)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:74)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:209)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:166)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:45)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:342)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.lambda$execute$0(DefaultTaskExecutionGraph.java:338)
        at org.gradle.internal.operations.CurrentBuildOperationRef.with(CurrentBuildOperationRef.java:84)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:338)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:327)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:459)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:376)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
Caused by: org.gradle.api.GradleException: 'void org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar$ExtensionStorage.registerExtension(org.jetbrains.kotlin.extensions.ProjectExtensionDescriptor, java.lang.Object)'
        at dev.detekt.gradle.invoke.DetektInvokerKt.processResult(DetektInvoker.kt:88)
        at dev.detekt.gradle.invoke.DetektInvokerKt.access$processResult(DetektInvoker.kt:1)
        at dev.detekt.gradle.invoke.DefaultCliInvoker.invokeCli(DetektInvoker.kt:76)
        at dev.detekt.gradle.Detekt.check(Detekt.kt:245)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:125)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:58)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:51)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:29)
        at org.gradle.api.internal.tasks.execution.TaskExecution$3.run(TaskExecution.java:252)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:166)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
        at org.gradle.api.internal.tasks.execution.TaskExecution.executeAction(TaskExecution.java:237)
        at org.gradle.api.internal.tasks.execution.TaskExecution.executeActions(TaskExecution.java:220)
        at org.gradle.api.internal.tasks.execution.TaskExecution.executeWithPreviousOutputFiles(TaskExecution.java:203)
        at org.gradle.api.internal.tasks.execution.TaskExecution.execute(TaskExecution.java:170)
        at org.gradle.internal.execution.steps.ExecuteStep.executeInternal(ExecuteStep.java:105)
        at org.gradle.internal.execution.steps.ExecuteStep.access$000(ExecuteStep.java:44)
        at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:59)
        at org.gradle.internal.execution.steps.ExecuteStep$1.call(ExecuteStep.java:56)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:209)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
        at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:166)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
        at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:56)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:44)
        at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:42)
        at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:75)
        at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:55)
        at org.gradle.internal.execution.steps.PreCreateOutputParentsStep.execute(PreCreateOutputParentsStep.java:50)
        at org.gradle.internal.execution.steps.PreCreateOutputParentsStep.execute(PreCreateOutputParentsStep.java:28)
        at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:68)
        at org.gradle.internal.execution.steps.RemovePreviousOutputsStep.execute(RemovePreviousOutputsStep.java:38)
        at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:61)
        at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:26)
        at org.gradle.internal.execution.steps.CaptureOutputsAfterExecutionStep.execute(CaptureOutputsAfterExecutionStep.java:69)
        at org.gradle.internal.execution.steps.CaptureOutputsAfterExecutionStep.execute(CaptureOutputsAfterExecutionStep.java:46)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:39)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:28)
        at org.gradle.internal.execution.steps.BuildCacheStep.executeWithoutCache(BuildCacheStep.java:189)
        at org.gradle.internal.execution.steps.BuildCacheStep.executeAndStoreInCache(BuildCacheStep.java:145)
        at org.gradle.internal.execution.steps.BuildCacheStep.lambda$executeWithCache$4(BuildCacheStep.java:101)
        at org.gradle.internal.execution.steps.BuildCacheStep.lambda$executeWithCache$5(BuildCacheStep.java:101)
        at org.gradle.internal.Try$Success.map(Try.java:170)
        at org.gradle.internal.execution.steps.BuildCacheStep.executeWithCache(BuildCacheStep.java:85)
        at org.gradle.internal.execution.steps.BuildCacheStep.lambda$execute$0(BuildCacheStep.java:74)
        at org.gradle.internal.Either$Left.fold(Either.java:116)
        at org.gradle.internal.execution.caching.CachingState.fold(CachingState.java:62)
        at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:73)
        at org.gradle.internal.execution.steps.BuildCacheStep.execute(BuildCacheStep.java:48)
        at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:46)
        at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:35)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:75)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$2(SkipUpToDateStep.java:53)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:53)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:35)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:37)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:27)
        at org.gradle.internal.execution.steps.ResolveIncrementalCachingStateStep.executeDelegate(ResolveIncrementalCachingStateStep.java:49)
        at org.gradle.internal.execution.steps.ResolveIncrementalCachingStateStep.executeDelegate(ResolveIncrementalCachingStateStep.java:27)
        at org.gradle.internal.execution.steps.AbstractResolveCachingStateStep.execute(AbstractResolveCachingStateStep.java:71)
        at org.gradle.internal.execution.steps.AbstractResolveCachingStateStep.execute(AbstractResolveCachingStateStep.java:39)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:64)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:35)
        at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:62)
        at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:40)
        at org.gradle.internal.execution.steps.AbstractCaptureStateBeforeExecutionStep.execute(AbstractCaptureStateBeforeExecutionStep.java:76)
        at org.gradle.internal.execution.steps.AbstractCaptureStateBeforeExecutionStep.execute(AbstractCaptureStateBeforeExecutionStep.java:45)
        at org.gradle.internal.execution.steps.AbstractSkipEmptyWorkStep.executeWithNonEmptySources(AbstractSkipEmptyWorkStep.java:136)
        at org.gradle.internal.execution.steps.AbstractSkipEmptyWorkStep.execute(AbstractSkipEmptyWorkStep.java:66)
        at org.gradle.internal.execution.steps.AbstractSkipEmptyWorkStep.execute(AbstractSkipEmptyWorkStep.java:38)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
        at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:36)
        at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:23)
        at org.gradle.internal.execution.steps.HandleStaleOutputsStep.execute(HandleStaleOutputsStep.java:75)
        at org.gradle.internal.execution.steps.HandleStaleOutputsStep.execute(HandleStaleOutputsStep.java:41)
        at org.gradle.internal.execution.steps.AssignMutableWorkspaceStep.lambda$execute$0(AssignMutableWorkspaceStep.java:35)
        at org.gradle.api.internal.tasks.execution.TaskExecution$4.withWorkspace(TaskExecution.java:297)
        at org.gradle.internal.execution.steps.AssignMutableWorkspaceStep.execute(AssignMutableWorkspaceStep.java:31)
        at org.gradle.internal.execution.steps.AssignMutableWorkspaceStep.execute(AssignMutableWorkspaceStep.java:22)
        at org.gradle.internal.execution.steps.ChoosePipelineStep.execute(ChoosePipelineStep.java:40)
        at org.gradle.internal.execution.steps.ChoosePipelineStep.execute(ChoosePipelineStep.java:23)
        at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.lambda$execute$2(ExecuteWorkBuildOperationFiringStep.java:67)
        at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.execute(ExecuteWorkBuildOperationFiringStep.java:67)
        at org.gradle.internal.execution.steps.ExecuteWorkBuildOperationFiringStep.execute(ExecuteWorkBuildOperationFiringStep.java:39)
        at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:46)
        at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:34)
        at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:47)
        at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:34)
        at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:64)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:132)
        ... 29 more
Caused by: java.lang.reflect.InvocationTargetException
        at dev.detekt.gradle.invoke.DefaultCliInvoker.invokeCli(DetektInvoker.kt:74)
        ... 124 more
Caused by: java.lang.NoSuchMethodError: 'void org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar$ExtensionStorage.registerExtension(org.jetbrains.kotlin.extensions.ProjectExtensionDescriptor, java.lang.Object)'
        at androidx.compose.compiler.plugins.kotlin.ComposePluginRegistrar$Companion.registerCommonExtensions(ComposePlugin.kt:646)
        at androidx.compose.compiler.plugins.kotlin.ComposePluginRegistrar.registerExtensions(ComposePlugin.kt:594)
        at org.jetbrains.kotlin.analysis.api.standalone.base.declarations.KotlinStandaloneFirCompilerPluginsProvider.<init>(KotlinStandaloneFirCompilerPluginsProvider.kt:25)
        at org.jetbrains.kotlin.analysis.api.standalone.StandaloneAnalysisAPISessionBuilder.registerCompilerPluginServices(StandaloneAnalysisAPISessionBuilder.kt:216)
        at dev.detekt.core.settings.EnvironmentFacade.<init>(EnvironmentAware.kt:75)
        at dev.detekt.core.ProcessingSettings.<init>(ProcessingSettings.kt:54)
        at dev.detekt.core.tooling.ProcessingSpecSettingsBridgeKt.withSettings$lambda$1(ProcessingSpecSettingsBridge.kt:29)
        at dev.detekt.core.util.PerformanceMonitor.measure(PerformanceMonitor.kt:26)
        at dev.detekt.core.tooling.ProcessingSpecSettingsBridgeKt.withSettings(ProcessingSpecSettingsBridge.kt:28)
        at dev.detekt.core.tooling.AnalysisFacade.runAnalysis$dev_detekt_detekt_core(AnalysisFacade.kt:28)
        at dev.detekt.core.tooling.AnalysisFacade.run(AnalysisFacade.kt:22)
        at dev.detekt.cli.runners.Runner.call(Runner.kt:35)
        at dev.detekt.cli.runners.Runner.execute(Runner.kt:25)
        ... 125 more

@3flex 3flex removed the blocked label Jun 10, 2026
@3flex

3flex commented Jun 10, 2026

Copy link
Copy Markdown
Member Author

@FletchMcKee I'll update this PR later today. Can you share your sample project so I can look at those failures?

@detekt-ci

Copy link
Copy Markdown
Collaborator
Warnings
⚠️ It looks like this PR contains functional changes without a corresponding test.

Generated by 🚫 dangerJS against cbed46b

@3flex

3flex commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

@BraisGabin can I remove the buildconfig and viewbinding tests?

This is otherwise ready for review.

@BraisGabin

Copy link
Copy Markdown
Member

Yes I'll move them to other prs. You can remove them

@FletchMcKee

Copy link
Copy Markdown
Contributor

@3flex Just created a detekt-7531 branch in my NowInAndroid fork and set it up so that it would find mavenLocal Detekt artifacts.

Has the same issue with gradle-public-api, but when switching that to compileOnly, you'll see Detekt runs fine in some modules but fails in others.

For example, no issues in NIA's :core:database

./gradlew :core:database:detektMain

But :core:ui with the Compose compiler fails

./gradlew :core:ui:detektMain

Let me know if you have any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api build core dependencies Pull requests that update a dependency file gradle-plugin rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code generated by Kotlin compiler plugins is not available when detekt compiles code for analysis

5 participants