compose-multiplatform
compose-multiplatform copied to clipboard
Support explicit dist names
Now I configure the macOS output dist name like:
compose.desktop {
application {
...
nativeDistributions {
targetFormats(TargetFormat.Dmg)
packageName = "Foo"
packageVersion = "1.0"
}
}
}
This will generate the output dmg files like Foo-1.0.dmg, if I want to rename the dist will set packageName to something like foo-x64, but this will lead the extracted app name to foo-x64-1.0.app, which is not what I expected. Seems I don't find any direct way to leave the dist name and the app name different. It would be great to support this feature.
Workaround:
/**
* TODO: workaround for https://github.com/JetBrains/compose-multiplatform/issues/4976.
*/
val renameDmg by tasks.registering(Copy::class) {
group = "distribution"
description = "Rename the DMG file"
val packageReleaseDmg = tasks.named<AbstractJPackageTask>("packageReleaseDmg")
// build/compose/binaries/main-release/dmg/Foo*.dmg
val fromFile = packageReleaseDmg.map { task ->
task.destinationDir.asFile.get().toPath().listDirectoryEntries("Foo*.dmg").single()
}
from(fromFile)
into(fromFile.map { it.parent })
rename {
"foo-bar.dmg"
}
}
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.