-
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
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
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 😄). |
This commit introduces support for Compose Resources in native macOS applications. Key changes: - Added `composeResourcesDirs` property to `AbstractNativeMacApplicationPackageAppDirTask` to include resources during app packaging. - Updated `configureNativeApplication.kt` to pass Compose resource directories from Kotlin Native binaries to the packaging task. - Included a new test project `misc/macosNativeResources` to verify the integration. - Added `macosExecutableResources` test in `ResourcesTest.kt` to ensure resources are correctly packaged into the `.app` bundle.
5d36c32
to
1b9547c
Compare
I have reverterd all the previous changes and rewritten the function. |
...jetbrains/compose/desktop/application/tasks/AbstractNativeMacApplicationPackageAppDirTask.kt
Outdated
Show resolved
Hide resolved
This commit changes the type of `composeResourcesDirs` in `AbstractNativeMacApplicationPackageAppDirTask` from `ListProperty<SourceDirectorySet>` to `Property<FileCollection?>`. This change simplifies the configuration of native application packaging by directly using `project.files` to gather resource directories from Kotlin source sets.
…ackageAppDirTask` was changed from `Property<FileCollection?>` to `ConfigurableFileCollection`.
Is there anything else that needs to be changed? |
1 similar comment
Is there anything else that needs to be changed? |
Support for Compose Resources in native macOS executables.
macosExecutableResources
to verify resource copying for macOS executables.configureNativeApplication.kt
to pass Compose resource directories from Kotlin Native binaries to the packaging task..app/Contents/Resources
directory for packaged macOS applications.Testing
Executing tasks: [:compose:test-Gradle(9.0.0)-Agp(8.9.0), --tests, org.jetbrains.compose.test.tests.integration.ResourcesTest.macosExectuableResources]
Release Notes
Fixes - macOS Native