mirror of https://github.com/sbt/sbt.git
Roll back the use of sbt/serialization for update caching
This commit is contained in:
parent
4eff1d0262
commit
1891b52472
|
|
@ -38,7 +38,8 @@ object Tracked {
|
|||
toFile(next)(cacheFile)
|
||||
next
|
||||
}
|
||||
private[sbt] def lastOuputWithJson[I, O: Pickler: Unpickler](cacheFile: File)(f: (I, Option[O]) => O): I => O = in =>
|
||||
// Todo: This function needs more testing.
|
||||
private[sbt] def lastOutputWithJson[I, O: Pickler: Unpickler](cacheFile: File)(f: (I, Option[O]) => O): I => O = in =>
|
||||
{
|
||||
val previous: Option[O] = try {
|
||||
fromJsonFile[O](cacheFile).toOption
|
||||
|
|
|
|||
|
|
@ -1388,13 +1388,13 @@ object Classpaths {
|
|||
|
||||
val outCacheFile = cacheFile / "output"
|
||||
def skipWork: In => UpdateReport =
|
||||
Tracked.lastOuputWithJson[In, UpdateReport](outCacheFile) {
|
||||
Tracked.lastOutput[In, UpdateReport](outCacheFile) {
|
||||
case (_, Some(out)) => out
|
||||
case _ => sys.error("Skipping update requested, but update has not previously run successfully.")
|
||||
}
|
||||
def doWork: In => UpdateReport =
|
||||
Tracked.inputChanged(cacheFile / "inputs") { (inChanged: Boolean, in: In) =>
|
||||
val outCache = Tracked.lastOuputWithJson[In, UpdateReport](outCacheFile) {
|
||||
val outCache = Tracked.lastOutput[In, UpdateReport](outCacheFile) {
|
||||
case (_, Some(out)) if uptodate(inChanged, out) => out
|
||||
case _ => work(in)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue