Search in sources :

Example 1 with DefaultPluginRegistry

use of org.gradle.api.internal.plugins.DefaultPluginRegistry in project gradle by gradle.

the class ClassPathPluginResolution method execute.

@Override
public void execute(PluginResolveContext pluginResolveContext) {
    ClassPath classPath = classPathFactory.create();
    ClassLoaderScope loaderScope = parent.createChild("plugin-" + pluginId.getId());
    loaderScope.local(classPath);
    loaderScope.lock();
    PluginRegistry pluginRegistry = new DefaultPluginRegistry(pluginInspector, loaderScope);
    PluginImplementation<?> plugin = pluginRegistry.lookup(pluginId);
    if (plugin == null) {
        throw new UnknownPluginException("Plugin with id '" + pluginId + "' not found.");
    }
    pluginResolveContext.add(plugin);
}
Also used : ClassPath(org.gradle.internal.classpath.ClassPath) DefaultPluginRegistry(org.gradle.api.internal.plugins.DefaultPluginRegistry) ClassLoaderScope(org.gradle.api.internal.initialization.ClassLoaderScope) PluginRegistry(org.gradle.api.internal.plugins.PluginRegistry) DefaultPluginRegistry(org.gradle.api.internal.plugins.DefaultPluginRegistry) UnknownPluginException(org.gradle.api.plugins.UnknownPluginException)

Aggregations

ClassLoaderScope (org.gradle.api.internal.initialization.ClassLoaderScope)1 DefaultPluginRegistry (org.gradle.api.internal.plugins.DefaultPluginRegistry)1 PluginRegistry (org.gradle.api.internal.plugins.PluginRegistry)1 UnknownPluginException (org.gradle.api.plugins.UnknownPluginException)1 ClassPath (org.gradle.internal.classpath.ClassPath)1