Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Intellij not creating a build.gradle.kts for a new kotlin project?

Gradle is installed:

enter image description here I went through the standard New Project|Kotlin:

enter image description here

A JDK was selected and besides that I used the defaults:

enter image description here

Now we see the new project: but where's the build.gradle.kts ?

enter image description here

like image 560
WestCoastProjects Avatar asked Dec 07 '25 07:12

WestCoastProjects


1 Answers

To create a gradle based project (in kotlin) you have to select

New Project->Gradle->Check Kotlin DSL BuildScript->Kotlin/JVM

If you uncheck the Kotlin DSL BuildScript then build.gradle is created while when checking it you'll find a build.gradle.kts file

Like this: enter image description here

PS:

If you want to migrate existing project with Groovy gradle to Kotlin DSL check this out https://medium.com/mindorks/migrating-gradle-build-scripts-to-kotlin-dsl-89788a4e383a

If you want to add gradle to existing non-gradle project right click on project in project structure and then add support for gradle from there

like image 99
Animesh Sahu Avatar answered Dec 09 '25 18:12

Animesh Sahu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!