I'm developing an application that runs on multiple targets. Is it better to have the common code as its own project and then separate projects for each target: android, ios, jvm, etc. Or would it be better to have it contained under a single project?
j
jw
08/10/2024, 4:05 AM
Such a thing is entirely subjective
h
hfhbd
08/10/2024, 4:27 AM
If you want to use the Java Gradle plugins like application, you should move the JVM app target into its own project because 2.0.20 will emit a warning if you apply JVM targets with KMP. Also, Android application and JVM application plugin does not work in same KMP project.
Personally, I would also create a common module (aka library) and a target module for each platform, mostly because of Gradle/KMP support.
➕ 1
c
CLOVIS
08/12/2024, 12:39 PM
Do you mean "project" as in "Gradle project" (= an IntelliJ module) or "project" as in "Git repositories" ?
If it's the former, I agree with the previous answers. If it's the latter, I definitely recommend a single repository.