Search in sources :

Example 1 with PluginDeclaration

use of org.gradle.plugin.devel.PluginDeclaration in project gradle by gradle.

the class MavenPluginPublishingRules method addMarkerPublications.

@Finalize
public void addMarkerPublications(PublishingExtension publishing, GradlePluginDevelopmentExtension pluginDevelopment) {
    if (!pluginDevelopment.isAutomatedPublishing()) {
        return;
    }
    PublicationContainer publications = publishing.getPublications();
    NamedDomainObjectContainer<PluginDeclaration> declaredPlugins = pluginDevelopment.getPlugins();
    for (PluginDeclaration declaration : declaredPlugins) {
        createMavenMarkerPublication(declaration, (MavenPublication) publications.getByName("pluginMaven"), publications);
    }
}
Also used : PluginDeclaration(org.gradle.plugin.devel.PluginDeclaration) PublicationContainer(org.gradle.api.publish.PublicationContainer) Finalize(org.gradle.model.Finalize)

Example 2 with PluginDeclaration

use of org.gradle.plugin.devel.PluginDeclaration in project gradle by gradle.

the class GeneratePluginDescriptors method generatePluginDescriptors.

@TaskAction
public void generatePluginDescriptors() {
    clearOutputDirectory();
    for (PluginDeclaration declaration : getDeclarations()) {
        File descriptorFile = new File(getOutputDirectory(), declaration.getId() + ".properties");
        Properties properties = new Properties();
        properties.setProperty("implementation-class", declaration.getImplementationClass());
        writePropertiesTo(properties, descriptorFile);
    }
}
Also used : PluginDeclaration(org.gradle.plugin.devel.PluginDeclaration) Properties(java.util.Properties) File(java.io.File) TaskAction(org.gradle.api.tasks.TaskAction)

Example 3 with PluginDeclaration

use of org.gradle.plugin.devel.PluginDeclaration in project gradle by gradle.

the class IvyPluginPublishingRules method addMarkerPublications.

@Finalize
public void addMarkerPublications(PublishingExtension publishing, GradlePluginDevelopmentExtension pluginDevelopment) {
    if (!pluginDevelopment.isAutomatedPublishing()) {
        return;
    }
    PublicationContainer publications = publishing.getPublications();
    NamedDomainObjectContainer<PluginDeclaration> declaredPlugins = pluginDevelopment.getPlugins();
    for (PluginDeclaration declaration : declaredPlugins) {
        createIvyMarkerPublication(declaration, (IvyPublication) publications.getByName("pluginIvy"), publications);
    }
}
Also used : PluginDeclaration(org.gradle.plugin.devel.PluginDeclaration) PublicationContainer(org.gradle.api.publish.PublicationContainer) Finalize(org.gradle.model.Finalize)

Aggregations

PluginDeclaration (org.gradle.plugin.devel.PluginDeclaration)3 PublicationContainer (org.gradle.api.publish.PublicationContainer)2 Finalize (org.gradle.model.Finalize)2 File (java.io.File)1 Properties (java.util.Properties)1 TaskAction (org.gradle.api.tasks.TaskAction)1