So, this is a correct way how to do it in a way compatible with Groovy build scripts
project.extra["isIDEBuild"] = KotlinClosure0({
project.isIDEBuild
})
For Kotlin based build script is the best way to user Kotlin extension function or property like
val Project.isIDEBuild: Boolean
get() {
return this.hasProperty("android.injected.invoked.from.ide")
}