Got rid of storing CompilerDependencies in JetCoreEnvironment (storing CompilerSpecialMode instead).
This commit is contained in:
@@ -65,12 +65,12 @@ public class JetCoreEnvironment extends JavaCoreEnvironment {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private final CompilerDependencies compilerDependencies;
|
||||
private final CompilerSpecialMode compilerSpecialMode;
|
||||
|
||||
public JetCoreEnvironment(Disposable parentDisposable, @NotNull CompilerDependencies compilerDependencies) {
|
||||
super(parentDisposable);
|
||||
|
||||
this.compilerDependencies = compilerDependencies;
|
||||
this.compilerSpecialMode = compilerDependencies.getCompilerSpecialMode();
|
||||
|
||||
registerFileType(JetFileType.INSTANCE, "kt");
|
||||
registerFileType(JetFileType.INSTANCE, "kts");
|
||||
@@ -189,8 +189,8 @@ public class JetCoreEnvironment extends JavaCoreEnvironment {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public CompilerDependencies getCompilerDependencies() {
|
||||
return compilerDependencies;
|
||||
public CompilerSpecialMode getCompilerSpecialMode() {
|
||||
return compilerSpecialMode;
|
||||
}
|
||||
|
||||
public void configure(@NotNull CompilerConfiguration compilerConfiguration) {
|
||||
|
||||
+3
-5
@@ -19,7 +19,6 @@ package org.jetbrains.jet.cli.jvm.compiler;
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.testFramework.LightVirtualFile;
|
||||
import com.intellij.util.LocalTimeCounter;
|
||||
@@ -37,7 +36,6 @@ import org.jetbrains.jet.cli.common.messages.CompilerMessageLocation;
|
||||
import org.jetbrains.jet.cli.common.messages.CompilerMessageSeverity;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.psi.JetPsiUtil;
|
||||
import org.jetbrains.jet.lang.resolve.java.CompilerDependencies;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
import org.jetbrains.jet.lang.resolve.AnalyzerScriptParameter;
|
||||
import org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM;
|
||||
@@ -260,7 +258,7 @@ public class KotlinToJVMBytecodeCompiler {
|
||||
|
||||
@Nullable
|
||||
public static GenerationState analyzeAndGenerate(K2JVMCompileEnvironmentConfiguration configuration) {
|
||||
return analyzeAndGenerate(configuration, configuration.getEnvironment().getCompilerDependencies().getCompilerSpecialMode().isStubs());
|
||||
return analyzeAndGenerate(configuration, configuration.getEnvironment().getCompilerSpecialMode().isStubs());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -299,7 +297,7 @@ public class KotlinToJVMBytecodeCompiler {
|
||||
environment.getSourceFiles(),
|
||||
scriptParameters,
|
||||
filesToAnalyzeCompletely,
|
||||
configuration.getEnvironment().getCompilerDependencies().getCompilerSpecialMode());
|
||||
configuration.getEnvironment().getCompilerSpecialMode());
|
||||
}
|
||||
}, environment.getSourceFiles()
|
||||
);
|
||||
@@ -322,7 +320,7 @@ public class KotlinToJVMBytecodeCompiler {
|
||||
};
|
||||
GenerationState generationState = new GenerationState(project, ClassBuilderFactories.binaries(stubs), backendProgress,
|
||||
exhaust, environment.getSourceFiles(),
|
||||
configuration.getEnvironment().getCompilerDependencies().getCompilerSpecialMode());
|
||||
configuration.getEnvironment().getCompilerSpecialMode());
|
||||
generationState.compileCorrectFiles(CompilationErrorHandler.THROW_EXCEPTION);
|
||||
|
||||
List<CompilerPlugin> plugins = configuration.getCompilerPlugins();
|
||||
|
||||
@@ -247,7 +247,7 @@ public class ReplInterpreter {
|
||||
|
||||
GenerationState generationState = new GenerationState(jetCoreEnvironment.getProject(), ClassBuilderFactories.binaries(false), backendProgress,
|
||||
AnalyzeExhaust.success(trace.getBindingContext()), Collections.singletonList(psiFile),
|
||||
jetCoreEnvironment.getCompilerDependencies().getCompilerSpecialMode());
|
||||
jetCoreEnvironment.getCompilerSpecialMode());
|
||||
generationState.compileScript(psiFile.getScript(), scriptClassName, earierScripts, CompilationErrorHandler.THROW_EXCEPTION);
|
||||
|
||||
for (String file : generationState.getFactory().files()) {
|
||||
|
||||
Reference in New Issue
Block a user