Thursday, November 12, 2015

Kotlin Gradle Blooper!

This weekend I had a blast working through the Kotlin Koans, so I thought I'd fire up my IDE and try my hand at porting one of my existing hobby projects from Groovy to Kotlin.

As I began working on it, I was surprised to notice that some of the cool features from the Koans and other examples online weren't available to me in my project -- things like doing MyClass::class.java, listOf(), and even forEach on my List<> objects.

My build.gradle file was including the kotlin-gradle-plugin, of course, but if you want all the goodies, you've got to also include the Kotlin Standard Library:


dependencies {
    compile 'org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version_number'
}

Naturally, the instructions for configuring dependencies for the Kotlin Gradle plugin say very clearly to include it, and they even give a full example. I guess in my excitement I just skipped over that part! My bad, yo.

So... if you're a Kotlin newb like me and your code seems to be missing some major Kotlinness, be sure to include the Standard Library!

Leeds out.

1 comment:

  1. Those games often have a limited number of seats, so that they have to be crammed with paying prospects. The key distinction is there's be} a|that there's a} stay dealer which is shown through a stay feed in a brick and mortar casino. You’ll be able to|be capable of|have the 카지노 사이트 flexibility to} chat backwards and forwards with the dealer, and presumably tablemates. Most, if not all, on-line casinos let you play their games free of charge. Most casinos will require you to create an account first, however that ought to solely take a few minutes to do. If French has the ‘la partage’ rule, then you need to} select that model.

    ReplyDelete

Profile Picture
Dave Leeds
My Hobbies:
  • Programming
  • Cartooning
  • Music Writing
Full Profile