Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KT-71784 Fix classpath for KMP shared source sets #3942

Merged
merged 17 commits into from
Dec 5, 2024

Conversation

adam-enko
Copy link
Member

@adam-enko adam-enko commented Nov 28, 2024

DGP fetches information from KGP to automatically setup the DokkaSourceSets. In KMP projects DGP incorrectly aggregated the classpath for 'parent' source sets (e.g. commonMain) from all children. This sometimes worked, but sometimes failed.

For each KotlinSourceSet (KSS) DGP needs to use all compilations to determine whether they are 'publishable' ('test' source sets are not publishable by default), and the Kotlin target (for example.

DGP needs to use the specific compilations for a KSS to get the exact classpath for Dokka.

This PR makes DGP track all and specific compilations separately.


Fix KT-71784

Fix #3860

@adam-enko adam-enko added the runner: Gradle plugin An issue/PR related to Dokka's Gradle plugin label Nov 28, 2024
@adam-enko adam-enko added this to the Dokka 2.0.0 milestone Nov 28, 2024
…dMain, because Dokka doesn't fully support KMP projects with a single Kotlin target
# Conflicts:
#	dokka-integration-tests/gradle/projects/it-android-compose/expectedData/html/core/index.html
#	dokka-integration-tests/gradle/projects/it-android-compose/expectedData/html/core/navigation.html
#	dokka-integration-tests/gradle/projects/it-android-compose/expectedData/html/core/org.dokka.it.android.kmp.core/-menu-item/-menu-item.html
#	dokka-integration-tests/gradle/projects/it-android-compose/expectedData/html/core/org.dokka.it.android.kmp.core/-menu-item/image-vector.html
#	dokka-integration-tests/gradle/projects/it-android-compose/expectedData/html/core/org.dokka.it.android.kmp.core/-menu-item/index.html
#	dokka-integration-tests/gradle/projects/it-android-compose/expectedData/html/core/org.dokka.it.android.kmp.core/-menu-item/is-important.html
#	dokka-integration-tests/gradle/projects/it-android-compose/expectedData/html/core/org.dokka.it.android.kmp.core/-menu-item/label.html
#	dokka-integration-tests/gradle/projects/it-android-compose/expectedData/html/core/org.dokka.it.android.kmp.core/-menu-item/on-click.html
#	dokka-integration-tests/gradle/projects/it-android-compose/expectedData/html/core/org.dokka.it.android.kmp.core/index.html
#	dokka-integration-tests/gradle/projects/it-android-compose/expectedData/html/material3/index.html
#	dokka-integration-tests/gradle/projects/it-android-compose/expectedData/html/material3/navigation.html
#	dokka-integration-tests/gradle/projects/it-android-compose/expectedData/html/material3/org.dokka.it.android.kmp.material3/-top-app-bar-action.html
#	dokka-integration-tests/gradle/projects/it-android-compose/expectedData/html/navigation.html
@adam-enko adam-enko marked this pull request as ready for review December 5, 2024 11:46
@adam-enko adam-enko requested review from whyoleg and antohaby December 5, 2024 11:46
Copy link
Collaborator

@whyoleg whyoleg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIce!

The only suggestion I have is to not enable klib cross compilation by default in example because it's experimental and could cause other unknown to us issues.

@adam-enko adam-enko merged commit 2b63314 into master Dec 5, 2024
29 checks passed
@adam-enko adam-enko deleted the adam/fix/KT-71784-kmp-classpath branch December 5, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
runner: Gradle plugin An issue/PR related to Dokka's Gradle plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2.0.0-Beta: Illegal use of flexible type deserializer.
3 participants