BitPusher
BitPusher

Reputation: 1030

IntelliJ 12 + Gradle 1.3 - Basic Gradle syntax seems non-functional

I am attempting to play around with Gradle integration in IntelliJ Idea (Ultimate) v12.

It seems even if $GRADLE_HOME is configured properly, basic syntax such as 'apply', 'dependencies', etc. is not recognized.

enter image description here

I would seem like the solution should be something simple. Any help is appreciated.

Upvotes: 13

Views: 4123

Answers (4)

Adam Parod
Adam Parod

Reputation: 178

With Intellij 14 and Gradle 2.3 I found that adding {$GRADLE_HOME}/lib and {$GRADLE_HOME}/lib/plugins as libraries in my project settings got rid of all the warnings like "dependencies cannot be applied to groovy.lang.Closure".

Upvotes: 1

chenj7
chenj7

Reputation: 95

I'm using Intellij 13 and have had similar problems. What I noticed was, creating a new Project from Intellij (i.e. new Groovy Project or Gradle project), I get the syntax error markers. I also have noticed it didn't do a good job pulling in Gradle dependencies.

On the other hand, if I Import a Project through an already created build.gradle file, the syntax error markings go away and the dependencies seem to play more nicely. Not sure if this works for you.

Upvotes: 1

Quartz
Quartz

Reputation: 1851

I was having the same problem until this morning. I did the following steps and it solved itself:

  • added the root build.gradle file (we have several) to the JetGradle tab and refreshed
  • updated to IDEA 12.0.1 (it restarts and reindexes)

I think doing the first one and restarting may be enough, but I'm not sure.

Upvotes: 2

Peter Niederwieser
Peter Niederwieser

Reputation: 123986

IntelliJ IDEA doesn't currently offer syntax completion for Gradle build scripts. All you get is the standard Groovy support.

Upvotes: 4

Related Questions