idea-sbt-plugin icon indicating copy to clipboard operation
idea-sbt-plugin copied to clipboard

Multiproject builds fine in terminal, but not in IntelliJ

Open DCKcode opened this issue 10 years ago • 3 comments

I have multiple SBT subprojects depending on a base project. They all need to have enabled the Play plugin for them to compile.

// base/build.sbt
lazy val base = (project in file(".")).enablePlugins(PlayScala)

// sub1/build.sbt
lazy val base = ProjectRef(file("../base"), "base")

lazy val sub1 = (project in file(".")).enablePlugins(PlayScala).dependsOn(base % "test->test;compile->compile").aggregate(base)

// sub2/build.sbt
lazy val base = ProjectRef(file("../base"), "base")

lazy val sub2 = (project in file(".")).enablePlugins(PlayScala).dependsOn(base % "test->test;compile->compile").aggregate(base)

If I do an sbt run or sbt compile in the respective directories these projects build and run just fine. However, when I try to import these projects into IntelliJ by using the native SBT project support, an error is thrown. IntelliJ's SBT plugin fails with the following error:

value enablePlugins is not a member of sbt.Project

After which the import fails. It seems I encountered a bug?

DCKcode avatar Jul 14 '14 21:07 DCKcode

Looking around the source code - might this have something to do with my project layout?

 projectdir
 +---base/
 +-------project/
 +------------build.properties <-- contains sbt=0.13.5
 +-------build.sbt
 +---sub1/
 +-------build.sbt
 +-------project/
 +------------build.properties <-- contains sbt=0.13.5
 +---sub2/
 +-------project/
 +------------build.properties <-- contains sbt=0.13.5
 +-------build.sbt

My project directory is not an sbt project, but its subfolders are. Is that something that can confuse this plugin?

DCKcode avatar Jul 14 '14 21:07 DCKcode

I've moved everything to a single build.sbt in the project root, and IntelliJ still cannot find enablePlugins. Maybe this problem is more general?

DCKcode avatar Jul 18 '14 21:07 DCKcode

@DCKcode - I suspect this is happening in the core intellij sbt support, not this plugin.

farley13 avatar Sep 17 '16 17:09 farley13