As for the Kotlin build script accessing everythin...
# kbuild
j
As for the Kotlin build script accessing everything else, well, that's what ProcessBuilder is for