https://kotlinlang.org logo
#dokka
Title
# dokka
j

Jey

12/13/2023, 3:50 PM
#dokka hello team , i have a kotlin and java combined multimodule opensource library SDK project.. and we use lombak in all java class. when generating a docs we delombak the package (org.example.com) from
src/main/java
and move the delombaked version of package in a separate folder
build/src-delombak
. i need to generate a doc for that source presented in the new folder. when i changed the sourceRoots its always generating docs from root folder ``src/main/java`` Example: root build.gradle - https://github.com/ForgeRock/forgerock-android-sdk/blob/develop/build.gradle
Copy code
plugins {
    id("org.jetbrains.dokka") version "1.9.10"
}
submodule library build.gradle - https://github.com/ForgeRock/forgerock-android-sdk/blob/develop/config/kdoc.gradle#L65
Copy code
apply plugin: "org.jetbrains.dokka"

dokkaHtml.dependsOn delombok

dokkaHtml {
    dokkaSourceSets {
        named("main") {
           outputDirectory = file("build/html/$project.name-dokka")
            sourceDirs = files("$buildDir/src-delomboked") // not works 
            sourceRoots.setFrom(file("$buildDir/src-delomboked")) // not works 
        }
    }
}
./gradle dokkaHtml (this will delombak first and will create a doc) How do i fix this issue by pointing to the source presented in different folder ?
o

Oleg Yukhnevich

01/02/2024, 12:41 PM
Hey!
sourceRoots.setFrom(file("$buildDir/src-delomboked"))
is the right way to do this Though, you need to remove line
sourceDirs = files("$buildDir/src-delomboked")
- for some reason it compiles in groovy DSL, but there is no such configuration option and for some reason it just breaks - most likely it somehow ignores the exception (that
sourceDirs
is undefined) because if to replace
named("main") {...}
with just
main {...}
you will see an error thrown, that
sourceDire
is an unknown property
👍 1
j

Jey

01/05/2024, 4:38 PM
Thanks a lot . I will try this and get back you
3 Views