Andreas Neumann
Andreas Neumann

Reputation: 10884

Make sbt constant having a dependency included in Test and Integration Test

How to state that a library should be used for Test and IntegrationTest without falling back to strings like "test,it"?

Example:

  "org.scalamock" %% "scalamock-scalatest-support" % "3.3.0" % Test,
  "org.scalatest" %% "scalatest" % scalaTestVersion % "test,it" //<- how to make this safer

Upvotes: 4

Views: 162

Answers (1)

Simon30
Simon30

Reputation: 358

The safest way I found to code that is using a Seq and mkstring like that:

"dependency" % Seq(Test, IntegrationTest).mkString(",")

It is a workaround and I'm not sure it's a good practice to have that kind of logic in a build.

Upvotes: 1

Related Questions