Updated the regex to correctly match multi-digit placeholders in string
templates. Added a suite of tests to ensure `replaceWithArgs` handles
various edge cases like missing arguments, mismatched placeholders, and
invalid formats reliably.
Fixes https://youtrack.jetbrains.com/issue/CMP-7236
## Testing
- Unit tests
## Release Notes
### Fixes - Resources
- Fix string resource's regex for placeholders to correctly match
multi-digit placeholders.
For example:
Execution failed for task ':lintVitalAnalyzeDemoRelease'.
> java.nio.file.NoSuchFileException: Temp\junit13866219496701371987\build\intermediates\lint-cache\lint-cache-version.txt on Windows
Previously we had:
- A link to the latest stable version from the version list
- A link to the latest prerelease from the version list
Now we have:
- A link to the latest stable version from the version list
- A link to the latest prerelease (excluding stable) from the version
list
- A link to the latest dev (nightly) build (excluding stable,
prerelease) from the tag list (we no longer add it in the version list)
A tag contains info about all associated libs.
[Example](https://github.com/JetBrains/compose-multiplatform/releases/tag/v1.8.0%2Bdev1960)
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.
- kn+performance and jvm-vs-kotlin-native benchmarks are merged into one
multiplatform where they measure both CPU time and missed frames +
frames percentiles
- added multiplatform run arguments processing for benchmarks
configuration
- deleted standalone samples (moved LazyList to the infrastructure)
Fixes
[CMP-5790](https://youtrack.jetbrains.com/issue/CMP-5790/Refactor-CMP-benchmarks-to-remove-code-duplication)
Updated changelog for 1.7.1
---------
Co-authored-by: Igor Demin <igordmn@users.noreply.github.com>
Co-authored-by: Igor Demin <igor.demin@jetbrains.com>
## Release Notes
### Features - Resources
- Add new API to preload and cache font and image resources on web
targets: `preloadFont`, `preloadImageBitmap`, `preloadImageVector`
____
Add a new experimental web-specific API to preload fonts and images:
```kotlin
@Composable
fun preloadFont(
resource: FontResource,
weight: FontWeight = FontWeight.Normal,
style: FontStyle = FontStyle.Normal
): State<Font?>
@Composable
fun preloadImageBitmap(
resource: DrawableResource,
): State<ImageBitmap?>
@Composable
fun preloadImageVector(
resource: DrawableResource,
): State<ImageVector?>
```
Using this methods in advance, it's possible to avoid FOUT (flash of
unstyled text), or flickering of images/icons.
Usage example:
```kotlin
val font1 by preloadFont(Res.font.Workbench_Regular)
val font2 by preloadFont(Res.font.font_awesome, FontWeight.Normal, FontStyle.Normal)
UseResources() // Main App that uses the above fonts
if (font1 != null && font2 != null) {
println("Fonts are ready")
} else {
Box(modifier = Modifier.fillMaxSize().background(Color.White.copy(alpha = 0.8f)).clickable { }) {
CircularProgressIndicator(modifier = Modifier.align(Alignment.Center))
}
println("Fonts are not ready yet")
}
```
This PR makes the IJ plugin run in K2 mode with the new Analysis APIs,
instead of the old K1 APIs. It also includes cleaning up a bunch of
compiler warnings, and some mistakes I saw when migrating to K2.
---------
Co-authored-by: Victor Kropp <victor.kropp@jetbrains.com>
This PR prepares the IJ plugin to be fixed/improved upon by a follow-up
PR, by:
1. Migrating to IJP Gradle plugin 2.1
2. Upgrading Gradle to 8.10
3. Bumping IJ target to 2024.2.1
4. Cleaning up after migration
---------
Co-authored-by: Victor Kropp <victor.kropp@jetbrains.com>
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.
```
Fixes https://youtrack.jetbrains.com/issue/CMP-6688
## Testing
Added a unit test.
<!-- Optional -->
This should be tested by QA
## Release Notes
### Fixes - Resources
- Read `android:autoMirrored="true"` property and pass it to ImageVector
builder