Matthias
Matthias

Reputation: 10399

How to create Gradle build for existing IDEA project?

I have a Groovy project in Intellij IDEA 13.1.5 that I want to build with Gradle. So I have installed Gradle itself and enabled the Gradle plugin in IDEA.

But how can I now build the project (or better: start to write the Gradle build file) from within IDEA? I have created a build.gradle file in the project's module, which is recognized by IDEA correctly as Gradle file, according to the icon next to the file name.

Beside that I don't know how to continue from there. IDEA documentation says I should open the Gradle Tools window, but I can find it in View --> Tool Windows.

Any ideas?

Upvotes: 13

Views: 7484

Answers (2)

Muhatashim
Muhatashim

Reputation: 646

The best way to accomplish this while still being in the same directory is by going to File -> New -> Module From Existing Sources.. and then selecting your build.gradle.

Upvotes: 4

Peter Niederwieser
Peter Niederwieser

Reputation: 123986

You can create a Gradle Run configuration. To get all IntelliJ Gradle features, you need to import the project via Gradle (File->Import Project, then point it to build.gradle).

Upvotes: 0

Related Questions