aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Herzig <me@johni0702.de>2019-08-31 17:44:18 +0200
committerJonas Herzig <me@johni0702.de>2019-08-31 17:44:18 +0200
commit9e9816d54d3d05afa8df345c808d50c0381d265f (patch)
treeb97a138cfa25023204c4dbad3df3280d67135759
parentcfdc125366b756a7d164502ebcde22e2976c9319 (diff)
downloadRemap-9e9816d54d3d05afa8df345c808d50c0381d265f.tar.gz
Remap-9e9816d54d3d05afa8df345c808d50c0381d265f.tar.bz2
Remap-9e9816d54d3d05afa8df345c808d50c0381d265f.zip
Use -embeddable compiler for compatibility with kotlin gradle plugin
-rw-r--r--build.gradle.kts3
-rw-r--r--src/main/kotlin/com/replaymod/gradle/remap/PsiMapper.kt6
-rw-r--r--src/main/kotlin/com/replaymod/gradle/remap/PsiUtils.kt4
-rw-r--r--src/main/kotlin/com/replaymod/gradle/remap/Transformer.kt20
4 files changed, 17 insertions, 16 deletions
diff --git a/build.gradle.kts b/build.gradle.kts
index 12b502b..de0684b 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -17,7 +17,8 @@ repositories {
}
dependencies {
- compile("org.jetbrains.kotlin:kotlin-compiler:1.3.40")
+ compile("org.jetbrains.kotlin:kotlin-compiler-embeddable:1.3.40")
+ implementation(kotlin("stdlib"))
compile("org.cadixdev:lorenz:0.5.0")
}
diff --git a/src/main/kotlin/com/replaymod/gradle/remap/PsiMapper.kt b/src/main/kotlin/com/replaymod/gradle/remap/PsiMapper.kt
index 95ee858..0e5395a 100644
--- a/src/main/kotlin/com/replaymod/gradle/remap/PsiMapper.kt
+++ b/src/main/kotlin/com/replaymod/gradle/remap/PsiMapper.kt
@@ -1,12 +1,12 @@
package com.replaymod.gradle.remap
-import com.intellij.openapi.util.TextRange
-import com.intellij.openapi.util.text.StringUtil
-import com.intellij.psi.*
import com.replaymod.gradle.remap.PsiUtils.getSignature
import org.cadixdev.bombe.type.signature.MethodSignature
import org.cadixdev.lorenz.MappingSet
import org.cadixdev.lorenz.model.ClassMapping
+import org.jetbrains.kotlin.com.intellij.openapi.util.TextRange
+import org.jetbrains.kotlin.com.intellij.openapi.util.text.StringUtil
+import org.jetbrains.kotlin.com.intellij.psi.*
import java.util.*
internal class PsiMapper(private val map: MappingSet, private val file: PsiFile) {
diff --git a/src/main/kotlin/com/replaymod/gradle/remap/PsiUtils.kt b/src/main/kotlin/com/replaymod/gradle/remap/PsiUtils.kt
index de29956..4a435b9 100644
--- a/src/main/kotlin/com/replaymod/gradle/remap/PsiUtils.kt
+++ b/src/main/kotlin/com/replaymod/gradle/remap/PsiUtils.kt
@@ -1,7 +1,5 @@
package com.replaymod.gradle.remap
-import com.intellij.psi.*
-import com.intellij.psi.util.TypeConversionUtil
import org.cadixdev.bombe.type.ArrayType
import org.cadixdev.bombe.type.FieldType
import org.cadixdev.bombe.type.MethodDescriptor
@@ -9,6 +7,8 @@ import org.cadixdev.bombe.type.ObjectType
import org.cadixdev.bombe.type.Type
import org.cadixdev.bombe.type.VoidType
import org.cadixdev.bombe.type.signature.MethodSignature
+import org.jetbrains.kotlin.com.intellij.psi.*
+import org.jetbrains.kotlin.com.intellij.psi.util.TypeConversionUtil
internal object PsiUtils {
fun getSignature(method: PsiMethod): MethodSignature = MethodSignature(method.name, getDescriptor(method))
diff --git a/src/main/kotlin/com/replaymod/gradle/remap/Transformer.kt b/src/main/kotlin/com/replaymod/gradle/remap/Transformer.kt
index 303ee42..53713fd 100644
--- a/src/main/kotlin/com/replaymod/gradle/remap/Transformer.kt
+++ b/src/main/kotlin/com/replaymod/gradle/remap/Transformer.kt
@@ -1,15 +1,5 @@
package com.replaymod.gradle.remap
-import com.intellij.codeInsight.CustomExceptionHandler
-import com.intellij.mock.MockProject
-import com.intellij.openapi.extensions.ExtensionPoint
-import com.intellij.openapi.extensions.Extensions
-import com.intellij.openapi.util.Disposer
-import com.intellij.openapi.vfs.StandardFileSystems
-import com.intellij.openapi.vfs.VirtualFileManager
-import com.intellij.openapi.vfs.local.CoreLocalFileSystem
-import com.intellij.psi.PsiManager
-import com.intellij.psi.search.GlobalSearchScope
import com.replaymod.gradle.remap.legacy.LegacyMapping
import org.cadixdev.lorenz.MappingSet
import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
@@ -24,6 +14,16 @@ import org.jetbrains.kotlin.cli.jvm.compiler.NoScopeRecordCliBindingTrace
import org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM
import org.jetbrains.kotlin.cli.jvm.config.JavaSourceRoot
import org.jetbrains.kotlin.cli.jvm.config.JvmClasspathRoot
+import org.jetbrains.kotlin.com.intellij.codeInsight.CustomExceptionHandler
+import org.jetbrains.kotlin.com.intellij.mock.MockProject
+import org.jetbrains.kotlin.com.intellij.openapi.extensions.ExtensionPoint
+import org.jetbrains.kotlin.com.intellij.openapi.extensions.Extensions
+import org.jetbrains.kotlin.com.intellij.openapi.util.Disposer
+import org.jetbrains.kotlin.com.intellij.openapi.vfs.StandardFileSystems
+import org.jetbrains.kotlin.com.intellij.openapi.vfs.VirtualFileManager
+import org.jetbrains.kotlin.com.intellij.openapi.vfs.local.CoreLocalFileSystem
+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 java.io.BufferedReader