Answering a question about this on the sbt mailing list, but apparently it crashed
I created a github project that works around "sbt> clean" from dropping the artifact update cache directory. Works great on 0.12.4, but broken in 0.13, my own update cache directory is empty after "sbt> update"
Which is equivalent:
cacheDirectory <<= baseDirectory / "sbt-no-clean"
at 0.13? I see that cacheDirectory out of date and we will use streams instead.
Frequently Asked Questions SBT for 0.13 contains a section on using FileFunction.cached, is there a replacement for the above 1 liner? Does not look like it.
Streams can actually do this work, but since the old cacheDirectory no longer works - well, technically this attribute is set, but something overrides it, so this is more of a deletion than an obsolete function - - I switched gear and try to use cleanKeepFiles :
cleanKeepFiles <<= (streams) map{s=> Seq(s.cacheDirectory)}
I get a return type mismatch crazy in this, as I have no idea how to handle it:
sbt.Def.Initialize[sbt.Task[Seq[java.io.File]]]
in
sbt.Def.Initialize[Seq[java.io.File]]
Ideas appreciated, Thanks
EDIT
If you use the application instead of a map:
cleanKeepFiles <<= streams.apply{_.map(x=>Seq(x.cacheDirectory))}
then you will get:
sbt.Task[Seq[java.io.File]]
which seems to be approaching, but then the compiler wants:
Seq[java.io.File]
cleanKeepFiles is of type SettingKey[Seq[File]]
I do not understand how to get SettingKey[Seq[File]] from the stream type: TaskKey[TaskStreams]