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

Add API to not apply the Compose Compiler plugin #3722

Merged
merged 5 commits into from
Sep 26, 2023

Conversation

eymar
Copy link
Collaborator

@eymar eymar commented Sep 22, 2023

This a solution for #3695

Usage:

compose {
    excludePlatform(KotlinPlatformType.js, KotlinPlatformType.native)
}

or

compose {
    platformTypes.set(platformTypes.get() - setOf(KotlinPlatformType.js, KotlinPlatformType.native))
}

2nd sample seems to be too verbose, so maybe we can make platformTypes private.


Note:
this solution will make it possible to disable the Compose Compiler plugin for all targets which have given KotlinPlatformType.
A project can have many targets with the same KotlinPlatformType:

jvm("backend) {}
jvm("frontend") {}
// etc

compose.excludePlatform(KotlinPlatformType.jvm) will disable the compose compiler plugin for all jvm targets.
While we don't have a use case for now where it can be a problem, I wanted to highlight this.

__

As a next iteration we can improve the DSL to something like this:

kotlinCompilerPlugin {
    artifact = "1.5.0"
    args = ""
    platformTypes = setOf()
}

eymar and others added 3 commits September 25, 2023 15:16
…omposeExtension.kt

Co-authored-by: Igor Demin <igordmn@users.noreply.github.com>
…omposeExtension.kt

Co-authored-by: Igor Demin <igordmn@users.noreply.github.com>
- Deprecate `compose.web.targets` in favor of `compose.platformTypes`
- refactor `configureExperimentalWebApplication` to support multiple k/js targets
@eymar eymar merged commit 5ad1712 into master Sep 26, 2023
6 checks passed
@eymar eymar deleted the api_to_not_apply_compose_plugin branch September 26, 2023 08:01
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

3 participants