|
6 | 6 | import xsbti.AnalysisCallback; |
7 | 7 | import xsbti.Logger; |
8 | 8 | import xsbti.Reporter; |
9 | | -import xsbti.Severity; |
10 | 9 | import xsbti.compile.*; |
11 | 10 |
|
12 | 11 | import java.io.File; |
13 | 12 |
|
14 | | -import dotty.tools.dotc.core.Contexts.ContextBase; |
15 | | -import dotty.tools.dotc.Main; |
16 | | -import dotty.tools.dotc.interfaces.*; |
17 | | - |
18 | | -import java.lang.reflect.InvocationTargetException; |
19 | | -import java.net.URLClassLoader; |
20 | | - |
21 | 13 | /** |
22 | 14 | * The new compiler interface is [[dotty.tools.xsbt.CompilerBridge]] that extends the new `xsbti.CompilerInterface2`. |
23 | 15 | * This interface is kept for compatibility with Mill and the sbt 1.3.x series. |
24 | 16 | */ |
25 | 17 | public final class CompilerInterface { |
26 | 18 | public CachedCompiler newCompiler(String[] options, Output output, Logger initialLog, Reporter initialDelegate) { |
27 | | - // The classloader that sbt uses to load the compiler bridge is broken |
28 | | - // (see CompilerClassLoader#fixBridgeLoader for details). To workaround |
29 | | - // this we construct our own ClassLoader and then run the following code |
30 | | - // with it: |
31 | | - // new CachedCompilerImpl(options, output) |
32 | | - |
33 | | - try { |
34 | | - ClassLoader bridgeLoader = this.getClass().getClassLoader(); |
35 | | - ClassLoader fixedLoader = CompilerClassLoader.fixBridgeLoader(bridgeLoader); |
36 | | - Class<?> cciClass = fixedLoader.loadClass("xsbt.CachedCompilerImpl"); |
37 | | - return (CachedCompiler) cciClass.getConstructors()[0].newInstance(options, output); |
38 | | - } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | InvocationTargetException e) { |
39 | | - throw new RuntimeException(e); |
40 | | - } |
| 19 | + return new CachedCompilerImpl(options, output); |
41 | 20 | } |
42 | 21 |
|
43 | 22 | public void run(File[] sources, DependencyChanges changes, AnalysisCallback callback, Logger log, |
|
0 commit comments