[gradle-debian-helper] 01/07: DebianMavenPlugin.java: Let javadoc link to the local Javadoc of default-jdk

Kai-Chung Yan seamlik-guest at moszumanska.debian.org
Tue Oct 25 14:18:45 UTC 2016


This is an automated email from the git hooks/post-receive script.

seamlik-guest pushed a commit to branch master
in repository gradle-debian-helper.

commit b661462837cf61a3a5e1976bb934951d17254282
Author: Kai-Chung Yan (殷啟聰) <seamlikok at gmail.com>
Date:   Tue Oct 25 21:25:43 2016 +0800

    DebianMavenPlugin.java: Let javadoc link to the local Javadoc of default-jdk
---
 .../src/main/java/org/debian/gradle/DebianHelperPlugin.java | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/gradle-helper-plugin/src/main/java/org/debian/gradle/DebianHelperPlugin.java b/gradle-helper-plugin/src/main/java/org/debian/gradle/DebianHelperPlugin.java
index 79e9c29..d1a788b 100644
--- a/gradle-helper-plugin/src/main/java/org/debian/gradle/DebianHelperPlugin.java
+++ b/gradle-helper-plugin/src/main/java/org/debian/gradle/DebianHelperPlugin.java
@@ -22,6 +22,8 @@ import org.gradle.api.Plugin;
 import org.gradle.api.Project;
 import org.gradle.api.Task;
 import org.gradle.api.invocation.Gradle;
+import org.gradle.api.tasks.javadoc.Javadoc;
+import org.gradle.external.javadoc.StandardJavadocDocletOptions;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -35,6 +37,16 @@ public class DebianHelperPlugin implements Plugin<Gradle> {
 
     private final Logger log = LoggerFactory.getLogger(DebianHelperPlugin.class);
 
+    private void configureJavadocLinks(Project project) {
+        if (project.getPluginManager().hasPlugin("java")) {
+            Javadoc javadocTask = ((Javadoc)(project.getTasksByName("javadoc", false).toArray()[0]));
+            if (javadocTask.getOptions() instanceof StandardJavadocDocletOptions) {
+                log.info("\tConfiguring javadoc links");
+                ((StandardJavadocDocletOptions)(javadocTask.getOptions())).getLinks().add("file:///usr/share/doc/default-jdk/api", 0);
+            }
+        }
+    }
+
     @Override
     public void apply(Gradle gradle) {
         // add the Debian repository to all projects
@@ -56,6 +68,7 @@ public class DebianHelperPlugin implements Plugin<Gradle> {
                           project.task(debianMavenPomTaskOptions, "debianMavenPom");
                           ((Task)(project.getTasksByName("jar", false).toArray()[0])).dependsOn("debianMavenPom");
                       }
+                      configureJavadocLinks(project);
                     }
                 });
             }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/gradle-debian-helper.git



More information about the pkg-java-commits mailing list