How to pass compiler arguments to Kotlin Compiler with Gradle

You can specify compiler args inside kotlinOptions closure on tasks of KotlinCompile type. For all of them, for instance:

allprojects {
    ...

    tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
        kotlinOptions {
            jvmTarget="1.6"
            freeCompilerArgs += '-include-runtime'
        }
    }
}

Kotlin docs: using Gradle

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)