mirror of https://github.com/sbt/sbt.git
provide access to some project structure as a setting
This commit is contained in:
parent
aa7ea022b8
commit
f7f6879f5e
|
|
@ -37,6 +37,7 @@ object Keys
|
|||
val sessionSettings = AttributeKey[SessionSettings]("session-settings", "Tracks current build, project, and setting modifications.")
|
||||
val stateBuildStructure = AttributeKey[Load.BuildStructure]("build-structure", "Data structure containing all information about the build definition.")
|
||||
val buildStructure = TaskKey[Load.BuildStructure]("build-structure", "Provides access to the build structure, settings, and streams manager.")
|
||||
val loadedBuild = SettingKey[Load.LoadedBuild]("loaded-build", "Provides access to the loaded project structure. This is the information available before settings are evaluated.")
|
||||
val appConfiguration = SettingKey[xsbti.AppConfiguration]("app-configuration", "Provides access to the launched sbt configuration, including the ScalaProvider, Launcher, and GlobalLock.")
|
||||
val thisProject = SettingKey[ResolvedProject]("this-project", "Provides the current project for the referencing scope.")
|
||||
val thisProjectRef = SettingKey[ProjectRef]("this-project-ref", "Provides a fully-resolved reference to the current project for the referencing scope.")
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ package sbt
|
|||
import inc.{FileValueCache, Locate}
|
||||
import Project.{inScope, ScopedKey, ScopeLocal, Setting}
|
||||
import Keys.{appConfiguration, baseDirectory, configuration, streams, Streams, thisProject, thisProjectRef}
|
||||
import Keys.{globalLogging, isDummy, parseResult, resolvedScoped, taskDefinitionKey}
|
||||
import Keys.{globalLogging, isDummy, loadedBuild, parseResult, resolvedScoped, taskDefinitionKey}
|
||||
import tools.nsc.reporters.ConsoleReporter
|
||||
import Build.{analyzed, data}
|
||||
import Scope.{GlobalScope, ThisScope}
|
||||
|
|
@ -180,7 +180,8 @@ object Load
|
|||
|
||||
def isProjectThis(s: Setting[_]) = s.key.scope.project match { case This | Select(ThisProject) => true; case _ => false }
|
||||
def buildConfigurations(loaded: LoadedBuild, rootProject: URI => String, rootEval: () => Eval, injectSettings: InjectSettings): Seq[Setting[_]] =
|
||||
transformProjectOnly(loaded.root, rootProject, injectSettings.global) ++
|
||||
((loadedBuild in GlobalScope :== loaded) +:
|
||||
transformProjectOnly(loaded.root, rootProject, injectSettings.global)) ++
|
||||
loaded.units.toSeq.flatMap { case (uri, build) =>
|
||||
val eval = if(uri == loaded.root) rootEval else lazyEval(build.unit)
|
||||
val pluginSettings = build.unit.plugins.plugins
|
||||
|
|
|
|||
Loading…
Reference in New Issue