add stdlib to repl classpath

This commit is contained in:
Stepan Koltsov
2012-06-09 00:19:34 +04:00
parent b104d70196
commit bc82284d83
@@ -100,20 +100,21 @@ public class ReplInterpreter {
Collections.<AnalyzerScriptParameter>emptyList()); Collections.<AnalyzerScriptParameter>emptyList());
injector = new InjectorForTopDownAnalyzerForJvm(project, topDownAnalysisParameters, trace, module, compilerDependencies); injector = new InjectorForTopDownAnalyzerForJvm(project, topDownAnalysisParameters, trace, module, compilerDependencies);
if (extraClasspath.size() > 0) { List<URL> classpath = Lists.newArrayList();
URL[] urls = new URL[extraClasspath.size()];
for (int i = 0; i < extraClasspath.size(); ++i) { try {
try { if (compilerDependencies.getRuntimeJar() != null) {
urls[i] = extraClasspath.get(i).toURI().toURL(); classpath.add(compilerDependencies.getRuntimeJar().toURI().toURL());
} catch (Exception e) {
throw ExceptionUtils.rethrow(e); for (File extra : extraClasspath) {
classpath.add(extra.toURI().toURL());
} }
} }
classLoader = new ReplClassLoader(new URLClassLoader(urls)); } catch (Exception e) {
} throw ExceptionUtils.rethrow(e);
else {
classLoader = new ReplClassLoader();
} }
classLoader = new ReplClassLoader(new URLClassLoader(classpath.toArray(new URL[0])));
} }
public Object eval(@NotNull String line) { public Object eval(@NotNull String line) {