JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
16.23k stars 1.18k forks source link

Identical naming of compose.components.* jars breaks packaging with Conveyor #4575

Closed iamcalledrob closed 1 month ago

iamcalledrob commented 7 months ago

Describe the bug compose.components.resources and compose.components.uiToolingPreview both generate a jar named library-desktop-1.6.0.jar

Depending on both, along the lines of:

kotlin {
    jvmToolchain(17)
    jvm("desktop")

    sourceSets {
        val desktopMain by getting
        desktopMain.dependencies {
            implementation(compose.desktop.currentOs)

            implementation(compose.components.resources) // <--
            implementation(compose.components.uiToolingPreview) // <--
        }
    }
}

will generate two identically named jars, which breaks packaging with Conveyor -- the second jar to be ingested will overwrite the first, leading to java.lang.NoClassDefFoundError: org/jetbrains/compose/resources/DrawableResource at runtime.

Having duplicate jar names will also make stack traces less useful.

This may not technically be a bug, but it feels like an oversight.

Affected platforms

Versions

To Reproduce Make a compose desktop project, and add both dependencies.

Expected behavior The jars generated are named differently.

Screenshots Packaging with the built-in packager works only because of the hash appended to the jar name. Screenshot 2024-04-04 163402

Additional context

okushnikov commented 2 months ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.