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 {
urls[i] = extraClasspath.get(i).toURI().toURL(); if (compilerDependencies.getRuntimeJar() != null) {
classpath.add(compilerDependencies.getRuntimeJar().toURI().toURL());
for (File extra : extraClasspath) {
classpath.add(extra.toURI().toURL());
}
}
} catch (Exception e) { } catch (Exception e) {
throw ExceptionUtils.rethrow(e); throw ExceptionUtils.rethrow(e);
} }
}
classLoader = new ReplClassLoader(new URLClassLoader(urls)); classLoader = new ReplClassLoader(new URLClassLoader(classpath.toArray(new URL[0])));
}
else {
classLoader = new ReplClassLoader();
}
} }
public Object eval(@NotNull String line) { public Object eval(@NotNull String line) {