I'm currently hitting <this one>: ```Project `...`...
# compose-web
o
I'm currently hitting this one:
Copy code
Project `...` has `compose` and `kotlinx.serialization` plugins applied!
>>> Consider using these plugins in separate modules to avoid compilation errors
In a multiplatform build, it seems there is no way to apply a plugin to a selected module only. Am I correct to assume that a single multiplatform build script cannot be configured to create modules that way?
1
a
Not sure if I understand your question right... Currently if you want to use Compose and Serialization together, they should be placed in separate modules
o
Yes, but such a module cannot be built by simply adding another source set to a single multiplatform build script, right?
j
A module is a very specific thing in gradle. Adding an additional source set does not create a new module. Separate modules typically have separate build.gradle files.
🙏 1
o
here is an example with compose and kotlinx.serialization https://github.com/eymar/reproducing-issues/tree/compose-web-with-serialization module
data
uses serialization, and the main module depends on module
data
🙏 1
o
Thank you for clarifying, and also for providing the valuable example. This is what I had in mind. Terminology seems a bit difficult across the entire build system. If I got it right: There are Gradle (sub-)projects creating artifacts, which can be executed or imported via module dependencies. There are also Kotlin compiler modules (translation units, relevant for 'internal' visibility among others). Then there are Gradle plugins configuring Kotlin compiler plugins. In this case, the problem seems to be the compose compiler plugin clashing with the kotlinx.serialization compiler plugin. Both are configured uniformly across a Gradle (sub-)project, and even multiplatform cannot change this. While multiplatform can create multiple artifacts (conceptually one per target), it only supports one Kotlin compiler configuration per target. And this is why the workaround is to separate everything into a multi-project Gradle build...