use of org.gradle.api.initialization.dsl.ScriptHandler in project gradle by gradle.
the class DefaultObjectConfigurationAction method applyScript.
private void applyScript(Object script) {
URI scriptUri = resolver.resolveUri(script);
ScriptSource scriptSource = new UriScriptSource("script", scriptUri);
ClassLoaderScope classLoaderScopeChild = classLoaderScope.createChild("script-" + scriptUri.toString());
ScriptHandler scriptHandler = scriptHandlerFactory.create(scriptSource, classLoaderScopeChild);
ScriptPlugin configurer = configurerFactory.create(scriptSource, scriptHandler, classLoaderScopeChild, classLoaderScope, false);
for (Object target : targets) {
configurer.apply(target);
}
}
use of org.gradle.api.initialization.dsl.ScriptHandler in project gradle by gradle.
the class ScriptEvaluatingSettingsProcessor method applySettingsScript.
private void applySettingsScript(SettingsLocation settingsLocation, final SettingsInternal settings) {
ScriptSource settingsScriptSource = settingsLocation.getSettingsScriptSource();
ClassLoaderScope settingsClassLoaderScope = settings.getClassLoaderScope();
ScriptHandler scriptHandler = scriptHandlerFactory.create(settingsScriptSource, settingsClassLoaderScope);
ScriptPlugin configurer = configurerFactory.create(settingsScriptSource, scriptHandler, settingsClassLoaderScope, settings.getRootClassLoaderScope(), true);
configurer.apply(settings);
}
use of org.gradle.api.initialization.dsl.ScriptHandler in project gradle by gradle.
the class DefaultInitScriptProcessor method process.
public void process(final ScriptSource initScript, GradleInternal gradle) {
ClassLoaderScope baseScope = gradle.getClassLoaderScope();
URI uri = initScript.getResource().getLocation().getURI();
String id = uri == null ? idGenerator.generateId().toString() : uri.toString();
ClassLoaderScope scriptScope = baseScope.createChild("init-" + id);
ScriptHandler scriptHandler = scriptHandlerFactory.create(initScript, scriptScope);
ScriptPlugin configurer = configurerFactory.create(initScript, scriptHandler, scriptScope, baseScope, true);
configurer.apply(gradle);
}
Aggregations