-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Collect javadocClasspaths in their respective projects
- Loading branch information
1 parent
a16caae
commit f0dd63f
Showing
3 changed files
with
43 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
.../src/main/java/io/freefair/gradle/plugins/maven/javadoc/AggregateJavadocClientPlugin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package io.freefair.gradle.plugins.maven.javadoc; | ||
|
||
import lombok.Getter; | ||
import org.gradle.api.Plugin; | ||
import org.gradle.api.Project; | ||
import org.gradle.api.Task; | ||
import org.gradle.api.file.ConfigurableFileCollection; | ||
import org.gradle.api.plugins.JavaPlugin; | ||
import org.gradle.api.tasks.TaskProvider; | ||
import org.gradle.api.tasks.javadoc.Javadoc; | ||
|
||
class AggregateJavadocClientPlugin implements Plugin<Project> { | ||
|
||
@Getter | ||
private ConfigurableFileCollection javadocClasspath; | ||
|
||
@Getter | ||
private TaskProvider<Task> collectJavadocClasspath; | ||
|
||
@Override | ||
public void apply(Project project) { | ||
collectJavadocClasspath = project.getTasks().register("collectJavadocClasspath"); | ||
javadocClasspath = project.files().builtBy(collectJavadocClasspath); | ||
|
||
project.getPlugins().withType(JavaPlugin.class, javaPlugin -> { | ||
collectJavadocClasspath.configure(c -> { | ||
c.doFirst(t -> { | ||
Javadoc javadoc = (Javadoc) project.getTasks().getByName(JavaPlugin.JAVADOC_TASK_NAME); | ||
javadocClasspath.from(javadoc.getClasspath().getFiles()); | ||
}); | ||
}); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters