https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
j

Jason H

11/02/2023, 1:34 AM
Greetings Hackers - I'm enjoying compose a ton so far coming from Swing. It's sweet! I have a mac and windows-only app right now. Happy to send some beer/wine/tequila 🍺 cash if anyone can provide just a little guidance. I'm stuck here. I'm pretty new to MacOS. I'm only playing in Intelli-J so far, but happy to fire up XCode if needed.
l

Landry Norris

11/02/2023, 1:41 AM
Can't help with the text portion, but I wrote a prototype of updating the dock using Compose. It supports updating the dock icon as the app runs. http://github.com/LandryNorris/ComposeMacosDock
thank you color 2
p

Pablichjenkov

11/02/2023, 1:41 AM
You can ask in #compose-desktop too
gratitude thank you 1
1
e

ephemient

11/02/2023, 1:42 AM
according to the docs,
Copy code
compose.desktop {
    application {
        nativeDistributions {
            macOS {
                dockName = "..."
                iconFile.set(...)
            }
        }
    }
}
1
but you should read through the rest of it yourself
j

Jason H

11/02/2023, 1:43 AM
Holy community 🦇man! Wow. THANK YOU from Florida USA!
I tried
dockName
but it didn't seemingly have any effect. I went through running it directly in Intelli-J and the
packageDmg
target. No 🎲 . 😞 The
packageReleaseDmg
fails with some
proguardReleaseJars
error, so hopefully I don't need it.
e

ephemient

11/02/2023, 1:48 AM
can't really help much more since I don't use macos, but check if it's in the app's
Info.plist
, and for further help check with #compose-desktop as suggested earlier
thank you color 1
j

Jeff Lockhart

11/02/2023, 1:51 AM
Make sure you're building with
runDistributable
(or
runReleaseDistributable
) and not just
run
. The menu name is only configured in distributable builds.
🍺 1
🍻 1
j

Jason H

11/02/2023, 1:54 AM
@Jeff Lockhart well that's forward progress! Not the
launch.icns
I was pointing to:
Copy code
macOS {
    bundleID = packageName
    val iconsRoot = project.file("src/main/resources/")
    iconFile.set(iconsRoot.resolve("launch.icns"))
    targetFormats(TargetFormat.Dmg)
    this.packageName = "LaunchPad"
    dockName = "LaunchPad"
    setDockNameSameAsPackageName = true
    dmgPackageVersion = appVersion
    pkgPackageVersion = appVersion
}
But even this beats the generic java icon, lol!
image.png
small update...not sure what gives, I wish I could combine gradle's
runRelease
&
runDistributable
, any ideas? @Jeff Lockhart
Relevant gradle snippet:
Copy code
macOS {
    bundleID = packageName
    iconFile.set(iconsRoot.resolve("launch.icns"))
    targetFormats(TargetFormat.Dmg)
    this.packageName = "LaunchPad"
    dockName = "LaunchPad"
    setDockNameSameAsPackageName = true
    dmgPackageVersion = appVersion
    pkgPackageVersion = appVersion
}
what I really would like is a DMG that "just works"™️ but proguard is being painful. I don't want to deal with apple/notarization yet.
j

Jeff Lockhart

11/03/2023, 9:43 PM
I wish I could combine gradle's
runRelease
&
runDistributable
There is
runReleaseDistributable
, which should do this.
j

Jason H

11/03/2023, 10:35 PM
yeah that bad boy (
runReleaseDistributable
) dies on proguard for me. I need to dive into proguard. The proguard stdout/stderr is rough: 642 warnings, 1 error, but I can't find the error (the error log file is empty, and can't see it in stdout). Does
runReleaseDistributable
create a dmg? I'm guessing not. Example proguard warning:
kotlinx.datetime.serializers.DateBasedDateTimeUnitSerializer: can't find superclass or interface kotlinx.serialization.internal.AbstractPolymorphicSerializer
j

Jeff Lockhart

11/04/2023, 12:36 AM
If you don't want to mess with proguard and don't need it, you can disable it:
Copy code
compose.desktop {
    application {
        buildTypes.release.proguard.isEnabled = false
    }
}
cheers 1
packageDmg
should create a .dmg, if it's configured:
Copy code
compose.desktop {
    application {
        nativeDistributions {
            targetFormats(TargetFormat.Dmg)
        }
    }
}
2 Views