use of org.gradle.configuration.ScriptPlugin 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();
ScriptPlugin configurer = configurerFactory.create(settingsScriptSource, settings.getBuildscript(), settingsClassLoaderScope, settings.getRootClassLoaderScope(), true);
configurer.apply(settings);
}
use of org.gradle.configuration.ScriptPlugin in project gradle by gradle.
the class DefaultObjectConfigurationAction method applyScript.
private void applyScript(Object script) {
URI scriptUri = resolver.resolveUri(script);
TextResource resource;
if (script instanceof TextResource) {
resource = (TextResource) script;
} else {
HttpRedirectVerifier redirectVerifier = createHttpRedirectVerifier(scriptUri);
resource = textUriFileResourceLoaderFactory.create(redirectVerifier).loadUri("script", scriptUri);
}
ScriptSource scriptSource = new TextResourceScriptSource(resource);
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.configuration.ScriptPlugin in project gradle by gradle.
the class BuildScriptProcessor method execute.
@Override
public void execute(final ProjectInternal project) {
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Evaluating {} using {}.", project, project.getBuildScriptSource().getDisplayName());
}
final Timer clock = Time.startTimer();
try {
final ScriptPlugin configurer = configurerFactory.create(project.getBuildScriptSource(), project.getBuildscript(), project.getClassLoaderScope(), project.getBaseClassLoaderScope(), true);
project.getOwner().applyToMutableState(configurer::apply);
} finally {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Timing: Running the build script took {}", clock.getElapsed());
}
}
}
use of org.gradle.configuration.ScriptPlugin in project gradle by gradle.
the class ScriptEvaluatingSettingsProcessor method applySettingsScript.
private void applySettingsScript(TextResourceScriptSource settingsScript, final SettingsInternal settings) {
ScriptPlugin configurer = configurerFactory.create(settingsScript, settings.getBuildscript(), settings.getClassLoaderScope(), settings.getBaseClassLoaderScope(), true);
configurer.apply(settings);
}
Aggregations