How can I declare 2 custom sbt parameters, for example A and B, define B in the Global config area with content that depends on A, define A differently in several configuration areas so that the resulting B value is different in each configuration, although B is defined only once?
Consider, for example, targetHost below, defined differently in remote than in another configuration, and scriptContent depending on it:
object MyBuild extends Build { lazy val remote = config("remote") describedAs ("configuration for remote environement ") lazy val targetHost = settingKey[String]("private hostname of master server") lazy val scriptContent = settingKey[String]("Some deployment script") lazy val root: Project = Project("meme", file(".")). settings( name := "hello", targetHost := "localhost", targetHost in remote := "snoopy", scriptContent := s""" # some bash deployment here /usr/local/uberDeploy.sh ${targetHost.value} """ ) }
I would like scriptContent have a different value in both areas of the configuration, but since it depends on targetHost in the Global , its value is always the same:
> scriptContent [info] [info]
While I would like to get the following:
> scriptContent [info] [info]
Svend source share