Image for post
Image for post
Credits: Icons made by Maxim Basinski and Smashicons from www.flaticon.com are licensed by CC 3.0 BY.

Introduction

DSL (Domain Specific Language) is a pretty common way to provide an abstraction of an specific application domain. For example Kotlin, Java and Swift are “general-purpose languages”. SQL and HTML are “domain specific languages”.

Nowadays, Kotlin is getting more and more popular in the DSL world for the features it provides to create your own DSL:

I’m not going to write much about how to use Kotlin to create your own DSL as there are plenty of great posts about this (also this and this talks from the KotlinConf 2018) but I would like to focus more in other aspects. …


Image for post
Image for post
Background Designed by Freepik

Setup Kotlin EAP in your Android project

EAP stands for Early Access Preview. It’s how JetBrains share version of code that are not yet considerable stable but are on their way to be there.

Maybe you read in the news that Kotlin next version will bring some super amazing features X and Z and you would like to try them out or maybe start preparing your App for those changes. So here we are going to see which are the steps to be on the cutting edge of Kotlin 😎

So these are the steps that we need to do:

  1. Kotlin Plugin: The plugin enriches the IDE by providing all Kotlin specific functionality like suggesting you to use a lambda, use String interpolation and also to understand Kotlin code. Updating this will bring all EAP new stuff to your IDE. …

Image for post
Image for post

Kotlin DSL RC 1.0 is here 👏

Kotlin DSL is Kotlin language support for Gradle build scripts.

So it means that now you will be able to write your gradle files in Kotlin instead of Groovy. There are plenty of reasons why Gradle is doing such a huge move but in general we can say that they are trying to bring all IDE super powers to build scripts like:

  • Auto-completion
  • Content assist
  • Quick documentation
  • Navigation to source code
  • Refactoring and much more

We have the Release Candidate 1.0 and you can use it since Gradle 4.10. The final release will be on Gradle 5. They said there will be no more breaking changes after that but being in RC this give us a lot of confidence that the API is getting more and more stable so that’s why I decided to upgrade my Android App to start using this. …

About

Juan Ignacio Saravia

Android Dev @ Globant | Argentinian living in the US

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store