dokka icon indicating copy to clipboard operation
dokka copied to clipboard

Don't add Android's `bootClasspath` to ALL source-sets in case android plugin is applied in KMP project

Open whyoleg opened this issue 3 months ago • 1 comments

This is not required, but because of this, even commonMain in a multiplatform project that has the android plugin applied will have android.jar in the classpath, and so it could theoretically resolve to declarations from there. (spotted while writing a test for https://github.com/Kotlin/dokka/pull/4258)

@adam-enko, do you have any suggestions on how to test this?

whyoleg avatar Sep 16 '25 14:09 whyoleg

@adam-enko, do you have any suggestions on how to test this?

We want to check that DokkaSourceSet.classpath passed to Dokka generator contains android.jar. This could change based on the AGP version, so it should be an integration test.

So, add an assertion in the AGP integration tests, e.g. dokka-integration-tests/gradle/src/testTemplateProjectAndroid/kotlin/Android0GradleIntegrationTest.kt, that checks the Dokka configuration contains android.jar.

Does that sound doable?

adam-enko avatar Sep 18 '25 10:09 adam-enko