Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Gradle and Its New Kotlin DSL [Video]

DZone's Guide to

Gradle and Its New Kotlin DSL [Video]

Interested in trying out Gradle's Kotlin DSL? Here is a simple screencast that depicts the advantages and disadvantages of using Kotlin with Gradle.

· Java Zone ·
Free Resource

Verify, standardize, and correct the Big 4 + more– name, email, phone and global addresses – try our Data Quality APIs now at Melissa Developer Portal!

A couple of months ago, the Gradle team decided that you can now also write your build.gradle files with Kotlin instead of Groovy. Although this whole effort is still in its infancy, it can turn out to be quite exciting. Why? 

Because with  Kotlin build.gradle.kts files, you get compile errors if you specify incorrect options. You get autocompletion. Basically, everything a statically typed language offers you. That does not mean that your Groovy scripts will be deprecated in the future — they will still be supported. Rather, it means you now have the choice to choose whatever suits you best and you think makes you more productive.

To get you started, I compiled a small, practical screencast on how to turn a simple Java Gradle project, into a Java Gradle project with the Kotlin DSL. After watching it, you should have a good grasp of how the Kotlin DSL works and what the current advantages and disadvantages of using it are. Enjoy!


Developers! Quickly and easily gain access to the tools and information you need! Explore, test and combine our data quality APIs at Melissa Developer Portal – home to tools that save time and boost revenue. 

Topics:
java ,gradle ,build ,kotlin dsl ,groovy

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}