Add mode to run kapt with JVM IR, use in tests
Currently JVM IR is not supported in kapt, so almost all tests are failing, and thus are muted with IGNORE_BACKEND. #KT-49682
This commit is contained in:
@@ -85,6 +85,11 @@ public class JVMConfigurationKeys {
|
||||
public static final CompilerConfigurationKey<Boolean> IR =
|
||||
CompilerConfigurationKey.create("IR");
|
||||
|
||||
// Temporary option to make it possible to test kapt with JVM IR. As soon as all tests start to pass, it can be removed,
|
||||
// and the backend (old or IR) will be deduced from the compiler arguments provided by the user.
|
||||
public static final CompilerConfigurationKey<Boolean> USE_KAPT_WITH_JVM_IR =
|
||||
CompilerConfigurationKey.create("Enable JVM IR for kapt");
|
||||
|
||||
public static final CompilerConfigurationKey<Boolean> USE_PSI_CLASS_FILES_READING =
|
||||
CompilerConfigurationKey.create("use a slower (PSI-based) class files reading implementation");
|
||||
|
||||
|
||||
@@ -185,9 +185,9 @@ object GenerationUtils {
|
||||
analysisResult: AnalysisResult,
|
||||
configureGenerationState: GenerationState.Builder.() -> Unit = {},
|
||||
): GenerationState {
|
||||
/* Currently Kapt3 only works with the old JVM backend, so disable IR for everything except actual bytecode generation. */
|
||||
val isIrBackend =
|
||||
classBuilderFactory.classBuilderMode == ClassBuilderMode.FULL && configuration.getBoolean(JVMConfigurationKeys.IR)
|
||||
(classBuilderFactory.classBuilderMode == ClassBuilderMode.FULL && configuration.getBoolean(JVMConfigurationKeys.IR)) ||
|
||||
configuration.getBoolean(JVMConfigurationKeys.USE_KAPT_WITH_JVM_IR)
|
||||
val generationState = GenerationState.Builder(
|
||||
project, classBuilderFactory, analysisResult.moduleDescriptor, analysisResult.bindingContext,
|
||||
files, configuration
|
||||
|
||||
Reference in New Issue
Block a user