Search code examples
scalaplayframework-2.0sbtsbt-idea

How to set options for the sbt idea plugin in Play2 framework?


I know that the play framework has their own custom sbt plugin to generate Idea project files and I'm trying to find a way to configure it. I see there are some options available, for instance when I type:

[my-play-project] $ idea-include-scala-facet

I get

[info] false 

How do i set this option to true using the play console? I haven't been able to find any documentation on how to do this.


Solution

  • You can pass this configuration to PlayProject#settings in your Build.scala . The following worked for me. You might have to tweak it a bit depending on your setup.

    import org.sbtidea.SbtIdeaPlugin
    
    val main = PlayProject(appName, appVersion, appDependencies, mainLang = SCALA).settings(
      ... some other settings ...,
      SbtIdeaPlugin.includeScalaFacet := true
    )
    

    To set this option in the play console, do:

    set org.sbtidea.SbtIdeaPlugin.includeScalaFacet := true
    

    You can find the other intellij command settings around here: https://github.com/playframework/Play20/blob/2.0.3/framework/src/sbt-plugin/src/main/scala/PlayCommands.scala#L212