feat: Add support for macOS layered icons
Support for using macOS layered icons (.icon directory) for both JVM and native application packaging.
This feature requires actool version >= 26.0
- A new
layeredIconDirproperty is added to thecompose.desktop.application.nativeDistributions.macOSandcompose.nativeApplication.macOSDSLs. - The
actoolfrom Xcode Command Line Tools is used to compile the.icondirectory into anAssets.carfile. - The
Assets.carfile is included in the.appbundle resources. - The
Info.plistis updated withCFBundleIconNameto reference the compiled asset. - A check for a supported
actoolversion is performed before compilation. - New integration tests (
testMacLayeredIcon,testMacLayeredIconRemove) are added to verify the functionality for both JVM and native targets.
Example
compose.desktop {
application {
nativeDistributions {
macOS {
layeredIconDir.set("Icon Path")
}
}
}
}
Testing
Only verify the task behavior: compose:test-Gradle(9.2.0)-Agp(8.12.3) --tests org.jetbrains.compose.test.tests.integration.DesktopApplicationTest.testMacLayeredIcon
Only verify the task behavior: compose:test-Gradle(9.2.0)-Agp(8.12.3) --tests org.jetbrains.compose.test.tests.integration.DesktopApplicationTest.testMacLayeredIconRemove
This should be tested by QA
Tickets
CMP-9083 Support macOS 26 layered icons
Release Notes
Features - Gradle Plugin
- Support for using macOS layered icons (
.icondirectory) for both JVM and native application packaging.
Hi, thank you for the contribution! We will soon be requiring all PRs to have a linked issue in our tracker, I created one for this: CMP-9083 Support macOS 26 layered icons. It should be used for discussions around the newly added feature.
Thanks again for creating the related YouTrack issue – it’s been really helpful!
I just wanted to gently follow up on this PR – would you have a moment to review it when you get a chance? Let me know if I can clarify anything to make it easier!
No rush at all, appreciate your help!
@kropp All the changes you mentioned that needed to be made have already been completed.
@igordmn requesting second review as it adds new public API in Gradle plugin