protected ScriptHandler createScriptHandler() { ScriptHandlerFactory factory = new DefaultScriptHandlerFactory( get(DependencyManagementServices.class), get(FileResolver.class), get(DependencyMetaDataProvider.class)); return factory.create(project.getBuildScriptSource(), project.getClassLoaderScope(), project); }
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); } }