I'm having some trouble conceptualizeing how to se...
# compose
z
I'm having some trouble conceptualizeing how to set up gradle for a multiplatform compose project. I wanna support desktop, and android, maybe web and iOS. For Android I want to support TV and standard android phones I'm not sure mainly how to structure my modules
d
What's your trouble? General structure or something special? You might know the template or the multiplatform wizard. They always a good starting point for me. About the Android and ATV question. It depends: • Do you plan build different flavors for them? • Or separate code base with some shared code? To separate the code you could create a sourceset like
commonAndroid
and specific source sets for Android and ATV.
z
I'd like to have a common code for everything in my project. It all revolves around one API. Some of the UI I could probably have common components and then different layouts for each platform/device
a
In multiplatform projects, modules are basically separated in the same way they are separated in single-platform projects, i.e. by features. A module can have multiple source sets and that is how you organize source code for different platforms. You just need an application module as the leaf module for each platform (except iOS, iOS app is not a Gradle module).