Uploaded image for project: 'Gradle'
  1. Gradle
  2. GRADLE-1018

IDEA plugin should automatically add Scala facet to module

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5-rc-1

      Description

      It would be good to have the Scala Facet section automatically generated in the .iml file.

      When manually adding the Scala Facet, this is generated:

      <module relativePaths="true" type="JAVA_MODULE" version="4">
        <component name="FacetManager">
          <facet type="Scala" name="Scala">
            <configuration>
              <option name="takeFromSettings" value="true" />
              <option name="myScalaCompilerJarPaths">
                <array>
                  <option value="$MODULE_DIR$/../../../../Library/Application Support/IntelliJIdea90/Scala/lib/scala-compiler.jar" />
                </array>
              </option>
              <option name="myScalaSdkJarPaths">
                <array>
                  <option value="$MODULE_DIR$/../../../../Library/Application Support/IntelliJIdea90/Scala/lib/scala-library.jar" />
                </array>
              </option>
            </configuration>
          </facet>
        </component>
        <component name="NewModuleRootManager" inherit-compiler-output="false">
      

      However, in the build file you specify scalaTools dependencies:

      dependencies {
        // Lib for scala tools
        scalaTools 'org.scala-lang:scala-library:2.8.0.RC6'
        scalaTools 'org.scala-lang:scala-compiler:2.8.0.RC6'
        // Lib for scala api
        ...
      }
      

      It would be good to have a simple way to add these compiler and library dependencies, so that IntelliJ uses the same libs as Gradle:

        <component name="FacetManager">
          <facet type="Scala" name="Scala">
            <configuration>
              <option name="takeFromSettings" value="true" />
              <option name="myScalaCompilerJarPaths">
                <array>
                  <option value="$MODULE_DIR$/../../../../.gradle/cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.8.0.RC6.jar" />
                </array>
              </option>
              <option name="myScalaSdkJarPaths">
                <array>
                  <option value="$MODULE_DIR$/../../../../.gradle/cache/org.scala-lang/scala-library/jars/scala-library-2.8.0.RC6.jar" />
                </array>
              </option>
            </configuration>
          </facet>
        </component>
      

      It is mainly the path resolution thingy that is needed, since the rest is simple xlm generation.

      If the components for doing this is already in place, an example in the "modify XML" part of the documentation would be great.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            david.rosell David Rosell
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: