Custom sbt configuration with auto-import Intellij

I can not get the built-in sbt plugin (with automatic import) in Intellij (13.1) for recognizing user sbt configurations. I have the following setting in the 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 as expected in the sbt console. For example, I can write: sbt e2e: test (and it will run the tests located in / src / e 2e / scala)

The problem is that the / src / e 2e / scala directory will not be registered as the source directory in Intellij. This makes it difficult to use intellij for test management. I can manually mark the directory as a source, but it is returned every time

  • I am updating my sbt files (automatic import).
  • Manually update via sbt tool window

Related: Using a preconfigured configuration, IntegrationTest works as expected, but the user does not do this once.

+6
source share
1 answer

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

 ideaExtraTestConfigurations := Seq(EndToEndTest) 

to your project settings.

0
source

Source: https://habr.com/ru/post/984694/


All Articles