aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/replaymod/gradle/remap
diff options
context:
space:
mode:
authorJonas Herzig <me@johni0702.de>2019-06-22 16:15:16 +0200
committerJonas Herzig <me@johni0702.de>2019-06-23 14:41:13 +0200
commitd2c7f45a0f31bc6e7dbe460f69f5f09f42cadf02 (patch)
tree6dcd729fdd2b33d5860cb6051971b877726f1083 /src/main/java/com/replaymod/gradle/remap
parent14c120609607cd9f74cfd411cfae80017ea4c4ab (diff)
downloadRemap-d2c7f45a0f31bc6e7dbe460f69f5f09f42cadf02.tar.gz
Remap-d2c7f45a0f31bc6e7dbe460f69f5f09f42cadf02.tar.bz2
Remap-d2c7f45a0f31bc6e7dbe460f69f5f09f42cadf02.zip
Allow external usage of Transformer (still subject to change)
Diffstat (limited to 'src/main/java/com/replaymod/gradle/remap')
-rw-r--r--src/main/java/com/replaymod/gradle/remap/Transformer.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/com/replaymod/gradle/remap/Transformer.java b/src/main/java/com/replaymod/gradle/remap/Transformer.java
index 8a9ec9c..5b25856 100644
--- a/src/main/java/com/replaymod/gradle/remap/Transformer.java
+++ b/src/main/java/com/replaymod/gradle/remap/Transformer.java
@@ -4,6 +4,7 @@ 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.extensions.ExtensionsArea;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.vfs.StandardFileSystems;
import com.intellij.openapi.vfs.VirtualFile;
@@ -42,7 +43,7 @@ import java.util.Map.Entry;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-class Transformer {
+public class Transformer {
private MappingSet map;
private String[] classpath;
private boolean fail;
@@ -131,7 +132,10 @@ class Transformer {
config,
EnvironmentConfigFiles.JVM_CONFIG_FILES
);
- Extensions.getRootArea().registerExtensionPoint(CustomExceptionHandler.KEY.getName(), CustomExceptionHandler.class.getName(), ExtensionPoint.Kind.INTERFACE);
+ ExtensionsArea rootArea = Extensions.getRootArea();
+ if (!rootArea.hasExtensionPoint(CustomExceptionHandler.KEY)) {
+ rootArea.registerExtensionPoint(CustomExceptionHandler.KEY.getName(), CustomExceptionHandler.class.getName(), ExtensionPoint.Kind.INTERFACE);
+ }
MockProject project = (MockProject) environment.getProject();