Skip to content

Conversation

pjBooms
Copy link
Collaborator

@pjBooms pjBooms commented Oct 3, 2025

Compose Hot Reload Gradle plugin are bundled into the Compose Gradle plugin.

Fixes CMP-8885

Testing

Integration tests added

This should be tested by QA

Release Notes

Highlights - Multiple Platforms

  • Compose Hot Reload Gradle plugin is bundled with Compose Gradle plugin (non need to configure it separately)

@pjBooms pjBooms requested a review from sellmair October 3, 2025 15:49
@pjBooms pjBooms force-pushed the pjBooms/embed-compose-hot-reload-plugin branch from 2195620 to a800d3f Compare October 6, 2025 10:11
# A version of Gradle plugin, that will be published,
# unless overridden by COMPOSE_GRADLE_PLUGIN_VERSION env var.
deploy.version=9999.0.0-SNAPSHOT
hotreload.version=1.0.0-beta08
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess Ii's supposed to be configured on CI, here is the place only for some placeholder

cc @igordmn

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to configure it only here, not on CI.

Because it is a dependency version, not a version of the building component.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is usually better to define such versions in lib.versions.toml, not in gradle.properties

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to have a place for version declaration that I can use in build script as well as in tests. I can't use lib.versions.toml from tests. I see that versions are exported to sources via ComposeBuildConfig generation. And ComposeBuildConfig is generated based on gradle.properties. Though I can use lib.versions.toml from build.gradle.kts and export it via ComposeBuildConfig but, I am not sure here because it won't be aligned with other declarations.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though I can use lib.versions.toml from build.gradle.kts and export it via ComposeBuildConfig but, I am not sure here because it won't be aligned with other declarations.

It is not so important, but I suggested this because of the different nature from the build perspective - HotReload is hardcoded dependency that is built separately, Compose/Material3 on the other hand are non-hardcoded components passed from CI. That is why, it is probably better to have them configured differently.

From user (not build) perspective, they probably have the same nature - they are all versions of something provided by the plugin. That is why, it is probably better to have them in one place in ComposeBuildConfig.

The edge between component/dependency and hardcoded/passed from CI is thin, so any solution in the end should work, choose one you think is better.


try {
project.pluginManager.apply("org.jetbrains.compose.hot-reload")
} catch (_: Exception) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Catching any exception might swallow issues? How about catching only the exception we get when the plugin is missing?

override fun canRelocatePath(path: String?): Boolean {
return super.canRelocatePath(path) &&
// do not relocate orchestration as its objects are used in serialization.
path?.startsWith("org/jetbrains/compose/reload/orchestration/") == false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of right now, we are locked out with this attempt:
We cannot shade the orchestration as this breaks java.io.Serializable, we cannot embedd it either because of classpath conflicts

Copy link
Member

@sellmair sellmair left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waiting for the approach with the 'preferred' dependency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants