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.2k stars 1.17k forks source link

how can I add `Frameworks` directory to the bundle runtime? #2145

Closed xinkunZ closed 1 month ago

xinkunZ commented 2 years ago

I want to use jcef in my project, so I want to use jbr as the bundle runtime but after building, the target app for macOS only has jdk in runtime directory, but not copy Frameworks to runtime directory

igordmn commented 2 years ago

Will these docs help to include this directory?

xinkunZ commented 2 years ago

Will these docs help to include this directory?

I have read these docs , and I found that the gradle plugin can only add something to app directory, can not modify the runtime directory is there any way to copy an exist directory to runtime folder after the createDistributable task, then packageXXX task can just use my runtime folder to create native image

igordmn commented 2 years ago

Understand. It needs investigation. We use jlink/jpackage under the hood. If it isn't possible with them, we have to make a proposal/feature request in the JDK bug tracker.

xiaobo0113 commented 1 year ago

If you just need some moules, for example "java.sql", which is required when you use gson(google), add module like this:

compose.desktop {
    application {
        mainClass = "com.xxx.MainKt"
        nativeDistributions {
            targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb, TargetFormat.Exe)
            packageName = "Xxx"
            packageVersion = "1.0.0"

            modules("java.sql")
        }
    }
}

If you do not do this step(gson used). You will get error: classDefNotFoundError: java.sql.Time, when you start your exe file after installation completed.

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.