I summarized the way to write build.gradle and settings.gradle in Kotlin.
Environment
Kotlin 1.2.0
Gradle 4.4 RC 5
Required
Gradle 3.0 M1 or higher is required for writing build.gradle in Kotlin, Gradle 4.4 RC1 or higher is required for writing settings.gradle.kts in Kotlin.
From Gradle 4.0 RC1, it is not needed because Kotlin DSL 0.9.0 is included, but when you use earlier Gradle, you have to write the following line into settings.gradle.
Intellij IDEA consider rootProject as the interface without getName method, so I cast it to ProjectDescriptor. It can be also built successfully without cast.