diff --git a/main/Project.scala b/main/Project.scala index 37fa3d246..985de01da 100644 --- a/main/Project.scala +++ b/main/Project.scala @@ -80,6 +80,7 @@ object Project extends Init[Scope] def mapScope(f: Scope => Scope) = new (ScopedKey ~> ScopedKey) { def apply[T](key: ScopedKey[T]) = ScopedKey( f(key.scope), key.key) } + def resolveThis(thisScope: Scope) = mapScope(Scope.replaceThis(thisScope)) def transform(g: Scope => Scope, ss: Seq[Setting[_]]): Seq[Setting[_]] = { val f = mapScope(g) ss.map(_ mapKey f mapReferenced f) diff --git a/main/Structure.scala b/main/Structure.scala index b1697c94d..c187005b1 100644 --- a/main/Structure.scala +++ b/main/Structure.scala @@ -221,6 +221,7 @@ object Scoped implicit def t2ToApp2[A,B](t2: (ScopedSetting[A], ScopedSetting[B]) ): Apply2[A,B] = new Apply2(t2) implicit def t3ToApp3[A,B,C](t3: (ScopedSetting[A], ScopedSetting[B], ScopedSetting[C]) ): Apply3[A,B,C] = new Apply3(t3) + implicit def t4ToApp4[A,B,C,D](t4: (ScopedSetting[A], ScopedSetting[B], ScopedSetting[C], ScopedSetting[D]) ): Apply4[A,B,C,D] = new Apply4(t4) final class Apply[T] private(val toSetting: ScopedKey[T] => Setting[T]) @@ -249,6 +250,10 @@ object Scoped def apply[T](f: (A,B,C) => T) = Apply(t3._1 :^: t3._2 :^: t3._3 :^: KNil){ case a :+: b :+: c :+: HNil => f(a,b,c) } } + final class Apply4[A,B,C,D](t4: (ScopedSetting[A], ScopedSetting[B], ScopedSetting[C], ScopedSetting[D])) { + def apply[T](f: (A,B,C,D) => T) = + Apply(t4._1 :^: t4._2 :^: t4._3 :^: t4._4 :^: KNil){ case a :+: b :+: c :+: d :+: HNil => f(a,b,c,d) } + } /*def unresolved(scope: Scope): Seq[String] = unresolvedProject(scope.project) ++ unresolvedThis(scope) def unresolvedProject(ps: ScopeAxis[ProjectRef]): Seq[String] = ps match {