I'll try to get as near as possible to a useful Kotlin development environment. I won't use it for important applicationss or my job, just for pocket scripts and apps.
I'll focus on raw Kotlin, not using any build tool.
However, if all goes well, I don't see how I wouldn't be able to. After all, I have succesfully replaced Eclipse as my main Java IDE, except for something about JavaFX's WebView compilation, but runs fine.
I'm downloading the command-line compilator (Check for the latest / your favourite version.).
In Windows, it has to be extracted (to a cool location) and then its bin
folder has to be referenced in the PATH variable.
Check the installation for your OS online, it can be done from the command line.
There's a pack with this extensions and some more for Gradle. I won't be using Gradle for now.
The last one is to run inline code.
However, I'll use it for debugging. Unfortunately, the "Kotlin" extension doesn't support debug for simple Kotlin. Looking forward to it I guess.
It supposedly works with Gradle projects.
For executing Kotlin with Code Runner, we need the folloring settings:
"code-runner.executorMap": {
"kotlin":"kotlinc $fileName -include-runtime -d $fileNameWithoutExt.jar && java -jar $fileNameWithoutExt.jar",
"kotlinscript":"kotlinc -script $fileName"
},
"code-runner.languageIdToFileExtensionMap": {
"kotlin":".kt",
"kotlinscript":".kts"
}
Each of them along with the other default options, of course. Go to File > Preferences > Settings, optionally filter by "Code Runner", the settings are "Executor Map" and "Language ID To File Extension Map".
Ctrl + N (New Untitled File)
Write:
fun main() = println("Hello, world!")
Ctrl + Alt + J (Command Pallete > Run By Language)
kotlin + Enter
You should be able to see the output in the console.
You can run code! And compile it to jar (when you run it; proper task, exe and kexe coming soon).
I haven't found how to import libraries without using Gradle... yet.
But I've tested a simple script importing Java and it works.
The kotlin-compiler file has some libraries inside apparently, but I haven't tested them. Maybe we can put new libraries in the directory those included libs are.