From 2ab8f5c3c08ff8b21395b38e0622b46c944552d3 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Fri, 25 Mar 2011 22:01:21 -0400 Subject: [PATCH] fixes to 'inspect' delegates and provided by outputs --- main/Project.scala | 4 ++-- main/Scope.scala | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/main/Project.scala b/main/Project.scala index 74aab4e1c..ac8c44862 100644 --- a/main/Project.scala +++ b/main/Project.scala @@ -162,13 +162,13 @@ object Project extends Init[Scope] { val scoped = ScopedKey(scope,key) val value = - (structure.data.get(scope, key)) match { + structure.data.get(scope, key) match { case None => "No entry for key." case Some(v: Task[_]) => "Task" case Some(v: InputTask[_]) => "Input task" case Some(v) => "Value:\n\t" + v.toString } - val definedIn = structure.data.definingScope(scope, key) match { case Some(sc) => "Provided by:\n\t" + display(scoped); case None => "" } + val definedIn = structure.data.definingScope(scope, key) match { case Some(sc) => "Provided by:\n\t" + Scope.display(sc, key.label); case None => "" } val cMap = compiled(structure.settings)(structure.delegates, structure.scopeLocal) val related = cMap.keys.filter(k => k.key == key && k.scope != scope) val depends = cMap.get(scoped) match { case Some(c) => c.dependencies.toSet; case None => Set.empty } diff --git a/main/Scope.scala b/main/Scope.scala index 976acdaab..da79103ca 100644 --- a/main/Scope.scala +++ b/main/Scope.scala @@ -123,8 +123,8 @@ object Scope val scope = Scope.replaceThis(GlobalScope)(rawScope) scope.project match { - case Global => scope :: GlobalScope :: Nil - case This => scope.copy(project = Global) :: GlobalScope :: Nil + case Global => withGlobalScope(scope) + case This => withGlobalScope(scope.copy(project = Global)) case Select(proj) => val projI = withRawBuilds(linearize(scope.project, Nil)(projectInherit)).distinct val prod = @@ -139,6 +139,7 @@ object Scope (prod :+ GlobalScope).distinct } } + def withGlobalScope(base: Scope): Seq[Scope] = if(base == GlobalScope) GlobalScope :: Nil else base :: GlobalScope :: Nil def withRawBuilds(ps: Seq[ScopeAxis[Reference]]): Seq[ScopeAxis[Reference]] = (ps ++ (ps flatMap rawBuilds).map(Select.apply) :+ Global).distinct