From 1ee5891ac915c3469fb7841d7b6dd0f06e26f05c Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Sat, 5 Mar 2011 08:50:08 -0500 Subject: [PATCH] further delegation adjustments to searching project=Global --- main/Scope.scala | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/main/Scope.scala b/main/Scope.scala index afffe941e..db2563f88 100644 --- a/main/Scope.scala +++ b/main/Scope.scala @@ -119,16 +119,17 @@ object Scope case Global => scope :: GlobalScope :: Nil case This => scope.copy(project = Global) :: GlobalScope :: Nil case Select(proj) => + val projI = withRawBuilds(linearize(scope.project, Nil)(projectInherit)).distinct val prod = for { - c <- linearize(scope.config)(configInherit(proj, _)) - t <- linearize(scope.task)(taskInherit(proj,_)) - e <- linearize(scope.extra)(extraInherit(proj,_)) + px <- projI + p = px.toOption getOrElse proj + c <- linearize(scope.config)(configInherit(p, _)) + t <- linearize(scope.task)(taskInherit(p,_)) + e <- linearize(scope.extra)(extraInherit(p,_)) } yield - Scope(Select(proj),c,t,e) - val projI = - withRawBuilds(linearize(scope.project, Nil)(projectInherit)) map { p => scope.copy(project = p) } - (prod ++ projI :+ GlobalScope).distinct + Scope(px,c,t,e) + (prod :+ GlobalScope).distinct } } def withRawBuilds(ps: Seq[ScopeAxis[Reference]]): Seq[ScopeAxis[Reference]] = @@ -140,7 +141,7 @@ object Scope def linearize[T](axis: ScopeAxis[T], append: Seq[ScopeAxis[T]] = Global :: Nil)(inherit: T => Seq[T]): Seq[ScopeAxis[T]] = axis match { - case Select(x) => Dag.topologicalSort(x)(inherit).map(Select.apply).reverse ++ append + case Select(x) => (Dag.topologicalSort(x)(inherit).map(Select.apply).reverse ++ append).distinct case Global | This => append } }