- Updated Gradle to support version 9.0.0.
- Improved Compose resource configuration to handle AGP versions below
8.10 with a fallback implementation.
- Bumped Kotlin to 2.2.0 release and updated related dependencies.
- Adjusted tests to reflect changes in AGP-specific behavior and
logging.
Fixes https://youtrack.jetbrains.com/issue/CMP-8771
## Release Notes
### Fixes - Gradle Plugin
- Support `AGP 9.0.0`
Used by Compose Hot Reload to mark a related accessor as dirty if the
hash is changed after reloading of new accessors.
Fixes [CMP-8513](https://youtrack.jetbrains.com/issue/CMP-8513)
## Release Notes
N/A
Fixes
https://youtrack.jetbrains.com/issue/CMP-8050/Desktop-runRelease-crash-when-upgrade-to-CMP-1.8.0-rc01
`./gradlew runRelease` throws an error:
```
Exception in thread "main" kotlinx.a.g: Serializer for class 'LoginRoute' is not found
```
in this code:
```
import androidx.compose.ui.window.singleWindowApplication
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import kotlinx.serialization.Serializable
fun main() = singleWindowApplication {
NavHost(
navController = rememberNavController(),
startDestination = LoginRoute()
) {
composable<LoginRoute> {}
}
}
@Serializable
data class LoginRoute(val id: Long? = null)
```
with obfuscation enabled:
```
compose.desktop {
application {
mainClass = "MainKt"
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "org.jetbrains.nav_cupcake"
packageVersion = "1.0.0"
}
buildTypes.release.proguard {
obfuscate.set(true)
}
}
}
```
It crashes because:
- we use `@InternalSerializationApi kotlinx.serialization.serializer`
which is used by Navigation
- it uses reflection underneath. Looks like it tries to find serializer
2 ways:
- Looking at the field `static final LoginRoute.Companion.serializer`
- Looking at the `inner class LoginRoute.Companion` and its name
- The [the
default](https://github.com/Kotlin/kotlinx.serialization/blob/4667a18/rules/common.pro)
rules:
- [no obfuscation] work by the second way, but doesn't work by the first
- [with obfuscation] don't work by both ways
The new rule support the first for both obfuscated/non-obfuscated code
## Details
### Old rules
#### Without obfuscation
```
// LoginRoute.class
public final class LoginRoute {
public static final Companion Companion = new Companion((byte)0);
...
public static final class Companion {
private Companion() {}
}
}
// LoginRoute$Companion.class
public final class Companion {
private Companion() {}
}
```
#### With obfuscation
```
// LoginRoute.class
@Serializable
public final class LoginRoute {
public static final a Companion = new a((byte)0);
...
}
// a.class
public final class a {
private a() {}
}
```
### With new rule
#### Without obfuscation
```
// LoginRoute.class
@Serializable
public final class LoginRoute {
public static final Companion Companion = new Companion((byte)0);
...
public static final class Companion {
private Companion() {}
public final KSerializer<LoginRoute> serializer() {
return (KSerializer<LoginRoute>)LoginRoute.$serializer.INSTANCE;
}
}
}
// LoginRoute$Companion.class
public final class Companion {
private Companion() {}
public final KSerializer<LoginRoute> serializer() {
return (KSerializer<LoginRoute>)LoginRoute.$serializer.INSTANCE;
}
}
```
#### With obfuscation
```
// LoginRoute.class
@Serializable
public final class LoginRoute {
public static final a Companion = new a((byte)0);
...
}
// a.class
public final class a {
private a() {}
public final b serializer() {
return (b)LoginRoute$$serializer.INSTANCE;
}
}
```
## Testing
- new test
- snippet above doesn't produce the error anymore
## Release Notes
### Fixes - Desktop
Fix `runRelease` task when navigation and `obfuscate.set(true)` are used
Update Docker image for Skiko Windows build to the latest Windows Server
2022 and Visual Studio 2022
Also add LLVM to the image and avoid downloading it on every build
## Testing
Latest Skiko compiles successfully on CI
This should be tested by QA
## Release Notes
N/A
CompatibilityDistributionTest::testWebJsWasmReconfigured makes sure that
composeCompatibilityBrowserDistribution task can be reconfigured to be
used with arbitrary set of input tasks
## Testing
Pipeline
## Release Notes
N/A
The goal of this particular PR is to make code generated by
composeCompatibilityBrowserDistribution safer in scenarios where
original script was injected (and executed as a consequence of this)
before DOM is loaded
## Testing
Manual
## Release Notes
N/A
## Testing
Clone https://github.com/Schahen/ComposeWebApp and run
```
./gradlew :composeApp: composeCompatibilityBrowserDistribution
```
## Release Notes
### Features - Web
- Introduce composeCompatibilityBrowserDistribution task. This task
combines two prod distributions - for js and for wasm in such way so
that if modern require features are not supported by the consumer
browser, application switch to js mode.
---------
Co-authored-by: Oleksandr Karpovich <a.n.karpovich@gmail.com>
Co-authored-by: Konstantin Tskhovrebov <konstantin.tskhovrebov@jetbrains.com>
After decoupling Material3 from Compose, we need to pass their versions
separately
[CI
fix](df83b9cf9a)
## Testing
```
./check.sh
./check.sh -Dcompose.version=1.9.0-alpha02
./check.sh -Dcompose.version=1.9.0-alpha01 -Dcompose.material3.version=1.9.0-alpha03
```
## Release Notes
N/A
Fixes
https://youtrack.jetbrains.com/issue/CMP-8268/Decouple-material3-versioning-from-Compose
## Release Notes
### Migration Notes - Multiple Platforms
- Material3 versioning is decoupled for the CMP 1.9.0 release due the
upstream Jetpack Compose Material3 1.4 has not been released as stable
yet
- `compose.material3` now points to the latest stable Material3 version,
1.8.2. If the latest Material3 features are needed, please include it
this way:
```
implementation("org.jetbrains.compose.material3:material3:1.9.0-alpha04")
```
Fixes
```
java.util.zip.ZipException: duplicate entry: org/jetbrains/compose/material/material-navigation/1.9.0-alpha03/material-navigation-1.9.0-alpha03.module.sha512
16:53:22 at org.jetbrains.compose.internal.publishing.UploadToSonatypeTask.createDeploymentBundle(UploadToSonatypeTask.kt:90)
```
It happened because we pass
`-Pmaven.central.coordinates=org.jetbrains.compose*:*:1.9.0-alpha03,org.jetbrains.compose.material:material-navigation*:1.9.0-alpha03`
which points to intersected artifacts. When we add
`org.jetbrains.compose.material:material-navigation*` into the bundle,
we already added it by `org.jetbrains.compose*:*`. This is [a known
issue](https://youtrack.jetbrains.com/issue/CMP-8504/Maven-Central-uploading.-Intersection-of-version-groups)
## Testing
```
./gradlew -p=cli reuploadArtifactsToMavenCentral --info --stacktrace -Pmaven.central.sign=true -Pmaven.central.coordinates=org.jetbrains.compose*:*:1.9.0-alpha03,org.jetbrains.compose.material:material-navigation*:1.9.0-alpha03,org.jetbrains.compose.material3.adaptive:*:1.2.0-alpha03,org.jetbrains.androidx.graphics:graphics-shape*:1.0.0-alpha09,org.jetbrains.androidx.window:*:1.4.0-alpha08 -Pmaven.central.deployName="Compose 1.9.0-alpha03 and associated libs" --rerun-tasks
```
with disabled signing and uploading to Maven no longer produces the
error
## Release Notes
N/A
- new API requires creating a zip
- API code is copied and adapted from
[compose-hot-reload](799b90b76f/buildSrc/src/main/kotlin/PublishToMavenCentralTask.kt (L39))
- [CI change](https://jetbrains.team/p/ui/reviews/31/timeline)
## Testing
1. Configure Maven Space Token in
https://public.jetbrains.space/p/compose/edit/applications, write it in
cli/build.gradle.kts
2. Use Maven Central token, write it in cli/gradle.properties
3.
```
..\gradlew reuploadArtifactsToMavenCentral --info --stacktrace -Pmaven.central.coordinates=org.jetbrains.compose*:*:1.8.0,org.jetbrains.compose.material:material-navigation*:2.9.0-beta02,org.jetbrains.compose.material3.adaptive:*:1.1.0 -Pmaven.central.deployName="Compose1.8.0 and associated libs" --rerun-tasks
..\gradlew reuploadArtifactsToMavenCentral --info --stacktrace -Pmaven.central.coordinates=org.jetbrains.skiko*:*:0.9.16 -Pmaven.central.deployName="Skiko 0.9.16" --rerun-tasks
```
downloads packages from Space, creates a zip, and uploads as a new
(non-published) deployment.
With failed state, because signing was disabled:
<img width="305" alt="image"
src="https://github.com/user-attachments/assets/0a32e185-e43b-4783-9145-84aba64d41c0"
/>
I will check on a valid uploading on Skiko after the merge
## Release Notes
N/A
When the 1.8.2 release was prepared, the release notes from
https://github.com/JetBrains/compose-multiplatform/pull/5323 were
malformed by stripping empty lines:
```
- Support Preview parameters for Previews in common source sets in IJ and AS. Note: IDEs also need to implement support on their end. Please check the respective IDE release notes to confirm this is supported [#5323](https://github.com/JetBrains/compose-multiplatform/pull/5323)
Example usage:
\\\
import androidx.compose.runtime.Composable
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.jetbrains.compose.ui.tooling.preview.PreviewParameter
import org.jetbrains.compose.ui.tooling.preview.PreviewParameterProvider
class MyPreviewParameterProvider : PreviewParameterProvider<String> {
override val values = sequenceOf("Hello, Compose!", "Hello, World!")
}
/**
* This function will generate two preview images with different texts
*/
@Preview@Composable
fun MyPreview(@PreviewParameter(MyPreviewParameterProvider::class) text: String) {
Text(text)
}
\\\
```
The correct release notes are:
```
- Support Preview parameters for Previews in common source sets in IJ and AS. Note: IDEs also need to implement support on their end. Please check the respective IDE release notes to confirm this is supported [#5323](https://github.com/JetBrains/compose-multiplatform/pull/5323)
Example usage:
\\\
import androidx.compose.runtime.Composable
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.jetbrains.compose.ui.tooling.preview.PreviewParameter
import org.jetbrains.compose.ui.tooling.preview.PreviewParameterProvider
class MyPreviewParameterProvider : PreviewParameterProvider<String> {
override val values = sequenceOf("Hello, Compose!", "Hello, World!")
}
/**
* This function will generate two preview images with different texts.
*/
@Preview@Composable
fun MyPreview(@PreviewParameter(MyPreviewParameterProvider::class) text: String) {
Text(text)
}
\\\
```
To fix this issue, the parsing is changed. Previously `ChangelogEntry`
represented a single line, even if it is part of a single change. Now it
represents the change as a whole.
## Testing
These commands give the same result, with the exception that multiline
release notes are handled correctly now:
```
kotlin changelog.main.kts v1.8.1..v1.9.0-alpha02
kotlin changelog.main.kts v1.8.1..v1.8.2
kotlin changelog.main.kts v1.8.0..v1.8.1
kotlin changelog.main.kts v1.8.0-beta02..v1.8.0-rc01
```
## Release Notes
N/A
Describe proposed changes and the issue being fixed
Fixes
[CMP-8134](https://youtrack.jetbrains.com/issue/CMP-8134/Switch-the-ClassLoader-used-by-ResourceReader)
## Testing
- [x] Add Test to **desktopTest** SourceSet
- (Optional) This should be tested by QA
## Release Notes
### Features - Resources
- Added `JvmResourceReader` API and made `LocalResourceReader` public to
allow providing a custom classloader for desktop target
instead of relying on maven publications for compose compiler test runs,
rely on kotlin builds via "artifact" dependency
artifacts from those kotlin builds should be placed in maven local (done
on teamcity config side)
## Release Notes
N/A
Exposed the following Preview annotation parameters:
- name
- group
- widthDp
- heightDp
- locale
- showBackground
- backgroundColor
## Testing
Tested the local artifact in IJ: new parameters are exposed and picked
up. No additional changes on the IDE end are required.
But this should be tested by QA, of course.
## Release Notes
### Features - Multiple Platforms
- Extended the `@Preview` annotation with the following parameters:
- name
- group
- widthDp
- heightDp
- locale
- showBackground
- backgroundColor
IDE (IJ or AS) will pick up these parameters in the same way it works
for `androidx` Preview annotations.