scriptType = type;
return this;
}
public void apply(Object target) {
DefaultServiceRegistry services = new DefaultServiceRegistry();
services.add(ScriptPluginFactory.class, DefaultScriptPluginFactory.this);
services.add(LoggingManagerInternal.class, loggingManagerFactory.create());
ScriptAware scriptAware = null;
if (target instanceof ScriptAware) {
scriptAware = (ScriptAware) target;
scriptAware.beforeCompile(this);
}
ScriptClassLoaderProvider classLoaderProvider = this.classLoaderProvider;
ScriptSource withImports = importsReader.withImports(scriptSource);
if (classLoaderProvider == null) {
ScriptHandlerInternal defaultScriptHandler = scriptHandlerFactory.create(withImports, classLoader);
services.add(ScriptHandlerInternal.class, defaultScriptHandler);
classLoaderProvider = defaultScriptHandler;
}
ScriptCompiler compiler = scriptCompilerFactory.createCompiler(withImports);