{"id":16360,"date":"2019-06-19T10:33:57","date_gmt":"2019-06-19T08:33:57","guid":{"rendered":"https:\/\/www.inovex.de\/blog\/?p=16360"},"modified":"2026-03-17T07:59:24","modified_gmt":"2026-03-17T06:59:24","slug":"migrating-to-gradle-kotlin-dsl","status":"publish","type":"post","link":"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/","title":{"rendered":"Migrating to Gradle Kotlin DSL in 5 Simple Steps"},"content":{"rendered":"<p>Shouldn&#8217;t editing a build script be as much fun as developing your app? Can&#8217;t we use a language we know and like to do so? Maybe a language like Kotlin? Yes, yes we can! In this article I\u2019ll show you how to migrate your Groovy build script to Gradle Kotlin DSL in just five simple steps.<\/p>\n<p><!--more--><\/p>\n<p>Over the years Android app development has changed a lot. New APIs, pattern and libraries rise, shine and sometimes disappear. Furthermore, with <a href=\"https:\/\/www.inovex.de\/blog\/kotlin-get-rid-of-java-android\/\">Kotlin another programming language for Android<\/a> development gains popularity. These constant changes don\u2019t stop at the build system. The community (mostly) moved from build scripts with Apache Ant to the unofficially supported Apache Maven to Gradle. In my opinion a good choice as I prefer Gradle over the other two. But some points in using Gradle always bothered me: I use Groovy, the language for Gradle scripts, so rarely and therefore with so little knowledge that changes to the build script are often based on trial and error.<\/p>\n<p>There are other reasons to move away from Groovy. It\u2019s a dynamically typed language and hence the tooling support isn&#8217;t that powerful. Features like auto-completion, navigation to the source code or reliable refactoring aren\u2019t available or only partially supported. This isn\u2019t an ideal situation for me and other developers have made similar arguments. Using Gradle with a statically-typed language like Kotlin would bring some advantages in terms of language knowledge and tooling.<\/p>\n<p>And that&#8217;s exactly what the Gradle Kotlin DSL is all about. It provides everything required to write Gradle build scripts with Kotlin. Version 1.0 of the <a href=\"https:\/\/github.com\/gradle\/kotlin-dsl\" target=\"_blank\" rel=\"noopener\">Kotlin DSL<\/a> was released in August 2018 by the Gradle team and there&#8217;s been a lot of work going on ever since. It\u2019s definitely ready for productive use, even if there are still a few issues. As an officially supported language for Gradle, Kotlin examples are also included in the documentation.<\/p>\n<p>Doesn&#8217;t that make you curious? So, the question is how to get started. Most build scripts of existing projects are still written in Groovy. Therefore, this article shows five simple steps to migrate them to the Gradle Kotlin DSL. It\u2019s based on a <a href=\"https:\/\/github.com\/dbaelz\/AndroidHeadsVienna\" target=\"_blank\" rel=\"noopener\">live demo<\/a> from one of my talks. The project on GitHub includes the live demo and provides links to the references\/documentation and a more detailed introduction into the migration with complementing code. Furthermore, the official GitHub repository contains many <a href=\"https:\/\/github.com\/gradle\/kotlin-dsl\/tree\/master\/samples\" target=\"_blank\" rel=\"noopener\">samples<\/a>.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_79_2 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\"><p class=\"ez-toc-title\" style=\"cursor:inherit\"><\/p>\n<\/div><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#Step-0-Get-to-Know-the-Project\" >Step 0: Get to Know the Project<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#Step-1-Minor-Modernization\" >Step 1: Minor Modernization<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#Step-2-Adapt-Quotes\" >Step 2: Adapt Quotes<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#Step-3-Make-it-Kotlin-ish\" >Step 3: Make it Kotlin-ish<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#Step-4-The-Real-Migration\" >Step 4: The (Real) Migration<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#Step-5-Fix-Errors\" >Step 5: Fix Errors<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#Build-Types-and-Configuration-Actions\" >Build Types and Configuration Actions<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#Assignments-Method-Calls-and-Properties\" >Assignments, Method Calls and Properties<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#Version-Variables\" >Version Variables<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#Bonus\" >Bonus<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#buildSrc-Directory\" >buildSrc Directory<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#Summary\" >Summary<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Step-0-Get-to-Know-the-Project\"><\/span>Step 0: Get to Know the Project<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Usually, an Android project with Gradle and Groovy consist of three Gradle build script files: In the root (top-level) directory the <span class=\"lang:default decode:true crayon-inline \">build.gradle<\/span>\u00a0(common configurations) and the <span class=\"lang:default decode:true crayon-inline\">settings.gradle<\/span>. Another <span class=\"lang:default decode:true crayon-inline \">build.gradle<\/span>\u00a0is located in the app module for the Android app specific configuration. The demo project has this exact structure, but even more complex setups can be easily migrated. It\u2019s also possible to use Groovy and Kotlin build scripts in one project. However, this goes beyond the scope of this \u201cfive simple steps\u201c article. The official documentation has some useful information about the <a href=\"https:\/\/docs.gradle.org\/current\/userguide\/kotlin_dsl.html#sec:interoperability\" target=\"_blank\" rel=\"noopener\">interoperability<\/a>.<\/p>\n<p>My approach for the migration of the build scripts is quite simple: Change the Groovy syntax so it\u2019s more like that of Kotlin, migrate the scripts to the Gradle Kotlin DSL, refresh them and check for errors. Afterwards, fix the errors until it&#8217;s building again. But enough of this preface, let&#8217;s get started with our simple 5 step migration.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Step-1-Minor-Modernization\"><\/span>Step 1: Minor Modernization<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Projects generated by Android Studio still use the legacy <span class=\"lang:default decode:true crayon-inline \">apply()<\/span>\u00a0 function for applying plugins. We should get rid of it and use the <span class=\"lang:default decode:true crayon-inline \">plugins {}<\/span>\u00a0 block instead. The <span class=\"lang:default decode:true crayon-inline \">apply()<\/span>\u00a0 function still works with the Kotlin DSL, but only <span class=\"lang:default decode:true crayon-inline \">plugins {}<\/span>\u00a0 provides advanced features like type-safe accessors for extensions\/configurations.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Step-2-Adapt-Quotes\"><\/span>Step 2: Adapt Quotes<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In Groovy single and double quotes are used for Strings. There are subtle differences between them, but they aren\u2019t relevant for the migration. What\u2019s relevant is that in Kotlin only double quotes are supported. So we just replace all single with double quotes. Search and replace to the rescue!<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Step-3-Make-it-Kotlin-ish\"><\/span>Step 3: Make it Kotlin-ish<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Another difference between both languages is that Groovy has more cases of optionality than Kotlin. For example optional parentheses for method calls. Such calls aren\u2019t valid syntax in Kotlin. So we have to change them as well.<\/p>\n<p>What at first seems like a straightforward approach raises further questions:<\/p>\n<ul>\n<li>Are these methods still provided by the Kotlin DSL as methods or instead as properties?<\/li>\n<li>Could we call them as property instead of methods (e.g. <span class=\"lang:default decode:true crayon-inline\">versionCode<\/span>\u00a0instead of <span class=\"lang:default decode:true crayon-inline\">getVersionCode()<\/span>)?<\/li>\n<li>Are there Extension Functions provided by the Kotlin DSL?<\/li>\n<\/ul>\n<p>To answer these questions we have to take a deeper look into the documentation and the source code of the Kotlin DSL and check every assignment and function call. Or we could just change them to the best of our knowledge (for example to method calls) and fix them after the migration. That&#8217;s the approach I&#8217;d like to recommend, because it&#8217;s done much faster.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Step-4-The-Real-Migration\"><\/span>Step 4: The (Real) Migration<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Step number 4 is the fastest and easiest in this article. The Groovy Gradle scripts end with the <span class=\"lang:default decode:true crayon-inline\">.gradle<\/span>\u00a0extension, the Kotlin DSL scripts with <span class=\"lang:default decode:true crayon-inline\">.gradle.kts<\/span>. So we just have to rename the three existing files and refresh the scripts.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Step-5-Fix-Errors\"><\/span>Step 5: Fix Errors<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>After renaming and refreshing the build scripts, the demo project won&#8217;t build but show some errors. That\u2019s something that (probably) happens to every project after the Kotlin DSL migration. In this step we\u2019ll fix the errors and make sure it&#8217;s a working project again.<\/p>\n<p>Of course, in a comprehensive project this step is the most complex and the hardest. However, there are common\/typical fixes for an Android project and I will show you how to tackle them. They are explained in more detail in the demo project, and to follow up a look at the source code of this project is helpful.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Build-Types-and-Configuration-Actions\"><\/span>Build Types and Configuration Actions<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>In Groovy configuration actions for the different build types could be added just by name and a closure that contains the configuration (e.g. <span class=\"lang:default decode:true crayon-inline\">release { }<\/span>).<\/p>\n<p>On runtime, the name is extracted, the configuration located and the action added to the project. In a statically-typed language such as Kotlin, this kind of magic doesn\u2019t work. Instead, we have to locate the configuration with a provided function (<span class=\"lang:default decode:true crayon-inline\">getByName(&#8222;release&#8220;) { }<\/span>) and define the configuration with a lambda. On the upside, in contrast to a Groovy script, auto-completion and jumping to the source in lambda is supported.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Assignments-Method-Calls-and-Properties\"><\/span>Assignments, Method Calls and Properties<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>When we fix the configuration actions in the demo project and refresh the build script another error occurs. Gradle tells us, that the <span class=\"lang:default decode:true crayon-inline \">minifyEnabled<\/span>\u00a0variable doesn&#8217;t exist. Due to the auto-completion it&#8217;s easy to find out that it must be replaced with a function call or the property syntax (e.g. <span class=\"lang:default decode:true crayon-inline\">isMinifyEnabled = false<\/span>). These changes to method calls or property syntax will happen in nearly every migration and can usually be fixed that easily.<\/p>\n<p>There are also more elaborate cases, so the demo project shows how to migrate static functions, custom tasks and Gradle properties. To keep it short, they are only briefly touched here. But there are some simple tips:<\/p>\n<p>The easiest way to migrate existing Groovy functions is to rebuild the Groovy logic with variables and methods from the Java\/Kotlin Standard Library. Furthermore, the Kotlin Gradle DSL provides some helpful extension functions. Migrating (custom) tasks is also not a problem, because the DSL provides helper methods to create and expand them. To get a Gradle property as variable it must be declared and the initialization delegated to the project object. This is different to Groovy, where it\u2019s (magically) bound to the variable but very easy to implement.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Version-Variables\"><\/span>Version Variables<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Gradle Groovy scripts use the extra properties (\u201cext\u201c) in the root build scrip to define the versions of dependencies. These versions (e.g. <span class=\"lang:default decode:true crayon-inline\">kotlin_version<\/span>) are often used in the root and the app build script. The simplest way to migrate these variables would be to change the ext properties to Kotlin variables using the <span class=\"lang:default decode:true crayon-inline \">val<\/span>\u00a0keyword. Unfortunately, these variables would only be accessible inside the containing script. As a quick fix we could just copy the version information into the dependency declaration. Of course, this leads to more redundancy and is a step backwards compared to the Groovy script. The <em>Bonus<\/em> section below shows a great way to improve this.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Bonus\"><\/span>Bonus<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>At this point, the migration of the Groovy build script to the Kotlin DSL is done. Everything should work as before and in addition the advantages of the Kotlin DSL such as type-inference (and therefore auto-completion) should ease the work with Gradle build scripts. So we could lie back and do other things. Or we could make further optimizations which increase the maintainability and reusability of the build scripts.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"buildSrc-Directory\"><\/span>buildSrc Directory<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>In my life as a developer I\u2019ve encountered many extensive build scripts containing tons of variables, methods and task definitions. Of course, in the production code of the app I would structure and modularize such code. Couldn&#8217;t I do that in the build script, too?<\/p>\n<p>Yes, I can. The <a href=\"https:\/\/docs.gradle.org\/current\/userguide\/organizing_gradle_projects.html#sec:build_sources\" target=\"_blank\" rel=\"noopener\">buildSrc directory<\/a> provides a way to encapsulated custom tasks, plugins and imperative logic outside of the build scripts. Code inside the directory is compiled and added to the classpath of all build scripts in the Gradle project. This feature isn\u2019t something introduced with the Kotlin DSL, it\u2019s been available in Gradle for some time and can be used with Groovy as well.<\/p>\n<p>As I mentioned above, after the migration the version information has been duplicated. This is a great use case for the buildSrc. We just create a Kotlin source file inside of buildSrc, define an object class and move the version information as variable inside the class. Now we can use this variable in our build scripts and remove the redundant definitions in the root and app scripts. Furthermore, additional logic could be moved into the buildSrc. For example, the build script in the demo project includes a function <span class=\"lang:default decode:true crayon-inline \">generateVersionCode()<\/span>\u00a0with some logic to calculate the version code of the app. This logic could be moved so that the build script becomes more compact and readable. Depending on your current project, there might be several other code snippets that could be moved to buildSrc.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Migrating the build scripts of a typical Android app to the Gradle Kotlin DSL isn\u2019t that hard. Of course, for more complex build scripts with many plugins, tasks and logic the effort can increase. However, in most cases it\u2019s achievable by following the described procedure and within an acceptable amount of time. On the other hand there are some advantages like auto-completion and better understandable scripts (from an app developer&#8217;s perspective). Therefore, I would recommend everyone to try out the Gradle Kotlin DSL in their project.<\/p>\n<p>Find out more about our\u00a0<a href=\"https:\/\/www.inovex.de\/en\/our-services\/apps\/\">Android portfolio<\/a>\u00a0or\u00a0join us\u00a0as a mobile developer!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Shouldn&#8217;t editing a build script be as much fun as developing your app? Can&#8217;t we use a language we know and like to do so? Maybe a language like Kotlin? Yes, yes we can! In this article I\u2019ll show you how to migrate your Groovy build script to Gradle Kotlin DSL in just five simple [&hellip;]<\/p>\n","protected":false},"author":39,"featured_media":16378,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"ep_exclude_from_search":false,"footnotes":""},"tags":[510],"service":[420],"coauthors":[{"id":39,"display_name":"Daniel B\u00e4lz","user_nicename":"dbaelz"}],"class_list":["post-16360","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-apps-2","service-apps"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Migrating to Gradle Kotlin DSL in 5 Simple Steps - inovex GmbH<\/title>\n<meta name=\"description\" content=\"Shouldn&#039;t editing a build script be as much fun as developing your app? Can&#039;t we use a language we know and like to do so? Maybe a language like Kotlin? Yes, yes we can! In this article I\u2019ll show you how to migrate your Groovy build script to Gradle Kotlin DSL in just five simple steps.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Migrating to Gradle Kotlin DSL in 5 Simple Steps - inovex GmbH\" \/>\n<meta property=\"og:description\" content=\"Shouldn&#039;t editing a build script be as much fun as developing your app? Can&#039;t we use a language we know and like to do so? Maybe a language like Kotlin? Yes, yes we can! In this article I\u2019ll show you how to migrate your Groovy build script to Gradle Kotlin DSL in just five simple steps.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/\" \/>\n<meta property=\"og:site_name\" content=\"inovex GmbH\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inovexde\" \/>\n<meta property=\"article:published_time\" content=\"2019-06-19T08:33:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-17T06:59:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.inovex.de\/wp-content\/uploads\/2019\/06\/gradle-kotlin-dsl.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Daniel B\u00e4lz\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.inovex.de\/wp-content\/uploads\/2019\/06\/gradle-kotlin-dsl-1024x576.png\" \/>\n<meta name=\"twitter:creator\" content=\"@inovexgmbh\" \/>\n<meta name=\"twitter:site\" content=\"@inovexgmbh\" \/>\n<meta name=\"twitter:label1\" content=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"Daniel B\u00e4lz\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"9\u00a0Minuten\" \/>\n\t<meta name=\"twitter:label3\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data3\" content=\"Daniel B\u00e4lz\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/\"},\"author\":{\"name\":\"Daniel B\u00e4lz\",\"@id\":\"https:\/\/www.inovex.de\/de\/#\/schema\/person\/2a543d8c30ae96e4ca4e55a3a280539b\"},\"headline\":\"Migrating to Gradle Kotlin DSL in 5 Simple Steps\",\"datePublished\":\"2019-06-19T08:33:57+00:00\",\"dateModified\":\"2026-03-17T06:59:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/\"},\"wordCount\":1842,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.inovex.de\/de\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.inovex.de\/wp-content\/uploads\/2019\/06\/gradle-kotlin-dsl.png\",\"keywords\":[\"Apps\"],\"articleSection\":[\"Applications\",\"English Content\",\"General\"],\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/\",\"url\":\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/\",\"name\":\"Migrating to Gradle Kotlin DSL in 5 Simple Steps - inovex GmbH\",\"isPartOf\":{\"@id\":\"https:\/\/www.inovex.de\/de\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.inovex.de\/wp-content\/uploads\/2019\/06\/gradle-kotlin-dsl.png\",\"datePublished\":\"2019-06-19T08:33:57+00:00\",\"dateModified\":\"2026-03-17T06:59:24+00:00\",\"description\":\"Shouldn't editing a build script be as much fun as developing your app? Can't we use a language we know and like to do so? Maybe a language like Kotlin? Yes, yes we can! In this article I\u2019ll show you how to migrate your Groovy build script to Gradle Kotlin DSL in just five simple steps.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#primaryimage\",\"url\":\"https:\/\/www.inovex.de\/wp-content\/uploads\/2019\/06\/gradle-kotlin-dsl.png\",\"contentUrl\":\"https:\/\/www.inovex.de\/wp-content\/uploads\/2019\/06\/gradle-kotlin-dsl.png\",\"width\":1920,\"height\":1080,\"caption\":\"the Gradle Kotlin Elephant in Kotlin colors blue, violet and orange\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inovex.de\/de\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Migrating to Gradle Kotlin DSL in 5 Simple Steps\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inovex.de\/de\/#website\",\"url\":\"https:\/\/www.inovex.de\/de\/\",\"name\":\"inovex GmbH\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.inovex.de\/de\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inovex.de\/de\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inovex.de\/de\/#organization\",\"name\":\"inovex GmbH\",\"url\":\"https:\/\/www.inovex.de\/de\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/www.inovex.de\/de\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inovex.de\/wp-content\/uploads\/2021\/03\/inovex-logo-16-9-1.png\",\"contentUrl\":\"https:\/\/www.inovex.de\/wp-content\/uploads\/2021\/03\/inovex-logo-16-9-1.png\",\"width\":1921,\"height\":1081,\"caption\":\"inovex GmbH\"},\"image\":{\"@id\":\"https:\/\/www.inovex.de\/de\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inovexde\",\"https:\/\/x.com\/inovexgmbh\",\"https:\/\/www.instagram.com\/inovexlife\/\",\"https:\/\/www.linkedin.com\/company\/inovex\",\"https:\/\/www.youtube.com\/channel\/UC7r66GT14hROB_RQsQBAQUQ\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inovex.de\/de\/#\/schema\/person\/2a543d8c30ae96e4ca4e55a3a280539b\",\"name\":\"Daniel B\u00e4lz\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/www.inovex.de\/de\/#\/schema\/person\/image\/cd3c2b443db1c5d1d6f2acef05fc002d\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1de6b57541e80290e1972f383e53c4aca12d46c83ff79472b19c2148de60b4f1?s=96&d=retro&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1de6b57541e80290e1972f383e53c4aca12d46c83ff79472b19c2148de60b4f1?s=96&d=retro&r=g\",\"caption\":\"Daniel B\u00e4lz\"},\"url\":\"https:\/\/www.inovex.de\/de\/blog\/author\/dbaelz\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Migrating to Gradle Kotlin DSL in 5 Simple Steps - inovex GmbH","description":"Shouldn't editing a build script be as much fun as developing your app? Can't we use a language we know and like to do so? Maybe a language like Kotlin? Yes, yes we can! In this article I\u2019ll show you how to migrate your Groovy build script to Gradle Kotlin DSL in just five simple steps.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/","og_locale":"de_DE","og_type":"article","og_title":"Migrating to Gradle Kotlin DSL in 5 Simple Steps - inovex GmbH","og_description":"Shouldn't editing a build script be as much fun as developing your app? Can't we use a language we know and like to do so? Maybe a language like Kotlin? Yes, yes we can! In this article I\u2019ll show you how to migrate your Groovy build script to Gradle Kotlin DSL in just five simple steps.","og_url":"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/","og_site_name":"inovex GmbH","article_publisher":"https:\/\/www.facebook.com\/inovexde","article_published_time":"2019-06-19T08:33:57+00:00","article_modified_time":"2026-03-17T06:59:24+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/www.inovex.de\/wp-content\/uploads\/2019\/06\/gradle-kotlin-dsl.png","type":"image\/png"}],"author":"Daniel B\u00e4lz","twitter_card":"summary_large_image","twitter_image":"https:\/\/www.inovex.de\/wp-content\/uploads\/2019\/06\/gradle-kotlin-dsl-1024x576.png","twitter_creator":"@inovexgmbh","twitter_site":"@inovexgmbh","twitter_misc":{"Verfasst von":"Daniel B\u00e4lz","Gesch\u00e4tzte Lesezeit":"9\u00a0Minuten","Written by":"Daniel B\u00e4lz"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#article","isPartOf":{"@id":"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/"},"author":{"name":"Daniel B\u00e4lz","@id":"https:\/\/www.inovex.de\/de\/#\/schema\/person\/2a543d8c30ae96e4ca4e55a3a280539b"},"headline":"Migrating to Gradle Kotlin DSL in 5 Simple Steps","datePublished":"2019-06-19T08:33:57+00:00","dateModified":"2026-03-17T06:59:24+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/"},"wordCount":1842,"commentCount":0,"publisher":{"@id":"https:\/\/www.inovex.de\/de\/#organization"},"image":{"@id":"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inovex.de\/wp-content\/uploads\/2019\/06\/gradle-kotlin-dsl.png","keywords":["Apps"],"articleSection":["Applications","English Content","General"],"inLanguage":"de","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/","url":"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/","name":"Migrating to Gradle Kotlin DSL in 5 Simple Steps - inovex GmbH","isPartOf":{"@id":"https:\/\/www.inovex.de\/de\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#primaryimage"},"image":{"@id":"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inovex.de\/wp-content\/uploads\/2019\/06\/gradle-kotlin-dsl.png","datePublished":"2019-06-19T08:33:57+00:00","dateModified":"2026-03-17T06:59:24+00:00","description":"Shouldn't editing a build script be as much fun as developing your app? Can't we use a language we know and like to do so? Maybe a language like Kotlin? Yes, yes we can! In this article I\u2019ll show you how to migrate your Groovy build script to Gradle Kotlin DSL in just five simple steps.","breadcrumb":{"@id":"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/"]}]},{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#primaryimage","url":"https:\/\/www.inovex.de\/wp-content\/uploads\/2019\/06\/gradle-kotlin-dsl.png","contentUrl":"https:\/\/www.inovex.de\/wp-content\/uploads\/2019\/06\/gradle-kotlin-dsl.png","width":1920,"height":1080,"caption":"the Gradle Kotlin Elephant in Kotlin colors blue, violet and orange"},{"@type":"BreadcrumbList","@id":"https:\/\/www.inovex.de\/de\/blog\/migrating-to-gradle-kotlin-dsl\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inovex.de\/de\/"},{"@type":"ListItem","position":2,"name":"Migrating to Gradle Kotlin DSL in 5 Simple Steps"}]},{"@type":"WebSite","@id":"https:\/\/www.inovex.de\/de\/#website","url":"https:\/\/www.inovex.de\/de\/","name":"inovex GmbH","description":"","publisher":{"@id":"https:\/\/www.inovex.de\/de\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inovex.de\/de\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"},{"@type":"Organization","@id":"https:\/\/www.inovex.de\/de\/#organization","name":"inovex GmbH","url":"https:\/\/www.inovex.de\/de\/","logo":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/www.inovex.de\/de\/#\/schema\/logo\/image\/","url":"https:\/\/www.inovex.de\/wp-content\/uploads\/2021\/03\/inovex-logo-16-9-1.png","contentUrl":"https:\/\/www.inovex.de\/wp-content\/uploads\/2021\/03\/inovex-logo-16-9-1.png","width":1921,"height":1081,"caption":"inovex GmbH"},"image":{"@id":"https:\/\/www.inovex.de\/de\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inovexde","https:\/\/x.com\/inovexgmbh","https:\/\/www.instagram.com\/inovexlife\/","https:\/\/www.linkedin.com\/company\/inovex","https:\/\/www.youtube.com\/channel\/UC7r66GT14hROB_RQsQBAQUQ"]},{"@type":"Person","@id":"https:\/\/www.inovex.de\/de\/#\/schema\/person\/2a543d8c30ae96e4ca4e55a3a280539b","name":"Daniel B\u00e4lz","image":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/www.inovex.de\/de\/#\/schema\/person\/image\/cd3c2b443db1c5d1d6f2acef05fc002d","url":"https:\/\/secure.gravatar.com\/avatar\/1de6b57541e80290e1972f383e53c4aca12d46c83ff79472b19c2148de60b4f1?s=96&d=retro&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1de6b57541e80290e1972f383e53c4aca12d46c83ff79472b19c2148de60b4f1?s=96&d=retro&r=g","caption":"Daniel B\u00e4lz"},"url":"https:\/\/www.inovex.de\/de\/blog\/author\/dbaelz\/"}]}},"_links":{"self":[{"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/posts\/16360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/users\/39"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/comments?post=16360"}],"version-history":[{"count":2,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/posts\/16360\/revisions"}],"predecessor-version":[{"id":66507,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/posts\/16360\/revisions\/66507"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/media\/16378"}],"wp:attachment":[{"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/media?parent=16360"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/tags?post=16360"},{"taxonomy":"service","embeddable":true,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/service?post=16360"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.inovex.de\/de\/wp-json\/wp\/v2\/coauthors?post=16360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}