title: Can JetGradle Be Used In IntelliJ 12 Alongside Gradle Generated Project Files That Have Scala Facets?
body: <p>I've been trying to make the switch to IntelliJ and Gradle for the Java/Scala projects at my company. From the command line Gradle has been great but I've run into a problem when using Gradle with IntelliJ and projects with Scala facets.</p>
  
  <p>I've tried importing projects in both ways and the only one I've been able to get Scala facets working is to run:</p>
  
  <pre><code>gradle idea
  </code></pre>
  
  <p>using the Gradle IDEA plugin. After that all I need to do it open the ipr file for the project and the projects work fine.</p>
  
  <p>However, there are some Gradle tasks that I would like to run from within IntelliJ for various things (code generation being the biggest one). I would like to be able to use JetGradle to run those tasks. The problem is when I link the Gradle project to JetGradle, the dependencies in each project break the Scala facet's compiler settings.</p>
  
  <p>It's a multi-module project. Here is the <strong>build.gradle</strong> for the parent:</p>
  
  <pre><code>allprojects {
      apply plugin: 'idea'
  
      version = '1.0'
      group = 'company-x'
  
      repositories {
          mavenCentral()
      }
  }
  </code></pre>
  
  <p>And here's the <strong>build.gradle</strong> for the scala modules:</p>
  
  <pre><code>apply plugin: 'scala'
  
  dependencies {
    compile 'org.scala-lang:scala-library:2.10.1',
            'org.scala-lang:scala-reflect:2.10.1',
            'org.scala-lang:scala-compiler:2.10.1',
            'org.slf4j:slf4j-log4j12:1.7.2',
            'com.typesafe.akka:akka-actor_2.10:2.1.4'
  
    testCompile 'junit:junit:4.8.1',
                'org.scalatest:scalatest:1.2'
  }
  </code></pre>
  
  <p>Before linking the project to JetGradle the Scala facet is setup with a library called 'scala-compiler-2.10.1' that contains the Scala compiler, library, and reflect jars and src. After linking the project, the project libraries are replaced with all of the Gradle project dependencies. The Scala facet then gives the error:</p>
  
  <pre><code>Compiler library: no scala-library*.jar found
  </code></pre>
  
  <p>When I look at the libraries again, there is still a library called 'scala-compiler-2.10.1' but it's only the compiler. The library and reflect jars are now separated out.</p>
  
  <p>Has anyone out there figured out how to get the Scala facet and JetGradle to play nicely with one another? </p>