You need to set a1Key and a2Key so that bKey canceled bKey :
lazy val rootProject = Project("P", file(".")).settings( bKey := "Fnord", a1Key <<= (bKey in a1Key)(x => ">>>" + x + "<<<"), a2Key <<= (bKey in a2Key)(x => ">>>" + x + "<<<") ).settings( bKey in a1Key := "Meep" )
Thus, calculating a1Key will use the more specific Meep value, and when calculating a2Key sbt will "look" for the definition of bKey in a2Key , and then, since it does not "find" it, it returns to the more general bKey (in the default area), which defined and therefore used.
Edit: this, unfortunately, means that if someone providing definitions for the a1Key and a2Key parameters also explicitly provides the required extension points (in the form of dependencies with a configuration binding), you cannot override the dependencies. That, at least, is how I understand it.
user500592
source share