Use temporary sourceSet

Hi!
Ive got a project where i got main(kotlin, java, resources) and a dev folder with the same folders.
I want the dev folder to be able to overwrite the main one, so that i can test alternate stuff, provide alternate configs and so on.
Ive found no way to do this other then to copy all the source files & resources to a third location (since i can state to overwrite them there) and then use those folders for the gradle compile.
However i got two issues with this approach.

  1. IntelliJ now thinks that those folders are my main source folders, even though i apply the sourceSets in the Jar task, not globally
  2. Since IntelliJ (or gradle, not sure) still sees /src/main/kotlin as a module, even though not defined anywhere in build.gradle, it complains about duplicate classees.

Heres my build file currently: val copySrcTask = task("copySrc") { val ssSrc = "build/tmp/ss-src" del - Pastebin.com

If theres any way i can make those sourceSets only apply during compile and fix the kotlin duplicate issue and/or if theres a better way thatd be great.
Thankfull for any help :slight_smile: