use of scala.tools.nsc.backend.JavaPlatform in project zeppelin by apache.
the class SparkDependencyResolver method updateCompilerClassPath.
private void updateCompilerClassPath(URL[] urls) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException {
JavaPlatform platform = (JavaPlatform) global.platform();
MergedClassPath<AbstractFile> newClassPath = mergeUrlsIntoClassPath(platform, urls);
Method[] methods = platform.getClass().getMethods();
for (Method m : methods) {
if (m.getName().endsWith("currentClassPath_$eq")) {
m.invoke(platform, new Some(newClassPath));
break;
}
}
// NOTE: Must use reflection until this is exposed/fixed upstream in Scala
List<String> classPaths = new LinkedList<>();
for (URL url : urls) {
classPaths.add(url.getPath());
}
// Reload all jars specified into our compiler
global.invalidateClassPathEntries(scala.collection.JavaConversions.asScalaBuffer(classPaths).toList());
}
Aggregations