Thread
#multiplatform
    g

    GarouDan

    3 years ago
    Hi guys, can we filter the packages to be considered inside of a source set? For example, are we able to do something like this?
    sourceSets {
    		val jvmMain by getting {
    			kotlin.srcDir("src/main/kotlin")
    			resources.srcDir("src/main/resources")
    			filterPackages("com.company.project.jvm") // filtering packages here
    		}
    My motivation is to try to join all sources in the same folder, for example
    src/main/kotlin
    . If we are to do this we could create some packages like:
    com.company.project.common
    ,
    com.company.project.js
    ,
    com.company.project.jvm
    Where all of them could be inside the
    src/main/kotlin
    .
    Dominaezzz

    Dominaezzz

    3 years ago
    This is indeed possible. Instead of filtering, just use the package folder as the source folder.
    Wouldn't really recommend doing it though.
    g

    GarouDan

    3 years ago
    Oh, thanks, I’ll give it a try. But why not? This is a dream for me. If organize things well we will neve try to use something that will not work. For example, everything in common should work to everything, everything in js should work only for js and everything in js.react, for example, should work only with js react applications.
    Dominaezzz

    Dominaezzz

    3 years ago
    They should have different "packages", only different source sets. The platform specific code shouldn't have to be in a separate packages. It seems rather artificial.