Select kotlinc, uncheck Debug executable, and then click Close. Type a forward slash, then continue to navigate to /usr/local/bin. Choose the Info tab, select Other from the Executable pop-up list. (See the kts extension? This allows it to be run as a script.)Įdit your Run scheme (Scheme > Edit Scheme or Command-<). Click Next. Navigate to a save location and click Create.Ĭhoose File > New > macOS > Other > Empty. Enter a name, and edit the build tool to kotlinc. However if you rename the file from hello2.kt to hello2.kts, you can run it as a command-line script:Ĭreate a new Cross-platform Xcode project: File > New > Project > Cross-platform > External Build System > Next. Unfortunately, it’s not as simple as one might hope to create a straightforward script: Then you can run the 736709-byte large jar results with (ew) java. Notice that you have to call kotlinc, the command line compiler, not kotlin. Once again I discovered that Kotlin is a little less straightforward than Swift in this regard. You run the Kotlin REPL with kotlinc-jvm, which I did not guess on my first try and had to hunt around doing web searches to discover: I used brew: brew install kotlin, which installed a copy to /usr/local/bin/kotlin on my first try. I know nothing about Kotlin other than it’s vaguely Swifty and has a little too much Java in it for my decaf tastes. Andy Wilkinson wanted some useful tips for Kotlin in the style of my normal blog.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |