Reputation: 4701
I have helper projects in build.sbt just so I can invoke plugins with different configurations, i.e.:
lazy val root = project.in(file(".")).aggregate(app, cfg1, cfg2)
lazy val app = project.in(file("modules/app"))
lazy val cfg1 = project.in(file("target/cfg1"))
.enablePlugins(SomePlugin).settings(somePluginOption := "a")
lazy val cfg2 = project.in(file("target/cfg2"))
.enablePlugins(SomePlugin).settings(somePluginOption := "b")
This way I can execute them as needed (sbt cfg1/someTask
).
IDEA adds these projects on import/sync just like any other subproject, which is expected because there is nothing special about them however I do not want them in IDEA.
Is there a way to exclude them from being imported by IDEA?
Upvotes: 0
Views: 36
Reputation: 4701
Looks like it is possible with https://github.com/JetBrains/sbt-ide-settings
lazy val cfg2 = project.in(file("target/cfg2"))
.enablePlugins(SomePlugin)
.settings(
somePluginOption := "b",
ideSkipProject := true
)
Upvotes: 1
Reputation: 3488
As it is detailed in the docs:
item description Ignore sbt project If you select this option, IntelliJ IDEA starts to ignore the selected module on the next project's import. In this case, IntelliJ IDEA keeps the ignored sbt projects and subprojects in the sbt tool window, but stops their import (modules, content roots, tasks, and so on) to the project. However, IntelliJ IDEA synchronizes the ignored projects with the current one.
From the sbt tool panel, you can mark the module as ignored. It depends on the version of intellij you are using, the panel could be located in a diferent place. You can show it going to the menu View -> Tool Windows -> sbt
Once you open the panel, open the contextual menu and select the option Ignore sbt Project
Then, you will see that the icon of the directory has been changed
Upvotes: 0