From d2c7f45a0f31bc6e7dbe460f69f5f09f42cadf02 Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Sat, 22 Jun 2019 16:15:16 +0200 Subject: Allow external usage of Transformer (still subject to change) --- src/main/java/com/replaymod/gradle/remap/Transformer.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/main/java/com') 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(); -- cgit