title: How to get IntelliJ to associate Gradle sources with build.gradle?
body: <p>When writing Gradle scripts for my Java project, specifically, when writing <em>build.gradle</em> files, IntelliJ does not recognize the Gradle API.</p>
  
  <p>For instance, Gradle methods calls like <code>apply</code>, <code>dependencies</code> <code>configure</code> appear with a black line under them and it is not possible to navigate to method declarations, there is no auto-completion etc.</p>
  
  <p>I managed to work around this by adding <code>compile gradleApi()</code> to the build's <code>dependencies</code> block. However, I don't want to have this explicit dependency in my code.</p>
  
  <p>I tried editing IntelliJ's project structure and add a dependency on a Gradle library (tried <em>gradle-core</em> and <em>gradle-all</em>) to my modules, but that seems to have no effect.</p>
  
  <p>Is there a way to make IntelliJ associate all <em>build.gradle</em> files with the Gadle sources?</p>