The following is a sbt 0.13.1
project with a custom setting and a value for it:
% pwd
/Users/tisue/myproj
% ls
build.sbt
% cat build.sbt
val foo = settingKey[String]("This is a custom setting")
foo := "bar"
% sbt
[info] Set current project to myproj (in build file:/Users/tisue/myproj/)
> show foo
[info] bar
So far so good. But now:
> set foo := "qux"
<set>:1: error: not found: value foo
foo := "qux"
^
[error] Type error in expression
Shouldn't this work?
I partially understand what's going wrong here; set
evaluates a Scala expression, and that expression is apparently being compiled in a context where val foo
is not in scope.
But I would expect that the magic that makes sure foo
is in scope when foo := ...
is compiled from the .sbt
file, would also be in effect when the same thing is compiled in the shell.