Quantcast
Channel: Gradle Forums - Latest posts
Viewing all articles
Browse latest Browse all 19888

Declare and use project.extmyFunction in Kotlin

$
0
0

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")
    }

Viewing all articles
Browse latest Browse all 19888

Trending Articles