use of org.gradle.api.internal.initialization.ClassLoaderScope in project gradle by gradle.
the class BuildSourceBuilder method buildAndCreateClassLoader.
public ClassLoaderScope buildAndCreateClassLoader(StartParameter startParameter) {
ClassPath classpath = createBuildSourceClasspath(startParameter);
ClassLoaderScope childScope = classLoaderScope.createChild(startParameter.getCurrentDir().getAbsolutePath());
childScope.export(cachedClasspathTransformer.transform(classpath));
childScope.lock();
return childScope;
}
use of org.gradle.api.internal.initialization.ClassLoaderScope 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.api.internal.initialization.ClassLoaderScope in project gradle by gradle.
the class SettingsFactory method createSettings.
public SettingsInternal createSettings(GradleInternal gradle, File settingsDir, ScriptSource settingsScript, Map<String, String> gradleProperties, StartParameter startParameter, ClassLoaderScope buildRootClassLoaderScope) {
ClassLoaderScope settingsClassLoaderScope = buildRootClassLoaderScope.createChild("settings");
ScriptHandlerInternal settingsScriptHandler = scriptHandlerFactory.create(settingsScript, settingsClassLoaderScope);
DefaultSettings settings = instantiator.newInstance(DefaultSettings.class, serviceRegistryFactory, gradle, settingsClassLoaderScope, buildRootClassLoaderScope, settingsScriptHandler, settingsDir, settingsScript, startParameter);
DynamicObject dynamicObject = ((DynamicObjectAware) settings).getAsDynamicObject();
((ExtensibleDynamicObject) dynamicObject).addProperties(gradleProperties);
return settings;
}
use of org.gradle.api.internal.initialization.ClassLoaderScope in project gradle by gradle.
the class SelfResolvingRequestPluginResolver method resolve.
@Override
public void resolve(PluginRequestInternal pluginRequest, PluginResolutionResult result) throws InvalidPluginRequestException {
if (pluginRequest instanceof SelfResolvingPluginRequest) {
ClassLoaderScope classLoaderScope = ((SelfResolvingPluginRequest) pluginRequest).getClassLoaderScope();
PluginResolution pluginResolution = new ClassPathPluginResolution(pluginRequest.getId(), classLoaderScope, EMPTY_CLASSPATH_FACTORY, pluginInspector);
result.found("injected from outer build", pluginResolution);
}
}
use of org.gradle.api.internal.initialization.ClassLoaderScope in project gradle by gradle.
the class BuildTreePreparingProjectsPreparer method prepareProjects.
@Override
public void prepareProjects(GradleInternal gradle) {
// Setup classloader for root project, all other projects will be derived from this.
SettingsInternal settings = gradle.getSettings();
ClassLoaderScope settingsClassLoaderScope = settings.getClassLoaderScope();
ClassLoaderScope buildSrcClassLoaderScope = settingsClassLoaderScope.createChild("buildSrc[" + gradle.getIdentityPath() + "]");
gradle.setBaseProjectClassLoaderScope(buildSrcClassLoaderScope);
generateDependenciesAccessorsAndAssignPluginVersions(gradle.getServices(), settings, buildSrcClassLoaderScope);
// attaches root project
buildLoader.load(gradle.getSettings(), gradle);
// Makes included build substitutions available
if (gradle.isRootBuild()) {
coordinator.registerGlobalLibrarySubstitutions();
}
// Build buildSrc and export classpath to root project
buildBuildSrcAndLockClassloader(gradle, buildSrcClassLoaderScope);
delegate.prepareProjects(gradle);
}
Aggregations