Skip to content
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

[gradle] A flag to disable multimodule resources. #4771

Merged
merged 4 commits into from May 8, 2024

Conversation

terrakok
Copy link
Collaborator

@terrakok terrakok commented May 7, 2024

The Compose Multiplatform Resources with the mulimodule.publication support is a new feature and may have some not found problems. The PR introduces a gradle property to switch back to the previous behavior: org.jetbrains.compose.resources.multimodule.disable=true

Testing

After update to Kotlin 2.0.0 and CMP 1.6.10 all projects will be switched to the new logic with the multimodule support.
Gradle info output should contain a message:

Configure KMP resources

If the new feature breaks user's projects they may add org.jetbrains.compose.resources.multimodule.disable=true to the gradle.properties to disable it. After that Gradle info output will contain:

Configure compose resources

Release Notes

Features - Resources

  • To disable the Compose Resources publication and the multimodule support in cases of problems add org.jetbrains.compose.resources.multimodule.disable=true to the root gradle.properties.

@terrakok terrakok requested review from pjBooms and igordmn May 7, 2024 14:36
@igordmn igordmn requested a review from MatkovIvan May 7, 2024 14:45
@igordmn
Copy link
Collaborator

igordmn commented May 7, 2024

@MatkovIvan, please, review as well

@@ -22,7 +22,7 @@ internal object ComposeProperties {
internal const val MAC_NOTARIZATION_PASSWORD = "compose.desktop.mac.notarization.password"
internal const val MAC_NOTARIZATION_TEAM_ID_PROVIDER = "compose.desktop.mac.notarization.teamID"
internal const val CHECK_JDK_VENDOR = "compose.desktop.packaging.checkJdkVendor"
internal const val ALWAYS_GENERATE_RESOURCE_ACCESSORS = "compose.resources.always.generate.accessors"
internal const val ENABLE_MULTIMODULE_RESOURCES = "compose.resources.multimodule.enable"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it about publication and depending on resource library, or only about publication?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is about a publication and a multimoduleness (very close things in the gradle)

Copy link
Collaborator

@igordmn igordmn May 7, 2024

Choose a reason for hiding this comment

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

What happen if it is false, and users add a dependency on a library with resources? Will it work without this property?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure. It's false by default and all tests are green at least)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh, you meant a library with resources (not the resource's library!). No, it requires the flag

@igordmn
Copy link
Collaborator

igordmn commented May 7, 2024

Release notes should in this format:

Release Notes

Breaking changes - Resources

  • (prerelease fix) To enable the Compose Resources publication and the multimodule support add compose.resources.multimodule.enable=true to the root gradle.properties.

@terrakok terrakok changed the title [gradle] Hide multimodule resources under a flag. [gradle] A flag to disable multimodule resources. May 8, 2024
@terrakok terrakok requested review from MatkovIvan and removed request for pjBooms May 8, 2024 15:09
…esources/KmpResources.kt

Co-authored-by: Igor Demin <igordmn@users.noreply.github.com>
@terrakok terrakok merged commit bf6142d into master May 8, 2024
12 checks passed
@terrakok terrakok deleted the k.tskh/mm-res-flag branch May 8, 2024 17:42
terrakok added a commit that referenced this pull request May 8, 2024
The Compose Multiplatform Resources with the mulimodule.publication
support is a new feature and may have some not found problems. The PR
introduces a gradle property to switch back to the previous behavior:
`org.jetbrains.compose.resources.multimodule.disable=true`

## Testing
After update to Kotlin 2.0.0 and CMP 1.6.10 all projects will be
switched to the new logic with the multimodule support.
Gradle info output should contain a message:
```
Configure KMP resources
```

If the new feature breaks user's projects they may add
`org.jetbrains.compose.resources.multimodule.disable=true` to the
`gradle.properties` to disable it. After that Gradle info output will
contain:
```
Configure compose resources
```

## Release Notes
### Resources
To disable the Compose Resources publication and the multimodule support
in cases of problems add
`org.jetbrains.compose.resources.multimodule.disable=true` to the root
`gradle.properties`.

(cherry picked from commit bf6142d)
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.

None yet

4 participants