-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: Add support for macOS layered icons #5451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Hi, thank you for the contribution! |
|
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! |
freelife4850-netizen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a good idea to try 🙂
kropp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for a long wait, could you please take a look at comments and also rebase the branch to the latest version?
...pose/src/main/kotlin/org/jetbrains/compose/desktop/application/tasks/AbstractJPackageTask.kt
Outdated
Show resolved
Hide resolved
...mpose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/DesktopApplicationTest.kt
Outdated
Show resolved
Hide resolved
gradle-plugins/compose/src/test/test-projects/application/macLayeredIcon/build.gradle.kts
Outdated
Show resolved
Hide resolved
.../compose/src/main/kotlin/org/jetbrains/compose/desktop/application/internal/MacAssetsTool.kt
Outdated
Show resolved
Hide resolved
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`.
Updated the `macLayeredIcon` test project to use `COMPOSE_VERSION_PLACEHOLDER` for Compose dependency versions. This makes the test configuration more flexible and easier to maintain.
This commit refactors the `actool` version parsing logic to use the `plutil` command-line tool instead of a manual XML parser. This change simplifies the code and improves robustness. - Replaced the XML parsing implementation in `MacAssetsTool` with a call to `plutil -extract`. - Updated `try`/`catch` blocks to handle exceptions from the tool execution. - Added a `plutil` file definition to `MacUtils`. - Integration tests for macOS layered icons (`testMacLayeredIcon`, `testMacLayeredIconRemove`) are now skipped if the `actool` version is less than 26, ensuring they run only on supported environments.
6fe432f to
f6d1291
Compare
|
@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 |
Support for using macOS layered icons (
.icondirectory) for both JVM and native application packaging.layeredIconDirproperty is added to thecompose.desktop.application.nativeDistributions.macOSandcompose.nativeApplication.macOSDSLs.actoolfrom Xcode Command Line Tools is used to compile the.icondirectory into anAssets.carfile.Assets.carfile is included in the.appbundle resources.Info.plistis updated withCFBundleIconNameto reference the compiled asset.actoolversion is performed before compilation.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
.icondirectory) for both JVM and native application packaging.