From aac68af7dbad25b29531b8544c100c497146c250 Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Tue, 10 May 2022 11:11:27 +0200 Subject: Add support for kotlin-compiler-embeddable 1.6.20 While, unlike last time, maintaining backwards compatibility with 1.5.21 (and anything in between). --- .../kotlin/com/replaymod/gradle/remap/kotlin1620.kt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/kotlin1620/kotlin/com/replaymod/gradle/remap/kotlin1620.kt (limited to 'src/kotlin1620/kotlin/com') diff --git a/src/kotlin1620/kotlin/com/replaymod/gradle/remap/kotlin1620.kt b/src/kotlin1620/kotlin/com/replaymod/gradle/remap/kotlin1620.kt new file mode 100644 index 0000000..2574bfe --- /dev/null +++ b/src/kotlin1620/kotlin/com/replaymod/gradle/remap/kotlin1620.kt @@ -0,0 +1,18 @@ +package com.replaymod.gradle.remap + +import org.jetbrains.kotlin.analyzer.AnalysisResult +import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment +import org.jetbrains.kotlin.cli.jvm.compiler.NoScopeRecordCliBindingTrace +import org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM +import org.jetbrains.kotlin.com.intellij.psi.search.GlobalSearchScope +import org.jetbrains.kotlin.psi.KtFile + +fun analyze1620(environment: KotlinCoreEnvironment, ktFiles: List): AnalysisResult { + return TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration( + environment.project, + ktFiles, + NoScopeRecordCliBindingTrace(), + environment.configuration, + { scope: GlobalSearchScope -> environment.createPackagePartProvider(scope) } + ) +} -- cgit