fixes to 'inspect' delegates and provided by outputs

This commit is contained in:
Mark Harrah 2011-03-25 22:01:21 -04:00
parent aa395583b5
commit 2ab8f5c3c0
2 changed files with 5 additions and 4 deletions

View File

@ -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 }

View File

@ -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