How to invoke kdoc?


is there a documenation or example how to setup and invoke kdoc with gradle? The kdoc target opens a prompt, but I’ve currently no idea how to setup/invoke something.


Unfortunately, KDoc is not really usable from the command line at the moment. The closest you can get to running it is:

java -cp kdoc-0.6.800.jar:pegdown-1.4.1.jar:kotlin-compiler-0.6.800.jar org.jetbrains.kotlin.doc.DocPackage -docOutput . -src foo.kt

But then it complains about wrong command line arguments, which it actually is not parsing properly.

We use KDoc from Maven:

Ok, thanks. I think I'll go with the maven plugin for now. Is there also such a thing for ant?

Ok, I've tried the kdoc maven plugin with a configuration that follows the one at your link. I had little success. Documentation gets generated, but all classes and traits are excluded from the docs. Only packages and package-level function are documented. What is it that I'm missing here?

I've found the problem. I had to specify the classes explicitly as public.