From 5a252fae3a218c78bb818ceb301e3848a1003f49 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Mon, 10 Jun 2013 14:09:27 -0400 Subject: [PATCH] ScopeFilter.debug to print accepted and rejected scopes --- main/src/main/scala/sbt/ScopeFilter.scala | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/main/src/main/scala/sbt/ScopeFilter.scala b/main/src/main/scala/sbt/ScopeFilter.scala index fea090332..c2f2a65e2 100644 --- a/main/src/main/scala/sbt/ScopeFilter.scala +++ b/main/src/main/scala/sbt/ScopeFilter.scala @@ -29,6 +29,19 @@ object ScopeFilter } } + def debug(delegate: ScopeFilter): ScopeFilter = + new ScopeFilter { + private[sbt] def apply(data: Data): Scope => Boolean = + { + val d = delegate(data) + scope => { + val accept = d(scope) + println( (if(accept) "ACCEPT " else "reject ") + scope) + accept + } + } + } + final class SettingKeyAll[T] private[sbt](i: Initialize[T]) { /** Evaluates the initialization in all scopes selected by the filter. These are dynamic dependencies, so * static inspections will not show them. */