jedesah
jedesah

Reputation: 3033

Is it possible to configure sub-project dependencies in SBT based on a `SettingKey`?

I am trying to accomplish something like this:

lazy val customFlag = settingKey[Boolean]("My custom flag")

lazy val depOne    = project ...
lazy val depTwo    = project ...

lazy val myproject = project
  .settings(
    customFlag := false)
  .dependsOn(if (customFlag) depOne else depTwo)

The idea being, that I could then use set customFlag := true in the sbt console in order to change whether project myproject depends on sub-project one or two.

I have a hunch at this point that the answer is that this is not possible. But it would be nice to get confirmation or an alternative to accomplish something similar.

Upvotes: 3

Views: 52

Answers (1)

Eugene Yokota
Eugene Yokota

Reputation: 95664

No. It's not possible to use setting key in the dependsOn.

Upvotes: 2

Related Questions