private void applyScript(Object script) {
URI scriptUri = resolver.resolveUri(script);
UriScriptSource scriptSource = new UriScriptSource("script", scriptUri);
ClassLoaderScope classLoaderScopeChild = classLoaderScope.createChild();
ScriptHandler scriptHandler = scriptHandlerFactory.create(scriptSource, classLoaderScopeChild);
ScriptPlugin configurer = configurerFactory.create(scriptSource, scriptHandler, classLoaderScopeChild, classLoaderScope, "buildscript", DefaultScript.class, false);
for (Object target : targets) {
configurer.apply(target);
}
}