Search in sources :

Example 11 with PluginId

use of org.gradle.plugin.use.PluginId in project gradle by gradle.

the class DefaultPluginRegistry method lookup.

@Nullable
private PluginImplementation<?> lookup(PluginId pluginId, ClassLoader classLoader) {
    // Don't go up the parent chain.
    // Don't want to risk classes crossing “scope” boundaries and being non collectible.
    PluginImplementation lookup;
    if (pluginId.getNamespace() == null) {
        PluginId qualified = pluginId.withNamespace(DefaultPluginManager.CORE_PLUGIN_NAMESPACE);
        lookup = uncheckedGet(idMappings, new PluginIdLookupCacheKey(qualified, classLoader)).orNull();
        if (lookup != null) {
            return lookup;
        }
    }
    return uncheckedGet(idMappings, new PluginIdLookupCacheKey(pluginId, classLoader)).orNull();
}
Also used : PluginId(org.gradle.plugin.use.PluginId) Nullable(javax.annotation.Nullable)

Aggregations

PluginId (org.gradle.plugin.use.PluginId)11 DefaultPluginId (org.gradle.plugin.use.internal.DefaultPluginId)5 InvalidPluginRequestException (org.gradle.plugin.management.internal.InvalidPluginRequestException)3 PluginRequestInternal (org.gradle.plugin.management.internal.PluginRequestInternal)3 Collection (java.util.Collection)2 Nullable (javax.annotation.Nullable)2 PluginResolveContext (org.gradle.plugin.use.resolve.internal.PluginResolveContext)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 Maps.newLinkedHashMap (com.google.common.collect.Maps.newLinkedHashMap)1 Map (java.util.Map)1 RepositoryHandler (org.gradle.api.artifacts.dsl.RepositoryHandler)1 PluginDescriptor (org.gradle.api.internal.plugins.PluginDescriptor)1 PluginImplementation (org.gradle.api.internal.plugins.PluginImplementation)1 InvalidPluginException (org.gradle.api.plugins.InvalidPluginException)1 PluginInstantiationException (org.gradle.api.plugins.PluginInstantiationException)1 UnknownPluginException (org.gradle.api.plugins.UnknownPluginException)1 ObjectInstantiationException (org.gradle.api.reflect.ObjectInstantiationException)1 LocationAwareException (org.gradle.internal.exceptions.LocationAwareException)1 DefaultPluginRequest (org.gradle.plugin.management.internal.DefaultPluginRequest)1 AlreadyOnClasspathPluginResolver (org.gradle.plugin.use.resolve.internal.AlreadyOnClasspathPluginResolver)1