0

I have a multi module SBT project with this structure:

➜  Stample git:(split-in-sbt-modules) ✗ tree -L 1
.
├── project
├── stample-core
├── stample-search
├── stample-web
└── target

The build definition is pretty simple and looks like:

  lazy val stampleWebProject = play.Project("stample-web", appVersion, appDependencies,path = file("stample-web"))
    .dependsOn(stampleCoreProject,stampleSearchProject)
    .aggregate(stampleCoreProject,stampleSearchProject)

  lazy val stampleCoreProject = Project(id = "stample-core",base = file("stample-core"))

  lazy val stampleSearchProject = Project(id = "stample-search",base = file("stample-search"))

I'd like to know why when I generate the IDEA project files with sbt-idea plugin, the build definition /project is not imported as a module.

It seems it is supposed to be, and I am pretty sure that I already saw it working on my own project but can't make it work again :( By the way, for newly created Play2 projects, when we use the plugin to generate the IDEA files, the project is also imported as an IDEA module with the appropriate classpath.

This issue seems say it is the expected default behavior.

I use v 1.5.1 but tried an older version and it doesn't work either.

When I run the gen-idea command I get:

[info] Excluding folder .ideacalaz-core_2.10;7.0.0 ...                            
[info] Excluding folder .idea_modules
[info] Excluding folder target
[info] Excluding folder target
[info] Created /home/sebastien/Bureau/Stample/.idea/IdeaProject.iml
[info] Created /home/sebastien/Bureau/Stample/.idea
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-core/.idea
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-core/.idea_modules
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-core/target
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-core/target
[info] Created /home/sebastien/Bureau/Stample/.idea_modules/stample-core.iml
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-search/.idea
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-search/.idea_modules
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-search/target
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-search/target
[info] Created /home/sebastien/Bureau/Stample/.idea_modules/stample-search.iml
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/.idea
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/.idea_modules
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/scala-2.10/cache
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/scala-2.10/cache
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/scala-2.10/classes
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/scala-2.10/classes
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/scala-2.10/classes_managed
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/scala-2.10/classes_managed
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/native_libraries
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/native_libraries
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/resolution-cache
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/resolution-cache
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/scala-2.10/resource_managed
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/scala-2.10/resource_managed
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/scala-2.9.2
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/scala-2.9.2
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/streams
[info] Excluding folder /home/sebastien/Bureau/Stample/stample-web/target/streams
[info] Created /home/sebastien/Bureau/Stample/.idea_modules/stample-web.iml

Can someone explain my why the project module is not created?

Sebastien Lorber
  • 89,644
  • 67
  • 288
  • 419
  • Have you considered using [official SBT plugin](http://blog.jetbrains.com/scala/2013/07/17/sbt-plugin-nightly-builds/)? It does have its problems (e.g. no embedded SBT console yet), but it is constantly improving. – Vladimir Matveev Sep 16 '13 at 05:56
  • @VladimirMatveev I've checked it but the doc doesn't mention you can import a Scala build, they only talk about .sbt files. I tried and it didn't work or perhaps I missed something... – Sebastien Lorber Sep 16 '13 at 08:24
  • I don't know about this but I think that you can create empty sbt file and try to import that. – Vladimir Matveev Sep 16 '13 at 10:39

1 Answers1

0

So in the end, it seems the plugin doesn't generate the build definition module if the parent folder is not included as an SBT project.

Adding this line seems to fix all my problems:

lazy val stampleRootProject = Project(id = "stample",base = file("."))
Sebastien Lorber
  • 89,644
  • 67
  • 288
  • 419