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

Ellen Spertus

09/03/2022, 1:00 AM
I'll be teaching an Intro CS class using Kotlin and want to install good habits, such as writing KDoc and running Dokka. Unfortunately, this doesn't seem to be simple in IntelliJ. The default build system apparently does not support Dokka, and it's not provided in the Gradle and Maven new project templates. I see that I could have students install the Dokka plugin and then manually apply the plugin. What is the least painful way to get new students using KDoc/Dokka? https://blog.jetbrains.com/kotlin/2021/11/dokka-beta/
I'm working on create a template project that uses Gradle but can't figure out how to include all
package.md
files, regardless of what directories they appear in (the way all source code is included, regardless of directory). I tried:
Copy code
tasks.withType<org.jetbrains.dokka.gradle.DokkaTask>().configureEach {
    dokkaSourceSets {
        named("main") {
            includes.from("package.md")
        }
    }
}
but this only looks for
package.md
in the root directory:
Copy code
C:\Users\ellen\IdeaProjects\gradle-test\package.md (The system cannot find the file specified)
How would I make it look for files named
package.md
in any
src
directory? (If
package.md
isn't a good name, please let me know a better one. I'm not planning on using modules.)
v

Vadim Mishenev

09/05/2022, 2:46 PM
Something like:
Copy code
includes.from(fileTree(project.rootDir) {
                include("src/**/package.md")
            })
🙏 1
👍 1
e

Ellen Spertus

09/06/2022, 2:45 PM
Thank you so much, @Vadim Mishenev! That did it.
👍 1
5 Views