mirror of https://github.com/sbt/sbt.git
Allow multiple sources to target a target directory in sync.noDuplicateTargets. fixes #125
This commit is contained in:
parent
5d353b4113
commit
eb31cc025a
|
|
@ -58,14 +58,14 @@ object Sync
|
|||
|
||||
def noDuplicateTargets(relation: Relation[File, File])
|
||||
{
|
||||
val dups = relation.reverseMap.collect {
|
||||
case (target, srcs) if srcs.size >= 2 =>
|
||||
"\n\t" + target + "\nfrom\n\t" + srcs.mkString("\n\t")
|
||||
val dups = relation.reverseMap.filter { case (target, srcs) =>
|
||||
srcs.size >= 2 && srcs.forall(_.isDirectory)
|
||||
} map { case (target, srcs) =>
|
||||
"\n\t" + target + "\nfrom\n\t" + srcs.mkString("\n\t\t")
|
||||
}
|
||||
if(!dups.isEmpty)
|
||||
error("Duplicate mappings:" + dups.mkString)
|
||||
}
|
||||
|
||||
|
||||
import java.io.{File, IOException}
|
||||
import sbinary._
|
||||
|
|
|
|||
Loading…
Reference in New Issue