Dico

    Dico

    3 years ago
    Can I take a multiplatform project with only a jvm target, and change it to a jvm project with 2 jvm sourcesets?
    Nicholas Bilyk

    Nicholas Bilyk

    3 years ago
    So you want what should be "commonMain" to be another jvm source set (for now), correct?
    plugins {
        kotlin("jvm") version("1.3.31")
    }
    
    repositories {
        jcenter()
        mavenLocal()
    }
    
    sourceSets["main"].withConvention(KotlinSourceSet::class) {
        kotlin.srcDir("src/jvmMain/kotlin")
        kotlin.srcDir("src/commonMain/kotlin")
    }
    Dico

    Dico

    3 years ago
    Yes, that's right!
    I have something similar right now with dependsOn, but this seems better, thanks!
    Nicholas Bilyk

    Nicholas Bilyk

    3 years ago
    oh, hm, your way might be better, you wouldn't want commonMain to see jvmMain..