Eliminated JetCoreEnvironment.configure() method. Actual setting classpath/annotations path is performed in constructor instead.
This commit is contained in:
@@ -152,14 +152,6 @@ public class K2JVMCompiler extends CLICompiler<K2JVMCompilerArguments, K2JVMComp
|
||||
return super.exec(errStream, arguments);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void configureEnvironment(@NotNull K2JVMCompileEnvironmentConfiguration configuration, @NotNull K2JVMCompilerArguments arguments) {
|
||||
super.configureEnvironment(configuration, arguments);
|
||||
|
||||
configuration.getEnvironment().configure(createCompilerConfiguration(arguments));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static CompilerConfiguration createCompilerConfiguration(@NotNull K2JVMCompilerArguments arguments) {
|
||||
CompilerConfiguration configuration = new CompilerConfiguration();
|
||||
|
||||
@@ -82,7 +82,12 @@ public class JetCoreEnvironment extends JavaCoreEnvironment {
|
||||
annotationsProvider = new CoreAnnotationsProvider();
|
||||
myProject.registerService(ExternalAnnotationsProvider.class, annotationsProvider);
|
||||
|
||||
configure(configuration);
|
||||
for (File path : configuration.getList(JVMConfigurationKeys.CLASSPATH_KEY)) {
|
||||
addToClasspath(path);
|
||||
}
|
||||
for (File path : configuration.getList(JVMConfigurationKeys.ANNOTATIONS_PATH_KEY)) {
|
||||
addExternalAnnotationsRoot(PathUtil.jarFileOrDirectoryToVirtualFile(path));
|
||||
}
|
||||
|
||||
JetStandardLibrary.initialize(getProject());
|
||||
}
|
||||
@@ -166,19 +171,4 @@ public class JetCoreEnvironment extends JavaCoreEnvironment {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void configure(@NotNull CompilerConfiguration compilerConfiguration) {
|
||||
List<File> classpath = compilerConfiguration.get(JVMConfigurationKeys.CLASSPATH_KEY);
|
||||
List<File> annotationsPath = compilerConfiguration.get(JVMConfigurationKeys.ANNOTATIONS_PATH_KEY);
|
||||
if (classpath != null) {
|
||||
for (File path : classpath) {
|
||||
addToClasspath(path);
|
||||
}
|
||||
}
|
||||
if (annotationsPath != null) {
|
||||
for (File path : annotationsPath) {
|
||||
addExternalAnnotationsRoot(PathUtil.jarFileOrDirectoryToVirtualFile(path));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,6 @@ public class ReplInterpreter {
|
||||
|
||||
public ReplInterpreter(@NotNull Disposable disposable, @NotNull CompilerConfiguration configuration) {
|
||||
jetCoreEnvironment = new JetCoreEnvironment(disposable, configuration);
|
||||
jetCoreEnvironment.configure(configuration);
|
||||
Project project = jetCoreEnvironment.getProject();
|
||||
trace = new BindingTraceContext();
|
||||
module = new ModuleDescriptor(Name.special("<repl>"));
|
||||
|
||||
Reference in New Issue
Block a user