GarouDan
11/13/2018, 7:22 PMcommonMain,
commonTest,
jvmMain,
jvmTest,
jsMain,
jsTest
to
main,
test,
jvmMain,
jvmTest,
jsMain,
jsTest
h0tk3y
11/14/2018, 6:19 PMmain
and test
were not used because of naming (and semantic) conflicts with the Android & Java source sets and variants of the same name. If you don't target Android, you can actually do it by just adding your custom source sets and making commonMain
and commonTest
depend on them:
kotlin {
sourceSets {
main { }
test { }
commonMain.dependsOn main
commonTest.dependsOn test
}
}
If you would just like to put the sources in the src/main
and src/test
directories, you can instead add those to the commonMain
and commonTest
source sets by putting this in `kotlin { sourceSets { ... } }`:
commonMain {
kotlin.srcDirs 'src/main/kotlin`
resources.srcDir 'src/main/resources'
}
Currently, the commonMain
and commonTest
source sets are created unconditionally by kotlin-multiplatform
, there seems to be no other way to affect that and achieve what you want.GarouDan
11/16/2018, 12:26 PM