Skip to content

Commit

Permalink
Remove deprecated sources- and javadoc-Jar plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
larsgrefer committed Apr 10, 2021
1 parent f33f907 commit fd3551a
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 185 deletions.
12 changes: 0 additions & 12 deletions maven-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,6 @@ gradlePlugin {
id = "io.freefair.war-archive-classes"
implementationClass = "io.freefair.gradle.plugins.maven.war.WarArchiveClassesPlugin"
}
sourcesJar {
id = "io.freefair.sources-jar"
implementationClass = "io.freefair.gradle.plugins.maven.SourcesJarPlugin"
}
javadocJar {
id = "io.freefair.javadoc-jar"
implementationClass = "io.freefair.gradle.plugins.maven.javadoc.JavadocJarPlugin"
}
mavenJars {
id = "io.freefair.maven-jars"
implementationClass = "io.freefair.gradle.plugins.maven.MavenJarsPlugin"
}
aggregateJavadoc {
id = "io.freefair.aggregate-javadoc"
implementationClass = "io.freefair.gradle.plugins.maven.javadoc.AggregateJavadocPlugin"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package io.freefair.gradle.plugins.maven;

import io.freefair.gradle.plugins.maven.javadoc.JavadocJarPlugin;
import lombok.Getter;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.component.SoftwareComponent;
import org.gradle.api.publish.PublishingExtension;
import org.gradle.api.publish.maven.MavenPublication;
import org.gradle.api.publish.maven.plugins.MavenPublishPlugin;
import org.gradle.api.tasks.bundling.Jar;
import org.gradle.plugins.signing.SigningExtension;
import org.gradle.plugins.signing.SigningPlugin;

Expand All @@ -33,16 +31,6 @@ public void apply(Project project) {
project.afterEvaluate(p -> {
publication.from(getSoftwareComponent());

project.getPlugins().withType(SourcesJarPlugin.class, sourcesJarPlugin -> {
Jar sourcesJar = sourcesJarPlugin.getSourcesJar().get();
publication.artifact(sourcesJar);
});

project.getPlugins().withType(JavadocJarPlugin.class, javadocJarPlugin -> {
Jar javadocJar = javadocJarPlugin.getJavadocJar().get();
publication.artifact(javadocJar);
});

project.getPlugins().withType(SigningPlugin.class, signingPlugin -> project.getExtensions()
.getByType(SigningExtension.class)
.sign(publication)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,44 @@

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.JavaPluginConvention;
import org.gradle.api.tasks.TaskProvider;
import org.gradle.api.tasks.bundling.Jar;

import java.io.File;

public class AggregateJavadocJarPlugin implements Plugin<Project> {

private TaskProvider<Jar> aggregateJavadocJar;

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

project.getPlugins().withType(AggregateJavadocPlugin.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");
aggregateJavadocJar.getDestinationDirectory().set(new File(
project.getConvention().getPlugin(JavaPluginConvention.class).getDocsDir(),
"aggregateJavadoc"
));
});
});

});
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
/**
* @author Lars Grefer
* @see JavadocLinksPlugin
* @see JavadocJarPlugin
*/
public class JavadocsPlugin implements Plugin<Project> {

@Override
public void apply(Project project) {
project.getPluginManager().apply(JavadocLinksPlugin.class);
project.getPluginManager().apply(JavadocJarPlugin.class);
project.getPluginManager().apply(JavadocUtf8Plugin.class);
}
}

This file was deleted.

0 comments on commit fd3551a

Please sign in to comment.