question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support Gradle Kotlin DSL

See original GitHub issue

Linked to https://github.com/spring-io/initializr/issues/331, I think it could make sense to support Gradle builds written in Kotlin instead of Groovy.

I am experimenting on that for a few month, and it works pretty well, see for example mixit or spring-boot-kotlin-demo build.gradle.kts. As a bonus, that would be nice to make that the default for Kotlin project.

This feature is also valuable for Java projects since it provides full autocomplete and validation of Gradle builds unlike the Groovy variant.

This feature works with regular IntelliJ IDEA Kotlin plugin, but you need to use Kotlin 1.1 EAP plugin to get autocomplete and validation of your build file.

I plan to contribute this feature, that IMO makes sense as part of the Kotlin support provided by Spring Framework 5 (so a good fit with Spring Boot 2.0).

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:36
  • Comments:25 (20 by maintainers)

github_iconTop GitHub Comments

10reactions
wilkinsonacommented, Jan 3, 2017

Can we automatically generate a Kotlin-powered build.gradle.kts when the users selects Gradle as the build system and Kotlin as the language? That way we’d avoid another UI option at least.

5reactions
sdeleuzecommented, Feb 15, 2019

Hey, quick summary to move forward. @eskatos contributed https://github.com/eskatos/start.spring.io-builds/tree/master/new-gradle-kotlin-dsl, which is a good starting point. Also regular Gradle builds now uses the new Gradle plugin thanks to the latest improvements shipped recently by the Boot team.

Could we agree on the design in order to allow me, another contributor from Gradle or the community to move forward on submitting a pull request?

Currently we have the following key -> value project types:

  • maven-project -> “Maven Project”
  • gradle-project -> “Gradle Project”

With Gradle Kotlin DSL support, I think I am still in favor of “just” introducing it as a new project type.

  • maven-project -> “Maven Project”
  • gradle-project -> “Gradle Project”
  • gradle-kts-project -> “Gradle Kotlin DSL Project”

@snicoll @wilkinsona Could you discuss that point to provide guidelines for those who will work on the pull request? Also since Gradle Kotlin DSL requires latest 5.x for first class support, do you plan to switch to Gradle 5.x at Boot 2.2 timeframe or should we use 5.x only for the Gradle Kotlin DSL?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gradle Kotlin DSL Primer
The Kotlin DSL is fully supported by IntelliJ IDEA and Android Studio. Other IDEs do not yet provide helpful tools for editing Kotlin...
Read more >
Gradle | Kotlin
The Gradle Kotlin DSL is a domain specific language that you can use to write build scripts quickly and efficiently. Annotation processing. Kotlin...
Read more >
Kotlin DSL for Gradle - Baeldung
Learn how to write Gradle scripts in Kotlin. ... To activate the Kotlin DSL and get the best IDE support, we need to...
Read more >
The New Way of Writing Build Gradle with Kotlin DSL
the basic thing when you change Gradle using Kotlin script is the use of single-quotes to double-quotes. For minSdkVersion and targetSdkVersion is function...
Read more >
Samples builds using the Gradle Kotlin DSL - GitHub
Welcome! The Gradle Kotlin DSL provides support for writing Gradle build scripts using JetBrains' Kotlin language. It aims to provide Gradle users with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found