All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.freefair.gradle.plugins.maven.javadoc.AggregateJavadocJarPlugin Maven / Gradle / Ivy

There is a newer version: 8.11
Show newest version
package io.freefair.gradle.plugins.maven.javadoc;

import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.artifacts.Dependency;
import org.gradle.api.plugins.BasePlugin;
import org.gradle.api.plugins.JavaPlugin;
import org.gradle.api.plugins.JavaPluginExtension;
import org.gradle.api.tasks.TaskProvider;
import org.gradle.api.tasks.bundling.Jar;

@Deprecated
public class AggregateJavadocJarPlugin implements Plugin {

    private TaskProvider aggregateJavadocJar;

    @Override
    public void apply(Project project) {
        project.getPlugins().apply(LegacyAggregateJavadocPlugin.class);

        project.getPlugins().withType(LegacyAggregateJavadocPlugin.class, aggregateJavadocPlugin -> {
            aggregateJavadocJar = project.getTasks().register("aggregateJavadocJar", Jar.class, aggregateJavadocJar -> {
                aggregateJavadocJar.from(aggregateJavadocPlugin.getAggregateJavadoc());
                aggregateJavadocJar.getArchiveClassifier().set("javadoc");
                aggregateJavadocJar.setGroup(BasePlugin.BUILD_GROUP);
            });

            project.getPlugins().apply(BasePlugin.class);
            project.getArtifacts().add(Dependency.ARCHIVES_CONFIGURATION, aggregateJavadocJar);

            project.getPlugins().withType(JavaPlugin.class, javaPlugin -> {
                aggregateJavadocJar.configure(aggregateJavadocJar -> {
                    aggregateJavadocJar.getArchiveClassifier().convention("aggregateJavadoc");
                });
            });

        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy