Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 539
thetwan Avatar asked Dec 14 '12 17:12

thetwan


3 Answers

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

like image 68
Peter Niederwieser Avatar answered Oct 08 '22 18:10

Peter Niederwieser


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.

like image 20
Quartz Avatar answered Oct 08 '22 17:10

Quartz


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.

like image 1
chenj7 Avatar answered Oct 08 '22 16:10

chenj7