Gradle Plugin DSL to change the generated Res class name:
```kotlin
compose.resources {
nameOfResClass = "MyRes"
}
```
Fixes [CMP-7341](https://youtrack.jetbrains.com/issue/CMP-7341) Support
generating custom resource class name
## Testing
Integration tests.
## Release Notes
### Features - Resources
- Gradle Plugin DSL to change the generated Res class name
Co-authored-by: Omico <me@omico.icu>
Refactor resource accessors generator to minify output source files.
- Number of items per file was decreased to 100
- Common part of the path extracted to the private const
- Added imports
- Removed the private object with item's properties
- The file structure was reorganized
Fixes [CMP-7934](https://youtrack.jetbrains.com/issue/CMP-7934) Too
large String0.commonMain.kt will break code insight feature in AS
## Testing
Integration tests.
This should be tested by QA
## Release Notes
### Fixes - Resources
- Fix IDE highlighting/resoulution when a generated file with resource
accessors is too big
Replaced legacy handling of the Compose compiler plugin with a new mechanism using `checkComposeCompilerPlugin`. This ensures compatibility with Kotlin 2.0.0+ and eliminates outdated compatibility code, simplifying future maintenance.
Continuation of
https://github.com/JetBrains/compose-multiplatform/pull/5279
```
> Task :composeApp:runRelease
Exception in thread "AWT-EventQueue-0" java.lang.VerifyError: Bad return type
Exception Details:
Location:
kotlinx/coroutines/flow/FlowKt__MergeKt.transformLatest$21dee7bd(Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/flow/internal/ChannelFlowTransformLatest; @17: areturn
Reason:
Type 'kotlinx/coroutines/flow/Flow' (current frame, stack[0]) is not assignable to 'kotlinx/coroutines/flow/internal/ChannelFlowTransformLatest' (from method signature)
Current Frame:
bci: @17
flags: { }
locals: { 'kotlinx/coroutines/flow/Flow', 'kotlin/jvm/functions/Function3' }
stack: { 'kotlinx/coroutines/flow/Flow' }
Bytecode:
0000000: bb00 0e59 2b2a 0103 0110 1cb7 0012 c000
0000010: 0ab0
at kotlinx.coroutines.flow.FlowKt.mapLatest(Unknown Source)
at kotlinx.coroutines.flow.FlowKt.collectLatest(Unknown Source)
at androidx.compose.foundation.text.SecureTextFieldController.observeHideEvents(BasicSecureTextField.kt:241)
at androidx.compose.foundation.text.BasicSecureTextFieldKt$BasicSecureTextField$1$1.invokeSuspend(BasicSecureTextField.kt:139)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
at androidx.compose.ui.platform.FlushCoroutineDispatcher.flush$lambda$4(FlushCoroutineDispatcher.skiko.kt:96)
at androidx.compose.ui.platform.FlushCoroutineDispatcher.performRun(FlushCoroutineDispatcher.skiko.kt:105)
at androidx.compose.ui.platform.FlushCoroutineDispatcher.flush(FlushCoroutineDispatcher.skiko.kt:83)
at androidx.compose.ui.scene.ComposeSceneRecomposer.performScheduledEffects(ComposeSceneRecomposer.skiko.kt:91)
at androidx.compose.ui.scene.BaseComposeScene.render(BaseComposeScene.skiko.kt:171)
at androidx.compose.ui.scene.ComposeSceneMediator.onRender$lambda$20$lambda$19(ComposeSceneMediator.desktop.kt:600)
at androidx.compose.ui.viewinterop.SwingInteropContainer.postponingExecutingScheduledUpdates(SwingInteropContainer.desktop.kt:251)
at androidx.compose.ui.scene.ComposeSceneMediator.onRender(ComposeSceneMediator.desktop.kt:598)
at org.jetbrains.skiko.SkiaLayer.update$skiko(SkiaLayer.awt.kt:558)
at org.jetbrains.skiko.redrawer.AWTRedrawer.update(AWTRedrawer.kt:54)
at org.jetbrains.skiko.redrawer.Direct3DRedrawer.redrawImmediately(Direct3DRedrawer.kt:74)
at org.jetbrains.skiko.SkiaLayer.tryRedrawImmediately(SkiaLayer.awt.kt:394)
at org.jetbrains.skiko.SkiaLayer.paint(SkiaLayer.awt.kt:367)
at androidx.compose.ui.scene.skia.WindowSkiaLayerComponent$contentComponent$1.paint(WindowSkiaLayerComponent.desktop.kt:64)
at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:961)
at java.desktop/javax.swing.JComponent.paint(JComponent.java:1137)
at java.desktop/javax.swing.JLayeredPane.paint(JLayeredPane.java:586)
at androidx.compose.ui.awt.JLayeredPaneWithTransparencyHack.paint(Utils.desktop.kt:121)
at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:961)
at java.desktop/javax.swing.JComponent.paint(JComponent.java:1137)
at androidx.compose.ui.window.Window_desktopKt.Window$lambda$40$lambda$39(Window.desktop.kt:629)
at androidx.compose.ui.window.AwtWindow_desktopKt.AwtWindow$lambda$7$lambda$6(AwtWindow.desktop.kt:78)
at androidx.compose.ui.util.UpdateEffect_desktopKt.UpdateEffect$lambda$8$lambda$7$performUpdate$lambda$4(UpdateEffect.desktop.kt:59)
at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:2496)
at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(SnapshotStateObserver.kt:460)
at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(SnapshotStateObserver.kt:244)
at androidx.compose.ui.util.UpdateEffect_desktopKt.UpdateEffect$lambda$8$lambda$7$performUpdate(UpdateEffect.desktop.kt:55)
at androidx.compose.ui.util.UpdateEffect_desktopKt.UpdateEffect$lambda$8$lambda$7(UpdateEffect.desktop.kt:64)
at androidx.compose.runtime.DisposableEffectImpl.onRemembered(Effects.kt:83)
at androidx.compose.runtime.internal.RememberEventDispatcher.dispatchRememberObservers(RememberEventDispatcher.kt:1182)
at androidx.compose.runtime.CompositionImpl.applyChangesInLocked(Composition.kt:1044)
at androidx.compose.runtime.CompositionImpl.applyChanges(Composition.kt:1067)
at androidx.compose.runtime.Recomposer.composeInitial$runtime(Recomposer.kt:1159)
at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:2677)
at androidx.compose.ui.window.Application_desktopKt$awaitApplication$2$1$2.invokeSuspend(Application.desktop.kt:221)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.ui.scene.ComposeContainer$DesktopCoroutineExceptionHandler@5bbe2373, androidx.compose.runtime.BroadcastFrameClock@3c45d5c5, StandaloneCoroutine{Cancelling}@7b8a1fc6, FlushCoroutineDispatcher@1850cb73]
```
## Release Notes
N/A
Fixes
https://youtrack.jetbrains.com/issue/CMP-7744/Desktop-Execution-failed-for-task-composeAppproguardReleaseJars-when-upgrade-to-CMP-1.8.0-alpha03
Also added `-dontnote androidx.**` to remove unnecessary notes about
Compose and other androidx libraries, which users can't fix themselves:
```
Note: androidx.lifecycle.ClassesInfoCache calls 'Method.getAnnotation'
Note: androidx.compose.ui.text.platform.ReflectionUtil$findAssignableField$result$1 calls 'Field.getType'
Note: androidx.compose.ui.text.platform.AwtFontUtils: can't find dynamically referenced class sun.font.CFont
Note: androidx.lifecycle.viewmodel.internal.JvmViewModelProviders accesses a declared constructor '<init>()' dynamically
```
## Testing
- `DesktopApplicationTest.proguard` fails before the fix, success after
## Release Notes
### Fixes - Desktop
- Fix `Execution failed for task ':composeApp:proguardReleaseJars'` when
`material3` is included in the project
This PR fixes compose resources for native macOS app (see currently
broken chat app using runDebugExecutableMacosArm64).
This PR also adds support for embedding resources into native macOS
framework. Similar to how it works on iOS. This allows using the macOS
compose code in an Xcode project. Just like iOS, using kotlin code as
framwork. Then call the main function from the Xcode project to run the
compose app.
https://github.com/JetBrains/compose-multiplatform/pull/5219https://github.com/JetBrains/compose-multiplatform/pull/5169
## Testing
- For executable: run chat app using runDebugExecutableMacosArm64
- For framework: Tested by adding macOS support to the iOS Xcode project
in chat app (not in this PR). Can add the sample app if needed. There
were also tests added to verify this.
## Release Notes
N/A
For example:
Execution failed for task ':lintVitalAnalyzeDemoRelease'.
> java.nio.file.NoSuchFileException: Temp\junit13866219496701371987\build\intermediates\lint-cache\lint-cache-version.txt on Windows
First commit fixes compose resources for native macOS app (see currently
broken chat app using `runDebugExecutableMacosArm64`).
Second commit adds support for embedding resources into native macOS
framework. Similar to how it works on iOS. This allows using the macOS
compose code in an Xcode project. Just like iOS, using kotlin code as
framwork. Then call the main function from the Xcode project to run the
compose app.
## Testing
First commit: run chat app using `runDebugExecutableMacosArm64`
Second commit: Tested by adding macOS support to the iOS Xcode project
in chat app (not in this PR). Can add the sample app if needed.
Since AGP `8.8.0-alpha08` there was added support generated assets in
the new `androidLibrary` target.
We have to support a new target configuration and work with compose
multiplatform resources
Fixes https://youtrack.jetbrains.com/issue/CMP-6982
## Testing
- Added gradle tests
## Release Notes
### Features - Gradle Plugin
- Support compose resources in `androidLibrary` target
Should fix
```
Dependency 'androidx.compose.foundation:foundation-android:1.8.0-alpha02' requires libraries and applications that depend on it to compile against version 35 or later of the Android APIs.
```
skiko.js used to be required for k/wasm projects. But some time ago it
was refactored to use skiko.mjs, so skiko.js is not needed anymore (for
k/wasm, still needed for k/js). But there are k/wasm projects still
including skiko.js in index.html which leads to extra loading time. The
intention is to notify them without causing 404 errors for now.
## Testing
- updated a test
- tested manually
<img width="856" alt="Screenshot 2024-09-10 at 15 34 41"
src="https://github.com/user-attachments/assets/9ad9b790-d3fa-4907-b9ee-f5e682f38858">
## Release Notes
### Highlights - Web
- `skiko.js` is redundant in case of K/Wasm Compose for Web applications
and it can be removed from index.html files to not load redundant files.
We are going to remove `skiko.js` from the k/wasm distribution in the
future releases. `skiko.js` is still needed in case of K/JS Compose for
Web apps.
Use a correct file to configure the cocoapods resources integration
instead of a relative path.
Fixes https://youtrack.jetbrains.com/issue/CMP-4303
## Release Notes
### Fixes - Resources
- _(prerelease fix)_ Fix cocoapods resources integration which leaded to
a lack resources in ios apps
1) The PR adds a support test resources in Compose multiplatform
projects.
2) The PR adds a support multi-module resources in JVM-only projects.
Fixes https://youtrack.jetbrains.com/issue/CMP-1470
Fixes https://youtrack.jetbrains.com/issue/CMP-5963
## Release Notes
### Features - Resources
- Added support of test resources in Compose Multiplatform projects
- Added support of multi-module resources in JVM-only projects
After the fix there will be a correct configuration cache usage.
Fixes https://youtrack.jetbrains.com/issue/CMP-5674
## Release Notes
### Fixes - Gradle Plugin
- _(prerelease fix)_ Fix broken configuration cache due Android Studio +
AGP issues. Now Android Studio previews require latest AGP versions
(8.5.2, 8.6.0-rc01, 8.7.0-alpha04):
https://issuetracker.google.com/issues/348208777
Updating the compose.version too, otherwise the tests would fail locally
with the new screenshots.
__
This is a consequence of updating to a newer skia/skiko version in
compose-multiplatform-core.
K/JS and K/Wasm have differences in the packaging logic, and therefore
we need to account for it when unpacking Skiko files.
Fixes [CMP-5649](https://youtrack.jetbrains.com/issue/CMP-5649)
## Testing
- Added a test, which checks the state of k/js distribution
This should be tested by QA