13

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?

Matthias
  • 9,817
  • 14
  • 66
  • 125
  • Does http://stackoverflow.com/questions/26745541/best-way-to-add-gradle-support-to-intellij-project help with your question? – Andrew Grimm Oct 19 '16 at 03:07

2 Answers2

4

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.

Muhatashim
  • 646
  • 8
  • 22
0

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).

Peter Niederwieser
  • 121,412
  • 21
  • 324
  • 259
  • 9
    I think this is not what I really need. That way a new project is created in IDEA. But I want to add Gradle support to an **existing** IDEA project. – Matthias Oct 25 '14 at 21:18
  • As I said, you should be able to create a Gradle Run configuration even for an existing project, but you'll need to create a new project to use most other features (because they require a project that's synced with the Gradle build). Typically you should also see a "link to Gradle build" popup; I don't know if that's effectively different from recreating the project. – Peter Niederwieser Oct 25 '14 at 21:54
  • 11
    I was hoping to somehow get all Gradle features even for an existing IDEA project... – Matthias Oct 26 '14 at 12:30