Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run Kotlin Koans in IntelliJ? What is the "Main class"?

I have downloaded Kotlin Koans from Github, installed IntelliJ IDEA 2016.1.3 and opened the Koans project. As I understand I need a Configuration to run the examples. This Configuration needs a Main class. I cannot figure out where I find the main class in the Kotlin Koans. I have searched for one but found none (except for a special one in htmlDemo.kt).

I see that some kind of unit test framework is used. It probably somehow calls task0 but the IDE shows no references to task0 except one from todoTask0. The only reference to todoTask0 is in task0. So we have circular references but nowhere do I find an external reference to call up one of these functions.

Can someone explain to me how to get the Kotlin Koans running in the IntelliJ IDE?

like image 544
Tina Hildebrandt Avatar asked Jul 01 '16 13:07

Tina Hildebrandt


1 Answers

The easiest way is to install the Kotlin Edu plugin. You may read this JB blog post for additional info.

You could also run all koans tests without the plugin.IDEA allows you to run applications and tests directly from the IDE by clicking the Run icon near the test or application definition:

enter image description here

like image 102
awesoon Avatar answered Oct 14 '22 13:10

awesoon