Search in sources :

Example 1 with PluginDescriptor

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

the class NotNonCorePluginOnClasspathCheckPluginResolver method resolve.

public void resolve(PluginRequestInternal pluginRequest, PluginResolutionResult result) {
    PluginId pluginId = pluginRequest.getId();
    PluginDescriptor pluginDescriptor = pluginDescriptorLocator.findPluginDescriptor(pluginId.toString());
    if (pluginDescriptor == null || isCorePlugin(pluginId)) {
        delegate.resolve(pluginRequest, result);
    } else {
        throw new InvalidPluginRequestException(pluginRequest, pluginOnClasspathErrorMessage(pluginId.toString()));
    }
}
Also used : InvalidPluginRequestException(org.gradle.plugin.management.internal.InvalidPluginRequestException) PluginDescriptor(org.gradle.api.internal.plugins.PluginDescriptor) PluginId(org.gradle.plugin.use.PluginId)

Example 2 with PluginDescriptor

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

the class JavaGradlePluginPlugin method configureJarTask.

private void configureJarTask(Project project, GradlePluginDevelopmentExtension extension) {
    Jar jarTask = (Jar) project.getTasks().findByName(JAR_TASK);
    List<PluginDescriptor> descriptors = new ArrayList<PluginDescriptor>();
    Set<String> classList = new HashSet<String>();
    PluginDescriptorCollectorAction pluginDescriptorCollector = new PluginDescriptorCollectorAction(descriptors);
    ClassManifestCollectorAction classManifestCollector = new ClassManifestCollectorAction(classList);
    PluginValidationAction pluginValidationAction = new PluginValidationAction(extension.getPlugins(), descriptors, classList);
    jarTask.filesMatching(PLUGIN_DESCRIPTOR_PATTERN, pluginDescriptorCollector);
    jarTask.filesMatching(CLASSES_PATTERN, classManifestCollector);
    jarTask.appendParallelSafeAction(pluginValidationAction);
}
Also used : PluginDescriptor(org.gradle.api.internal.plugins.PluginDescriptor) ArrayList(java.util.ArrayList) Jar(org.gradle.api.tasks.bundling.Jar) HashSet(java.util.HashSet)

Aggregations

PluginDescriptor (org.gradle.api.internal.plugins.PluginDescriptor)2 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 Jar (org.gradle.api.tasks.bundling.Jar)1 InvalidPluginRequestException (org.gradle.plugin.management.internal.InvalidPluginRequestException)1 PluginId (org.gradle.plugin.use.PluginId)1