luontola / idea-sbt-plugin

IntelliJ IDEA plugin for integration with SBT (Simple Build Tool) in order to compile Scala projects easily and quickly [UNMAINTAINED]
http://plugins.intellij.net/plugin/?idea&id=5007
Apache License 2.0
178 stars 28 forks source link

Multiproject builds fine in terminal, but not in IntelliJ #95

Open DCKcode opened 10 years ago

DCKcode commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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?

farley13 commented 8 years ago

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