Resolve References in plugins

This commit is contained in:
Mark Harrah 2011-06-23 20:37:56 -04:00
parent b867d2e398
commit e5fbfdd3c1
1 changed files with 3 additions and 3 deletions

View File

@ -138,7 +138,7 @@ object Load
loaded.units.toSeq flatMap { case (uri, build) => loaded.units.toSeq flatMap { case (uri, build) =>
val eval = if(uri == loaded.root) rootEval else lazyEval(build.unit) val eval = if(uri == loaded.root) rootEval else lazyEval(build.unit)
val pluginSettings = build.unit.plugins.plugins val pluginSettings = build.unit.plugins.plugins
val (pluginThisProject, pluginGlobal) = pluginSettings partition isProjectThis val (pluginThisProject, pluginNotThis) = pluginSettings partition isProjectThis
val projectSettings = build.defined flatMap { case (id, project) => val projectSettings = build.defined flatMap { case (id, project) =>
val srcs = configurationSources(project.base) val srcs = configurationSources(project.base)
val ref = ProjectRef(uri, id) val ref = ProjectRef(uri, id)
@ -153,13 +153,13 @@ object Load
} }
val buildScope = Scope(Select(BuildRef(uri)), Global, Global, Global) val buildScope = Scope(Select(BuildRef(uri)), Global, Global, Global)
val buildBase = baseDirectory :== build.localBase val buildBase = baseDirectory :== build.localBase
pluginGlobal ++ inScope(buildScope)(buildBase +: build.buildSettings) ++ projectSettings val buildSettings = transformSettings(buildScope, uri, rootProject, pluginNotThis ++ (buildBase +: build.buildSettings))
buildSettings ++ projectSettings
} }
def transformSettings(thisScope: Scope, uri: URI, rootProject: URI => String, settings: Seq[Setting[_]]): Seq[Setting[_]] = def transformSettings(thisScope: Scope, uri: URI, rootProject: URI => String, settings: Seq[Setting[_]]): Seq[Setting[_]] =
Project.transform(Scope.resolveScope(thisScope, uri, rootProject), settings) Project.transform(Scope.resolveScope(thisScope, uri, rootProject), settings)
def projectScope(project: Reference): Scope = Scope(Select(project), Global, Global, Global) def projectScope(project: Reference): Scope = Scope(Select(project), Global, Global, Global)
def lazyEval(unit: BuildUnit): () => Eval = def lazyEval(unit: BuildUnit): () => Eval =
{ {
lazy val eval = mkEval(unit) lazy val eval = mkEval(unit)