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

Allow enabling compose compiler per target in multiplatform module #4209

Closed
mgroth0 opened this issue Jan 31, 2024 · 6 comments
Closed

Allow enabling compose compiler per target in multiplatform module #4209

mgroth0 opened this issue Jan 31, 2024 · 6 comments
Assignees
Labels
compiler Compiler plugin related enhancement New feature or request

Comments

@mgroth0
Copy link
Contributor

mgroth0 commented Jan 31, 2024

Consider a project with a single multiplatform module with a js target for frontend and a jvm target for backend. This module might want to only enable the compose gradle plugin, compose compiler, and compose dependencies for the JS target and completely leave out compose for the jvm target.

This is discussed in #1568. But it seems that issue is being treated as a question and not an enhancement proposal. So here I am making the proposal that the Compose Multiplatform Gradle Plugin allows developers to toggle compose per Kotlin Multiplatform target within a single module.

@mgroth0 mgroth0 added enhancement New feature or request submitted labels Jan 31, 2024
@mazunin-v-jb mazunin-v-jb added compiler Compiler plugin related and removed submitted labels Jan 31, 2024
@eymar
Copy link
Member

eymar commented Feb 16, 2024

Will this solution work for you? #3722 compose.platformTypes

@mgroth0
Copy link
Contributor Author

mgroth0 commented Feb 21, 2024

Thanks, It definitely helps a lot! It likely will resolve all the practical issues I have for now.

Just curious though, what is stopping us from implementing control at an even finer level of granularity such as per source set or per gradle configuration?

@eymar
Copy link
Member

eymar commented Feb 21, 2024

Not sure that configuring it per source set is possible at all. The source sets can't be compiled independetly. All relevant source sets get "combined" to compile for a particular target, and if a target declares to apply the Compose plugin, it means it's applied to all code (involved source sets).

And as for gradle configurations, I'm not sure I understand how it can affect the logic to apply or not apply the plugin.
I guess we can only decide to apply or not based on the target type or target name.

@mgroth0
Copy link
Contributor Author

mgroth0 commented Feb 21, 2024

I realize I misunderstood some terminology. You mentioned in your PR you can have

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

Which you referred to as multiple "targets". I thought these were called source sets, but I think I was wrong here.

This can be closed I think? Thank you.

@eymar
Copy link
Member

eymar commented Feb 21, 2024

Yes, those are 2 jvm targets with different names.

Sure, let's close it.

@eymar eymar closed this as completed Feb 21, 2024
@okushnikov
Copy link
Collaborator

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

@JetBrains JetBrains locked and limited conversation to collaborators Dec 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler Compiler plugin related enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants