mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-21 20:56:45 +01:00
feat: re-add aggregated javadocs task (#3077)
* feat: re-add aggregated javadocs task This was removed by IntellectualSites/PlotSquared#2922. Closes IntellectualSites/PlotSquared#3037. Signed-off-by: Mariell Hoversholm <proximyst@proximyst.com> * feat: aggregate javadocs on root build task Signed-off-by: Mariell Hoversholm <proximyst@proximyst.com> * Address changes requested Co-authored-by: NotMyFault <mc.cache@web.de>
This commit is contained in:
parent
8a244d12fc
commit
a6b3e97cda
@ -101,3 +101,15 @@ tasks.named<ShadowJar>("shadowJar") {
|
||||
|
||||
mergeServiceFiles()
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType<Javadoc> {
|
||||
val opt = options as StandardJavadocDocletOptions
|
||||
opt.links("https://papermc.io/javadocs/paper/1.16/")
|
||||
opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-core/7.2.5/")
|
||||
opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-bukkit/7.2.5/")
|
||||
opt.links("https://jd.adventure.kyori.net/api/4.7.0/")
|
||||
opt.links("https://google.github.io/guice/api-docs/5.0.1/javadoc/")
|
||||
opt.links("https://checkerframework.org/api/")
|
||||
}
|
||||
}
|
||||
|
@ -76,6 +76,7 @@ subprojects {
|
||||
}
|
||||
}
|
||||
|
||||
val javadocDir = rootDir.resolve("docs").resolve("javadoc").resolve(project.name)
|
||||
allprojects {
|
||||
dependencies {
|
||||
// Tests
|
||||
@ -173,7 +174,6 @@ allprojects {
|
||||
}
|
||||
}
|
||||
|
||||
val javadocDir = rootDir.resolve("docs").resolve("javadoc").resolve(project.name)
|
||||
tasks {
|
||||
named<Delete>("clean") {
|
||||
doFirst {
|
||||
@ -217,3 +217,37 @@ allprojects {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
val aggregatedJavadocs = create<Javadoc>("aggregatedJavadocs") {
|
||||
title = "${project.name} ${project.version} API"
|
||||
setDestinationDir(javadocDir)
|
||||
options.destinationDirectory = javadocDir
|
||||
|
||||
doFirst {
|
||||
javadocDir.deleteRecursively()
|
||||
}
|
||||
}.also {
|
||||
it.group = "Documentation"
|
||||
it.description = "Generate javadocs from all child projects as if it was a single project"
|
||||
}
|
||||
|
||||
subprojects.forEach { subProject ->
|
||||
subProject.afterEvaluate {
|
||||
subProject.tasks.withType<Javadoc>().forEach { task ->
|
||||
aggregatedJavadocs.source += task.source
|
||||
aggregatedJavadocs.classpath += task.classpath
|
||||
aggregatedJavadocs.excludes += task.excludes
|
||||
aggregatedJavadocs.includes += task.includes
|
||||
|
||||
val rootOptions = aggregatedJavadocs.options as StandardJavadocDocletOptions
|
||||
val subOptions = task.options as StandardJavadocDocletOptions
|
||||
rootOptions.links(*subOptions.links.orEmpty().minus(rootOptions.links.orEmpty()).toTypedArray())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
build {
|
||||
dependsOn(aggregatedJavadocs)
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
[versions]
|
||||
checker-qual = "3.13.0"
|
||||
checker-qual = "3.14.0"
|
||||
|
||||
guava = "21.0"
|
||||
gson = "2.8.0"
|
||||
|
Loading…
Reference in New Issue
Block a user