Open kelemensanyi opened 7 years ago
Thanks @kelemensanyi.
Hey there, I am new into sbt and I was also reading through the tutorial and hit the problem.
I managed to edit the line to make it work, and it seems like that its working how its intented to work.
I changed
ur.allConfigurations.take(3)
to
ur.allConfigurations.take(3).foldLeft[Seq[String]](Nil)((a, b)=>{(b.name::Nil)++:a})
and its running without errors.
When I type
show scalacOptions
I am getting this result, which seems legit
sbt:Hello> show scalacOptions
[info] 123
[info] 456
[info] * test
[info] * runtime
[info] * compile
[success] Total time: 0 s, completed 02.12.2017, 23:59:43
I would like to have confirmation uppon that, because I can't really myself, as I am new into sbt.
EDIT:
Ofcourse you would want to use foldRight not foldLeft like i did, to get the items in the correct order
ur.allConfigurations.take(3).foldRight[Seq[String]](Nil)((a, b)=>{(a.name::Nil)++:b})
like this
sbt:Hello> show scalacOptions
[info] 123
[info] 456
[info] * compile
[info] * runtime
[info] * test
ur.allConfigurations.map(_.toString) should be good enough :)
scalacOptions := {
println("->>>>>>>>>>>>>>>>>>>>")
var ur = update.value
clean.value
println("-<<<<<<<<<<<<<<<<<<<<")
ur.allConfigurations.map(_.toString)
},
gives then:
[IJ]sbt:work> show scalacOptions [info] Updating ... [info] Done updating. ->>>>>>>>>>>>>>>>>>>> -<<<<<<<<<<<<<<<<<<<< [info] compile [info] runtime [info] test [info] provided [info] optional [info] compile-internal [info] runtime-internal [info] test-internal [info] plugin [info] pom [info] * scala-tool [success] Total time: 1 s, completed Feb 25, 2018 10:42:55 PM [IJ]sbt:work>
The Task Graph page http://www.scala-sbt.org/1.x/docs/Task-Graph.html contains three examples containing the expression
ur.allConfigurations.take(3)
which all seem broken: