How to exclude kotlin files from compiling with gradle

With Java, we are excluding like this (with groovy dsl):

java {
    srcDir 'src'
    exclude '**/myTests/**'
}

I want to make the same thing with kotlin.
Trying to find some docs on this in official documentation configuring kotlin with no success.
What i’ve expected and already tried (and of course with no success):

kotlin {
    srcDir 'src'
    exclude '**/myTests/*.kt'
}

Hi Alex,

If your using kotlin dsl to write gradle scripts then try this

sourceSets["main"].withConvention(KotlinSourceSet::class) {
    kotlin.srcDir("src/main/kotlin")
    kotlin.include("**/myTests/*.kt")
}

If groovy then it should be something like this (just a guess as I am not using groovy)

sourceSets {
    main {
        kotlin {
            srcDirs = ['src']
            includes = ['**/.kt']
        }
    }
}

Let me know how it goes