aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.gradle.kts2
-rw-r--r--src/main/kotlin/com/replaymod/gradle/remap/Transformer.kt4
2 files changed, 5 insertions, 1 deletions
diff --git a/build.gradle.kts b/build.gradle.kts
index de0684b..8493ae8 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -17,7 +17,7 @@ repositories {
}
dependencies {
- compile("org.jetbrains.kotlin:kotlin-compiler-embeddable:1.3.40")
+ compile("org.jetbrains.kotlin:kotlin-compiler-embeddable:1.3.72")
implementation(kotlin("stdlib"))
compile("org.cadixdev:lorenz:0.5.0")
}
diff --git a/src/main/kotlin/com/replaymod/gradle/remap/Transformer.kt b/src/main/kotlin/com/replaymod/gradle/remap/Transformer.kt
index ed3b53c..85e5acd 100644
--- a/src/main/kotlin/com/replaymod/gradle/remap/Transformer.kt
+++ b/src/main/kotlin/com/replaymod/gradle/remap/Transformer.kt
@@ -26,6 +26,7 @@ import org.jetbrains.kotlin.com.intellij.psi.PsiManager
import org.jetbrains.kotlin.com.intellij.psi.search.GlobalSearchScope
import org.jetbrains.kotlin.config.CommonConfigurationKeys
import org.jetbrains.kotlin.config.CompilerConfiguration
+import org.jetbrains.kotlin.config.JVMConfigurationKeys
import org.jetbrains.kotlin.psi.KtFile
import java.io.BufferedReader
import java.io.File
@@ -59,6 +60,9 @@ class Transformer(private val map: MappingSet) {
config.addAll<ContentRoot>(CLIConfigurationKeys.CONTENT_ROOTS, classpath!!.map { JvmClasspathRoot(File(it)) })
config.put<MessageCollector>(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, PrintingMessageCollector(System.err, MessageRenderer.GRADLE_STYLE, true))
+ // Our PsiMapper only works with the PSI tree elements, not with the faster (but kotlin-specific) classes
+ config.put(JVMConfigurationKeys.USE_PSI_CLASS_FILES_READING, true)
+
val environment = KotlinCoreEnvironment.createForProduction(
disposable,
config,