A deep dive into an initial Kotlin build.gradle.kts

An introduction to plugins, repositories & dependencies with side-notes on BOMs, the JetBrains namespace, why `java-library` is (almost) redundant & why JCenter is dangerous

Gabriel Shanahan
8 min readJan 13, 2020

Have you heard about the Kotlin Primer? It’s an extensive, hands-on and detailed guide to the Kotlin language full of unique and original explanations, interactive exercises, and concrete recommendations based on experience. It will transform anyone who knows Java into a Kotlin expert within a matter of days. Check it out!

This is the third article in a series about building a Kotlin project with Gradle configured using the Kotlin DSL. In the previous one, we talked about installing Gradle and running gradle init for the first time. We briefly described the files and folders that Gradle generates, except for the most interesting one, build.gradle.kts. If you didn’t follow the article, you can take a look at the source code here.

In this article, I want to focus exclusively on the contents of build.gradle.kts.

--

--