dokka icon indicating copy to clipboard operation
dokka copied to clipboard

Use both macos targets in ui-showcase

Open whyoleg opened this issue 1 year ago • 1 comments

TL;DR; This is needed because of the issue with rendering expect/actual. I would propose for now to just add macosArm64 target and resolve underlying issue during implementation of https://github.com/Kotlin/dokka/issues/3386 for Dokka K2. We will anyway need to do something with such sourceSets.

In https://github.com/Kotlin/dokka/pull/3662 test started to fail on ui-showcase module because of ERROR CLASS. Checking the page where the fail happened, I found that for some reason ui-showcase currently (on master) doesn't contain an actual declaration for macos sourceSet: image asyncWithDelay doesn't have macos tab, but actual declaration exists in sourceSet.

If we run the same test with the changes from https://github.com/Kotlin/dokka/pull/3662, macos tab is now appeared but shows ERROR CLASS: image All other declarations of asyncWithDelay for other sourceSets look the same as before.

Also, other declarations (which don't depend on coroutines) like getCurrentDate which also has expect/actual defined in the same - work fine on master and macos tab exist: image

Most probably the issue is very similar to https://github.com/Kotlin/dokka/issues/3386 (even though problem described here reproducible on K1).

If we build ui-showcase with Dokka K2:

  • on master - linux and macos are not shown at all for asyncWithDelay.
  • with https://github.com/Kotlin/dokka/pull/3662 - all source sets are shown but both linux and macos will show ERROR CLASS
  • if we add macosArm64 target (as in this PR) - macos source set will be shown.

whyoleg avatar Jul 03 '24 14:07 whyoleg

Currently, does the linux tab have <ERROR CLASS>.asyncWithDelay... for K2, but K1 renders normally?

Yeah, for K1 linux renders fine for some reason with K1. With K2 it will be ERROR CLASS. May be because coroutines does have some apple/macos related stuff in publication which confuses Dokka with K1

Can we fix it with an extra target as well?

Probably yes, I will recheck it one more time for both K1 and K2 and adapt PR

whyoleg avatar Jul 04 '24 13:07 whyoleg

Adding extra linuxArm64 target not only solves ERROR CLASS for asyncWithDelay but also resolves issue with CPointer for K2 - so now, ui-showcase works for both K1 and K2.

whyoleg avatar Jul 05 '24 09:07 whyoleg