* @param cc
* @return the new expanded classloader
*/
private ClassLoader expandClassLoader(ClassLoader cl, CompilerConfiguration cc) {
if ((classpath != null) && classpath.size() > 0) {
cl = new GroovyClassLoader(cl, cc);
for(GroovyScriptPath path : classpath) {
((GroovyClassLoader)cl).addURL(path.asURL());
}
}
List<GroovyScriptPath> globalClasspath = getDescriptor().getDefaultClasspath();
if ((globalClasspath != null) && (globalClasspath.size() > 0)) {
if (!(cl instanceof GroovyClassLoader)) {
cl = new GroovyClassLoader(cl, cc);
}
for(GroovyScriptPath path : globalClasspath) {
((GroovyClassLoader)cl).addURL(path.asURL());
}
}