workaround for ThisProject not being properly resolved by Scope.resolve*

This commit is contained in:
Mark Harrah 2013-03-28 16:08:23 -04:00
parent d6ef9b0154
commit 7605818f04
1 changed files with 6 additions and 2 deletions

View File

@ -99,12 +99,16 @@ object ScopeFilter
Def.setting {
val build = Keys.loadedBuild.value
val scopes = Def.StaticScopes.value
val current = Keys.thisProjectRef.?.value match {
val thisRef = Keys.thisProjectRef.?.value
val current = thisRef match {
case Some(ProjectRef(uri, _)) => uri
case None => build.root
}
val rootProject = Load.getRootProject(build.units)
val resolve: ProjectReference => ProjectRef = p => Scope.resolveProjectRef(current, rootProject, p)
val resolve: ProjectReference => ProjectRef = p => (p, thisRef) match {
case (ThisProject, Some(pref)) => pref
case _ => Scope.resolveProjectRef(current, rootProject, p)
}
new Data(build.units, resolve, scopes)
}