The default position where Gradle searches for Kotlin files is in the src/main/kotlin directory. We'll place our hello.kt file in the src/main/kotlin/com/packtpub/appendix directory:
package com.packtpub.appendix
fun main(args: Array<String>) {
println("Hello, World!")
}
And now we can compile and run in one go with the following command:
$ ./gradlew
As we defined that our default task is run and our main class is com.packtpub.appendix.HelloKt, just by running ./gradlew we can build and run our peogram.