From d740965ea1ebd9029ed1894a1c096f80bef49cef Mon Sep 17 00:00:00 2001 From: Dan Sanduleac Date: Fri, 22 Nov 2013 18:25:23 +0000 Subject: [PATCH] Fix deriveAndLocal bug --- util/collection/src/main/scala/sbt/Settings.scala | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/util/collection/src/main/scala/sbt/Settings.scala b/util/collection/src/main/scala/sbt/Settings.scala index 350ae4026..3780adad2 100644 --- a/util/collection/src/main/scala/sbt/Settings.scala +++ b/util/collection/src/main/scala/sbt/Settings.scala @@ -342,12 +342,13 @@ trait Init[Scope] val derivedForKey: List[Derived] = derivedBy.get(sk.key).toList.flatten val scope = sk.scope def localAndDerived(d: Derived): Seq[Setting[_]] = - if(d.inScopes.add(scope) && d.setting.filter(scope)) + if(!d.inScopes.contains(scope) && d.setting.filter(scope)) { val local = d.dependencies.flatMap(dep => scopeLocal(ScopedKey(scope, dep))) - if(allDepsDefined(d, scope, local.map(_.key.key).toSet)) + if(allDepsDefined(d, scope, local.map(_.key.key).toSet)) { + d.inScopes.add(scope) local :+ d.setting.setScope(scope) - else + } else Nil } else Nil