How to invoke kdoc?


#1

Hi,

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.

Best,
Philipp


#2

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: https://github.com/JetBrains/kotlin/blob/rr/jdr/libraries/docs/apidoc/pom.xml#L39-39


#3

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


#4

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?


#5

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