From 150c660b4f06ad8f5b58c0d5d758a1f546242f96 Mon Sep 17 00:00:00 2001 From: bennyhuo Date: Wed, 11 Jan 2023 15:12:52 +0800 Subject: [PATCH] Set resources path when compilerPluginRegistrars not empty. --- .../tschuchort/compiletesting/AbstractKotlinCompilation.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/src/main/kotlin/com/tschuchort/compiletesting/AbstractKotlinCompilation.kt b/core/src/main/kotlin/com/tschuchort/compiletesting/AbstractKotlinCompilation.kt index 029b5e4d..e4914287 100644 --- a/core/src/main/kotlin/com/tschuchort/compiletesting/AbstractKotlinCompilation.kt +++ b/core/src/main/kotlin/com/tschuchort/compiletesting/AbstractKotlinCompilation.kt @@ -221,8 +221,11 @@ abstract class AbstractKotlinCompilation internal c K2 compiler doesn't support plugins yet. This way, users of K2 can prevent MainComponentRegistrar from being loaded and crashing K2 by setting both [componentRegistrars] and [commandLineProcessors] to the emptyList. */ - if (componentRegistrars.isNotEmpty() || commandLineProcessors.isNotEmpty()) - arrayOf(getResourcesPath()) + if ( + componentRegistrars.isNotEmpty() || + compilerPluginRegistrars.isNotEmpty() || + commandLineProcessors.isNotEmpty() + ) arrayOf(getResourcesPath()) else emptyArray() }