s

    Sylvain Patenaude

    2 years ago
    Context: I'm developing a Kotlin MP API (or SDK) targeted for Android/iOS. The project includes the common code (MP) and probably some platform-specific code (Android/iOS). It doesn't include client apps, as the consumers would import the generated native libraries from outside this project. Based on this, would you have only one build.gradle file (with the appropriate targets/sourceSets) or would you rather have many: for instance, one main in the parent project and others for "child" modules (Android, iOS and possibly 'common')? For now I have only one at project (root) level. Thanks in advance.
    Kris Wong

    Kris Wong

    2 years ago
    I use one build.gradle.kts for each library/framework
    s

    Sylvain Patenaude

    2 years ago
    So in my case of Android/iOS targets, you mean one per target? So I would have 2? But none at root/project level that contains multiplatform stuff? Such as: plugins { id 'org.jetbrains.kotlin.multiplatform' version '1.3.50' }
    Kris Wong

    Kris Wong

    2 years ago
    sorry, my statement was ambiguous
    one per project (module)
    s

    Sylvain Patenaude

    2 years ago
    Ok. So you have one at root level as well (parent project/module).
    Kris Wong

    Kris Wong

    2 years ago
    just one
    try the "Mobile Shared Library" project template in IDEA and you will see the setup
    s

    Sylvain Patenaude

    2 years ago
    Yeah, that's what I did. There's only a single build.gradle file in that setup (in the root folder of the project). In all the sub-modules (commonMain, iosMain, jvmMain, etc.), there aren't any build.gradle file.