Hi, I have a multi-module multi-platform project a...
# multiplatform
j
Hi, I have a multi-module multi-platform project and am trying to get the gradle configuration to work. Right now I'm just trying to convert 1 sub-module over to a multi-platform module. Specifically I am using 1.3 DSL with source sets. I have moved my existing code out of src/main/kotlin and into src/jvmMain and attempted to configure a jvmMain source set to compile those files. I have tried adding the source set configuration to both the root project and the module with no success. No errors, just the files don't get compiled. Its like nothing is looking at the src/jvmMain directory and is still looking at src/main/kotlin.
For the curious, my multi-platform config in the main build.gradle looks like
Copy code
kotlin {
    jvm() {
        compilations.all {
            kotlinOptions {
                jvmTarget = "1.8"
            }
        }
    }

    sourceSets {
        commonMain {
            dependencies {
                implementation kotlin('stdlib-common')
            }
        }
        commonTest {
            dependencies {
                implementation kotlin('test-common')
                implementation kotlin('test-annotations-common')
            }
        }
        jvmMain {
            dependencies {
                implementation kotlin('stdlib-jdk8')
            }
        }
        jvmTest {
            dependencies {
                implementation kotlin('test')
                implementation kotlin('test-junit')
            }
        }
    }
}
I have also tried a similar configuration in the sub-module's build.gradle except without the
jvm() ...
piece
g
Do you have a commonMain folder as well?
j
I do, but right now I don't have any source code in there. My thinking was I could take existing code which only targets the jvm and convert it to the multi platform format.