public ScriptSource getSource() {
return scriptSource;
}
public void apply(final Object target) {
DefaultServiceRegistry services = new DefaultServiceRegistry();
services.add(ScriptPluginFactory.class, DefaultScriptPluginFactory.this);
services.add(ScriptHandlerFactory.class, scriptHandlerFactory);
services.add(ClassLoaderScope.class, targetScope);
services.add(LoggingManagerInternal.class, loggingManagerFactory.create());
services.add(Instantiator.class, instantiator);
services.add(ScriptHandler.class, scriptHandler);
services.add(FileLookup.class, fileLookup);
services.add(ModelRuleSourceDetector.class, modelRuleSourceDetector);
ScriptSource withImports = importsReader.withImports(scriptSource);
PluginDependenciesService pluginDependenciesService = new PluginDependenciesService(getSource());
services.add(PluginDependenciesService.class, pluginDependenciesService);
ScriptCompiler compiler = scriptCompilerFactory.createCompiler(withImports);
compiler.setClassloader(baseScope.getExportClassLoader());
boolean supportsPluginsBlock = ProjectScript.class.isAssignableFrom(scriptType);