6

I can't get the embedded sbt plugin (with auto import enabled) in Intellij (13.1) to recognize custom sbt configurations. I have the follow setup in my sbt build file:

  lazy val EndToEndTest = config("e2e") extend (Test)

  private lazy val e2eSettings =
     inConfig(EndToEndTest)(Defaults.testSettings)

  lazy val root: Project = Project(
    id = "root",
    base = file(".")
  )
   .configs(EndToEndTest)
   .settings(e2eSettings)

The code works according to expectations in the sbt console. E.g I can write: sbt e2e:test (and it will execute tests located in /src/e2e/scala)

The issue is that the directory /src/e2e/scala won't get registered as a source directory in Intellij. This makes it hard to use intellij to manage the tests. I can manually mark the directory as source but it gets reverted every time

  1. I update my sbt files (auto import).
  2. Do a manual update through the sbt tool window

Related: Using the preconfigured configuration IntegrationTest works as expected but custom once don't.

Tobias
  • 1,062
  • 1
  • 9
  • 15

1 Answers1

0

According to sbt-idea documentation this can be done in your case by adding

ideaExtraTestConfigurations := Seq(EndToEndTest)

to your project settings.

systemtrap
  • 40
  • 5
  • 1
    I'm not using the sbt-idea sbt plugin. Intellij comes with sbt support since version 13. Are you saying that Intellij is using the sbt-idea plugin under the hood? – Tobias Apr 12 '15 at 03:11