0

我有用 compose 编写的桌面应用程序,我在 Mac 上工作。mac 版本一切正常,但我无法为 linux 生成一个。

dependencies {
    implementation(compose.desktop.linux_x64)
    implementation(compose.desktop.macos_x64)
[...]
}
compose.desktop {
    application {
        mainClass = "pl.rtsm.myapp.ApplicationKt"
        jvmArgs += listOf("-Xmx12G")
        nativeDistributions {
            targetFormats(TargetFormat.Deb, TargetFormat.Dmg)
            outputBaseDir.set(project.buildDir.resolve("installers"))
            packageName = "MyApp"
        }
    }
}

无论我在 targetFormats 中指定什么,它都只会生成 Mac 应用程序。我发现调试日志中唯一的事情是跳过了这个任务(即使我正在从干净状态运行任务):

2022-01-09T18:11:57.948+0100 [LIFECYCLE] [class org.gradle.internal.buildevents.TaskExecutionLogger] > Task :packageDeb SKIPPED
2022-01-09T18:11:57.948+0100 [INFO] [org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter] Skipping task ':packageDeb' as task onlyIf is false.

是否可以在 Mac 上创建 linux 版本?缺了点什么?

4

0 回答 0