-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: Support Compose Resources in Native macOS Executables #5431
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
This commit introduces support for Compose Resources in native macOS executables. - Added a new integration test `macosExecutableResources` to verify resource copying for macOS executables. - Updated `IosResources.kt` to handle resource copying for `Executable` binaries on macOS. - Resources are now copied into the `.app/Contents/Resources` directory for packaged macOS applications. - The `copyExecutableComposeResourcesFor[Target]` task is now configured for macOS executables. - Packaging tasks for macOS now depend on the corresponding resource copying task.
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/IosResources.kt
Outdated
Show resolved
Hide resolved
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/IosResources.kt
Outdated
Show resolved
Hide resolved
gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/IosResources.kt
Outdated
Show resolved
Hide resolved
...lugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/ResourcesTest.kt
Outdated
Show resolved
Hide resolved
...lugins/compose/src/test/kotlin/org/jetbrains/compose/test/tests/integration/ResourcesTest.kt
Outdated
Show resolved
Hide resolved
This commit introduces a new test project `misc/macosNativeResources` to verify the functionality of Compose resources in macOS native applications. The test project includes: - A simple Composable `App` that displays an image resource. - Vector drawable resources for the app icon and an image. - Gradle configuration for building a macOS native application (`.dmg`). - A `main.kt` for the macOS target. - `gradle.properties` to enable experimental macOS features. - `settings.gradle.kts` for project setup. The existing `ResourcesTest.kt` is updated to use this new test project for `macosExecutableResources` test, replacing the previous in-memory modification of the `misc/appleResources` project. This change allows for a more isolated and maintainable test for macOS native resources.
I revisited the codebase and decided the feature should be done in configureNativeApplication function. Could you refactor it? |
Ok |
Should i keep the |
Better to revert all changes. Because the file is related to ios specifics (yes, it helps with macos unit tests, as I see, but by chance 😄). |
Support for Compose Resources in native macOS executables.
macosExecutableResources
to verify resource copying for macOS executables.IosResources.kt
to handle resource copying forExecutable
binaries on macOS..app/Contents/Resources
directory for packaged macOS applications.copyExecutableComposeResourcesFor[Target]
task is now configured for macOS executables.Testing
Executing tasks: [:compose:test-Gradle(9.0.0)-Agp(8.9.0), --tests, org.jetbrains.compose.test.tests.integration.ResourcesTest.macosExectuableResources]
Executing tasks: [:compose:test-Gradle(9.0.0)-Agp(8.9.0), --tests, org.jetbrains.compose.test.tests.integration.ResourcesTest.macosTestResources]
Release Notes
Fixes - macOS Native