Hello, I am getting started with dokka-analysis an...
# dokka
j
Hello, I am getting started with dokka-analysis and I am looking for the recommended way to create a DokkaSourceSet. Unfortunately there is no documentation for dokka-analysis, but poking around, I found DokkaSourceSetBuilder. But the only blog post about it, actually uses DokkaSourceSetImpl... which seems a bit awkward to me. So is there any builder or companion fun to create a source-set ?
m
`DokkaSourceSetImpl`is the default implementation used in dokka and this probably won’t change soon. If you are not comfortable with using it nothing (or at least i hope nothing) is preventing you from creating your own implementation of that interface
j
Thank you, so I guess I will use it.. it was just the 'Impl' postfix which made me a bit worried 🙂
Copy code
DokkaSourceSet.languageVersion
is it the Kotlin version ? like "1.4.32" ?
m
It should be something like
1.4
unless you are doing something that is really specific for some kotlin feature set you can omit this field. We are using it to setup analysis and if not provided it will be set by default to latest stable. In fact i can’t even recall when was the last time i needed to set it up in community project
j
Ok. and one last question: I just ran a visitor (extracting class names) over an intentionally broken source-set (a class has bad syntax.. missing it's closing curly brace), and dokka-analysis did not report any errors.. which is kinda nice of course, but unexpected. So is dokka-analysis not 'fully' compiling the sourceSet ?
m
No, we don’t rely on code “fully” compiling therefore we can analyse slightly broken code. Ofc the output of this analysis will be corrupted but at least we get some data
j
would there be any message/result/exception/type anywhere for knowing when analysis is corrupted ?
m
Unfortunately no, we don’t get this information from language artifacts that we use so we can’t pass it to the user