Skip to content

Conversation

@Sanlorng
Copy link
Contributor

@Sanlorng Sanlorng commented Oct 13, 2025

Support for using macOS layered icons (.icon directory) for both JVM and native application packaging.

This feature requires actool version >= 26.0

  • A new layeredIconDir property is added to the compose.desktop.application.nativeDistributions.macOS and compose.nativeApplication.macOS DSLs.
  • The actool from Xcode Command Line Tools is used to compile the .icon directory into an Assets.car file.
  • The Assets.car file is included in the .app bundle resources.
  • The Info.plist is updated with CFBundleIconName to reference the compiled asset.
  • A check for a supported actool version is performed before compilation.
  • New integration tests (testMacLayeredIcon, testMacLayeredIconRemove) are added to verify the functionality for both JVM and native targets.
image image image image

Example

compose.desktop {
    application {
        nativeDistributions {
            macOS {
                layeredIconDir.set("Icon Path")
            }
        }
    }
}

Testing

Only verify the task behavior: compose:test-Gradle(9.0.0)-Agp(8.9.0) --tests org.jetbrains.compose.test.tests.integration.DesktopApplicationTest.testMacLayeredIcon

Only verify the task behavior: compose:test-Gradle(9.0.0)-Agp(8.9.0)** --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 (.icon directory) for both JVM and native application packaging.

This commit introduces support for using macOS layered icons (`.icon` directory) for both JVM and native application packaging.

- A new `layeredIconDir` property is added to the `compose.desktop.application.nativeDistributions.macOS` and `compose.nativeApplication.macOS` DSLs.
- The `actool` from Xcode Command Line Tools is used to compile the `.icon` directory into an `Assets.car` file.
- The `Assets.car` file is included in the `.app` bundle resources.
- The `Info.plist` is updated with `CFBundleIconName` to reference the compiled asset.
- A check for a supported `actool` version is performed before compilation.
- New integration tests (`testMacLayeredIcon`, `testMacLayeredIconRemove`) are added to verify the functionality for both JVM and native targets.
The `macAssetsDir` property in `AbstractJPackageTask` was unused and has been removed.
- Deleted the `Expected-Info.plist` which verified now-removed properties.
- Removed `extraInfoPlistKeys` and file association configurations from the test's `build.gradle.kts`.
@MatkovIvan MatkovIvan requested a review from kropp October 13, 2025 11:26
@kropp
Copy link
Member

kropp commented Oct 13, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants