Skip to content

Commit

Permalink
dokka to generate autogenerated lombak files
Browse files Browse the repository at this point in the history
  • Loading branch information
jeyanthanperiyasamy committed Dec 14, 2023
1 parent 8ebf0ff commit 2e1c8e5
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 5 deletions.
19 changes: 19 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

// Top-level build file where you can add configuration options common to all sub-projects/modules.
import org.jetbrains.dokka.gradle.DokkaTask

buildscript {
ext {
Expand Down Expand Up @@ -37,6 +38,24 @@ plugins {
id("org.jetbrains.dokka") version "1.9.10"
}

// Note: To configure multi-project builds, you need
// to configure Partial tasks of the subprojects.
// See "Configuration example" section of documentation.
//tasks.withType(DokkaTask.class) {
// dokkaSourceSets {
// configureEach {
// documentedVisibilities.set(
// setOf(
// org.jetbrains.dokka.DokkaConfiguration.Visibility.PUBLIC, // Same for both Kotlin and Java
// org.jetbrains.dokka.DokkaConfiguration.Visibility.PRIVATE, // Same for both Kotlin and Java
// org.jetbrains.dokka.DokkaConfiguration.Visibility.PROTECTED, // Same for both Kotlin and Java
// org.jetbrains.dokka.DokkaConfiguration.Visibility.INTERNAL, // Kotlin-specific internal modifier
// org.jetbrains.dokka.DokkaConfiguration.Visibility.PACKAGE, // Java-specific package-private visibility
// )
// )
// }
// }
//}

allprojects {
configurations.all {
Expand Down
25 changes: 20 additions & 5 deletions config/kdoc.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ task delombok {
classname: 'lombok.delombok.ant.Tasks$Delombok',
classpath: configurations.delombok.asPath)
ant.delombok(verbose: 'true', from: srcJava, to: "$buildDir/src-delomboked")
copy {
from "$buildDir/src-delomboked"
into "src/main/java"
}
}
}

Expand All @@ -41,8 +45,8 @@ dokkaJavadoc {
named("main") {
displayName.set(name)
outputDirectory = file("build/javadoc/$project.name-dokka")
sourceDirs = files("$buildDir/src-delomboked")
sourceRoots.setFrom(file("$buildDir/src-delomboked"))
// sourceDirs = files("$buildDir/src-delomboked")
// sourceRoots.setFrom(file("$buildDir/src-delomboked"))
reportUndocumented.set(false)
skipEmptyPackages.set(true)
skipDeprecated.set(false)
Expand All @@ -53,6 +57,12 @@ dokkaJavadoc {
suppress.set(false)
}
}
doLast {
exec {
workingDir project.rootDir
commandLine 'git', 'checkout', '.'
}
}
}

tasks.named("dokkaHtml").configure {
Expand All @@ -66,14 +76,19 @@ dokkaHtml {
dokkaSourceSets {
named("main") {
outputDirectory = file("build/html/$project.name-dokka")
sourceDirs = files("$buildDir/src-delomboked")
sourceRoots.setFrom(file("$buildDir/src-delomboked"))
// sourceDirs = files("$buildDir/src-delomboked")
// sourceRoots.setFrom(file("$buildDir/src-delomboked"))
noAndroidSdkLink.set(false)
includeNonPublic.set(true)
skipEmptyPackages.set(true)
reportUndocumented.set(true)
skipDeprecated.set(false)

}
}
doLast {
exec {
workingDir project.rootDir
commandLine 'git', 'checkout', '.'
}
}
}
Expand Down

0 comments on commit 2e1c8e5

Please sign in to comment.