Kotlin / dokka

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

[K2] Stabilize pure Kotlin/JVM and mixed Kotlin/Java projects #3140

Open IgnatBeresnev opened 1 year ago

IgnatBeresnev 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 any pure Kotlin/JVM project, or any project that uses a mix of Kotlin and Java together.

That means, it has to work with:

Once done, we should be able to turn on the K2 analysis by default for all JVM-only user projects.

Due date

The K2 analysis should be used by default in all JVM-only user projects in Dokka 2.0.0, with the ability to fall back to K1.

If there are unresolved issues or bugs by that time, at the very least it should be available for early testing (i.e toggleable via a flag).

Sub-tasks

Upstream issues

IgnatBeresnev commented 1 year ago

Current status

We are unable to properly configure K2 analysis for JVM projects due to missing API in K2.

Blocking issue: KT-60884 - Analysis API: Improve standalone mode project model creation.

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.

Notes: it might be possible to fix this issue on Dokka's side without the need to wait for KT-60884, but the solution is not guaranteed to be trivial or stable, so it's preferable to avoid it and wait for the proper API to be added.

IgnatBeresnev commented 9 months ago

Current status

The blocking Analysis API issue was addressed, and we were able to proceed with stabilizing Kotlin/JVM projects.

Having fixed the major bugs we were aware of, we prepared the testing infrastructure and started manually testing Dokka on a variety of user projects, a considerable number of which were Kotlin/JVM projects. More details and results here: https://github.com/Kotlin/dokka/issues/3328

Based on the testing results and findings, I've updated the subtasks of this issue with the new issues.