Work-around actions/depends-on failure

This commit is contained in:
Dale Wijnand 2017-01-13 14:22:49 +00:00
parent 7ca327fc08
commit c9ba9502a7
No known key found for this signature in database
GPG Key ID: 4F256E3D151DF5EF
1 changed files with 5 additions and 2 deletions

View File

@ -6,7 +6,7 @@ package std
import scala.sys.process.{ BasicIO, ProcessIO, ProcessBuilder }
import sbt.internal.util.AList
import sbt.internal.util.{ AList, AttributeMap }
import sbt.internal.util.Types._
import java.io.{ BufferedInputStream, BufferedReader, File, InputStream }
import sbt.io.IO
@ -120,7 +120,10 @@ trait TaskExtra {
def failure: Task[Incomplete] = mapFailure(idFun)
def result: Task[Result[S]] = mapR(idFun)
private def newInfo[A]: Info[A] = Info[A](in.info.attributes)
// The "taskDefinitionKey" is used, at least, by the ".previous" functionality.
// But apparently it *cannot* survive a task map/flatMap/etc. See actions/depends-on.
private def newInfo[A]: Info[A] =
Info[A](AttributeMap(in.info.attributes.entries.filter(_.key.label != "taskDefinitionKey")))
def flatMapR[T](f: Result[S] => Task[T]): Task[T] = Task(newInfo, new FlatMapped[T, K](in, f, ml))
def mapR[T](f: Result[S] => T): Task[T] = Task(newInfo, new Mapped[T, K](in, f, ml))