Kotlin / dokka

API documentation engine for Kotlin
https://kotl.in/dokka
Apache License 2.0
3.42k stars 405 forks source link

[K2] Support KMP projects #3137

Open vmishenev opened 1 year ago

vmishenev commented 1 year ago

This issue is part of a larger issue: Migrate Dokka's analysis to K2 compiler (#2888).

Goal

Dokka should be able to generate documentation for all Kotlin Multiplatform projects.

That includes, but not limited to:

The documentation generated for such projects by K1 and K2 analyses should not have significant and breaking differences.

Sub-tasks

Upstream issues

IgnatBeresnev commented 1 year ago

Current status

The analysis of multiplatform (.klib ) libraries cannot be implemented due to the needed K2 API being only partially implemented.

Blocking issue: KT-61371 - Analysis API standalone: register compiler symbol provider for libraries in standalone mode

Blocking issue's due date: around the release of Kotlin 1.9.20. It's unlikely that the fix we need will be part of Kotlin 1.9.20 itself, but it should be out at around that time, so we'll likely have to depend on a -dev artifact of either 1.9.20 (if it's backported into a custom branch) or of whatever the next version is going to be.

IgnatBeresnev commented 1 year ago

KT-61371 has been implemented and merged into Kotlin, but there are more issues to be addressed, so we are still blocked.

vmishenev commented 1 year ago

After KT-61371 is fixed, KT-62244 should be addressed.

vmishenev commented 11 months ago

KT-62244 is fixed, but new issues have been discovered. The meta issue for them is KT-62696

IgnatBeresnev commented 9 months ago

Current status

Since a number of upstream blocking issues were fixed, Dokka is now able to generate documentation for a subset of KMP projects, albeit with limitations and bugs.

While regression testing Kotlin/JVM projects for #3140, we were able to spend some time on testing KMP projects, and found issues that we weren't aware of before. I've updated the subtasks of this issue based on the findings.

vmishenev commented 1 month ago

Current status

3386 generally does not work for K1 as well.

Most kotlinx libraries can be built with Dokka K2 successfully.

Open issues specific to KMP: