Build different versions of Kotlin library

I have a kotlin library project in the IntelliJ IDE with source folders like this:


The bulk of the source code is in the main folder. However, I’d like to build two slightly different versions of the library using the source file(s) held in the forRelease and forDev folders.

My gradle build file is written in kotlin.

I have managed to create sourceSets as follows:

kotlin {

However, I’m now stuck as to what to do with the sourceSets. If I run the assemble gradle task it will correctly use the source code in src/main and src/forRelease, but how cab I assemble the library using the forDev sourceSet?

Thanks in advance.