WestCoastProjects
WestCoastProjects

Reputation: 63022

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

Upvotes: 3

Views: 1093

Answers (1)

Animesh Sahu
Animesh Sahu

Reputation: 8096

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

Upvotes: 2

Related Questions